diff --git a/manifests/nbiservice.yaml b/manifests/nbiservice.yaml index d3892118a3d8330335b58459a0953bb45e4854ea..70f553e6425ca7972b8af185f432842b4e184790 100644 --- a/manifests/nbiservice.yaml +++ b/manifests/nbiservice.yaml @@ -38,6 +38,8 @@ spec: env: - name: LOG_LEVEL value: "INFO" + - name: IETF_NETWORK_RENDERER + value: "LIBYANG" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:9090"] 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 index 0c10559115f4e4ba9e5b2468e36cf7f917c25f51..94e4723a5c7ca83fb382bb70cb241cb69b66ce0e 100644 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py +++ b/src/nbi/service/rest_server/nbi_plugins/ietf_network/NameMapping.py @@ -19,7 +19,7 @@ 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 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 5d663b8b3071856bc9cd204ee911c61b368ebe97..b53dc0fc242ff220e19091eab103902488ae2a3c 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,19 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json, logging +import enum, json, logging import pyangbind.lib.pybindJSON as pybindJSON 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.Settings import get_setting +from common.proto.context_pb2 import ContextId, Empty 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 from .bindings import ietf_network from .ComposeNetwork import compose_network from .ManualFixes import manual_fixes +from .YangHandler import YangHandler LOGGER = logging.getLogger(__name__) @@ -33,6 +37,14 @@ TE_TOPOLOGY_NAMES = [ 'providerId-10-clientId-0-topologyId-2' ] +class Renderer(enum.Enum): + LIBYANG = 'LIBYANG' + PYANGBIND = 'PYANGBIND' + +DEFAULT_RENDERER = Renderer.LIBYANG +USE_RENDERER = get_setting('IETF_NETWORK_RENDERER', DEFAULT_RENDERER.value) + + class Networks(Resource): @HTTP_AUTH.login_required def get(self): @@ -40,31 +52,59 @@ class Networks(Resource): 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_nets = ietf_network() + if USE_RENDERER == Renderer.PYANGBIND.value: + #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_nets = ietf_network() + + 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, 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)) + 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) - 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')) + + # Workaround; pyangbind does not allow to set otn_topology / eth-tran-topology + manual_fixes(json_response) + elif USE_RENDERER == Renderer.LIBYANG.value: + yang_handler = YangHandler() + json_response = [] - # TODO: improve these workarounds to enhance performance - json_response = json.loads(pybindJSON.dumps(ietf_nets, mode='ietf')) - - # Workaround; pyangbind does not allow to set otn_topology / eth-tran-topology - manual_fixes(json_response) + contexts = context_client.ListContexts(Empty()).contexts + context_names = [context.name for context in contexts] + LOGGER.info(f'Contexts detected: {context_names}') + + for context_name in context_names: + topologies = context_client.ListTopologies(ContextId(**json_context_id(context_name))).topologies + topology_names = [topology.name for topology in topologies] + LOGGER.info(f'Topologies detected for context {context_name}: {topology_names}') + + for topology_name in topology_names: + topology_details = get_topology_details(context_client, topology_name, context_name) + if topology_details is None: + raise Exception(f'Topology({context_name}/{topology_name}) not found') + + network_reply = yang_handler.compose_network(topology_name, topology_details) + json_response.append(network_reply) + + yang_handler.destroy() + else: + raise Exception('Unsupported Renderer: {:s}'.format(str(USE_RENDERER))) 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))) response = jsonify({'error': str(e)}) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/YangHandler.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network/YangHandler.py similarity index 100% rename from src/nbi/service/rest_server/nbi_plugins/ietf_network_new/YangHandler.py rename to src/nbi/service/rest_server/nbi_plugins/ietf_network/YangHandler.py diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-l3-unicast-topology@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-l3-unicast-topology@2018-02-26.yang similarity index 100% rename from src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-l3-unicast-topology@2018-02-26.yang rename to src/nbi/service/rest_server/nbi_plugins/ietf_network/yang/ietf-l3-unicast-topology@2018-02-26.yang diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/NameMapping.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/NameMapping.py deleted file mode 100644 index 94e4723a5c7ca83fb382bb70cb241cb69b66ce0e..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/NameMapping.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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_new/Networks.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/Networks.py deleted file mode 100644 index fb97168ab58ad44c986509a03179dbce1de95eb4..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/Networks.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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 -from flask import request -from flask.json import jsonify -from flask_restful import Resource -from common.proto.context_pb2 import ContextId, Empty -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 -from .YangHandler import YangHandler - -LOGGER = logging.getLogger(__name__) - -class Networks(Resource): - @HTTP_AUTH.login_required - def get(self): - LOGGER.info(f'Request: {request}') - try: - context_client = ContextClient() - yang_handler = YangHandler() - network_list_reply = [] - - contexts = context_client.ListContexts(Empty()).contexts - context_names = [context.name for context in contexts] - LOGGER.info(f'Contexts detected: {context_names}') - - for context_name in context_names: - topologies = context_client.ListTopologies(ContextId(**json_context_id(context_name))).topologies - topology_names = [topology.name for topology in topologies] - LOGGER.info(f'Topologies detected for context {context_name}: {topology_names}') - - for topology_name in topology_names: - topology_details = get_topology_details(context_client, topology_name, context_name) - if topology_details is None: - raise Exception(f'Topology({context_name}/{topology_name}) not found') - - network_reply = yang_handler.compose_network(topology_name, topology_details) - network_list_reply.append(network_reply) - - yang_handler.destroy() - response = jsonify(network_list_reply) - response.status_code = HTTP_OK - - except Exception as e: - LOGGER.exception(f'Error retrieving topologies: {e}') - response = jsonify({'error': str(e)}) - response.status_code = HTTP_SERVERERROR - return response diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/__init__.py b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/__init__.py deleted file mode 100644 index 4503c22d502b71ddbfbb96b35534d24d3fac1426..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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 - -# 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 nbi.service.rest_server.RestServer import RestServer -from nbi.service.rest_server.nbi_plugins.ietf_network_new.Networks import Networks - -URL_PREFIX = '/restconf/data/ietf-network:networks' - -def register_ietf_network(rest_server : RestServer): - rest_server.add_resource(Networks, URL_PREFIX) diff --git a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/iana-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/iana-routing-types@2017-12-04.yang deleted file mode 100644 index 250cba4b695e269116e181b46226bae7dab7604d..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/iana-routing-types@2017-12-04.yang +++ /dev/null @@ -1,473 +0,0 @@ - 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 - <mailto:iana@iana.org>"; - - 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_new/yang/ietf-inet-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-inet-types@2013-07-15.yang deleted file mode 100644 index 790bafc31dd7dc3582ef1c765fe104145b8a6016..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-inet-types@2013-07-15.yang +++ /dev/null @@ -1,459 +0,0 @@ - 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: <http://tools.ietf.org/wg/netmod/> - WG List: <mailto:netmod@ietf.org> - - WG Chair: David Kessens - <mailto:david.kessens@nsn.com> - - WG Chair: Juergen Schoenwaelder - <mailto:j.schoenwaelder@jacobs-university.de> - - Editor: Juergen Schoenwaelder - <mailto:j.schoenwaelder@jacobs-university.de>"; - - 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 <http://www.iana.org/>. - - 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_new/yang/ietf-network-topology@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-network-topology@2018-02-26.yang deleted file mode 100644 index 0538ac01b629e80db37bd66a3128ac5e04dfbcef..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-network-topology@2018-02-26.yang +++ /dev/null @@ -1,294 +0,0 @@ - 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: <https://datatracker.ietf.org/wg/i2rs/> - WG List: <mailto:i2rs@ietf.org> - - Editor: Alexander Clemm - <mailto:ludwig@clemm.org> - - Editor: Jan Medved - <mailto:jmedved@cisco.com> - - Editor: Robert Varga - <mailto:robert.varga@pantheon.tech> - - Editor: Nitin Bahadur - <mailto:nitin_bahadur@yahoo.com> - - Editor: Hariharan Ananthakrishnan - <mailto:hari@packetdesign.com> - - Editor: Xufeng Liu - <mailto:xufeng.liu.ietf@gmail.com>"; - - 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_new/yang/ietf-network@2018-02-26.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-network@2018-02-26.yang deleted file mode 100644 index d9da81eeebefad9054a43af552de3d51f20bcd56..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-network@2018-02-26.yang +++ /dev/null @@ -1,193 +0,0 @@ - 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: <https://datatracker.ietf.org/wg/i2rs/> - WG List: <mailto:i2rs@ietf.org> - - Editor: Alexander Clemm - <mailto:ludwig@clemm.org> - - Editor: Jan Medved - <mailto:jmedved@cisco.com> - - Editor: Robert Varga - <mailto:robert.varga@pantheon.tech> - - Editor: Nitin Bahadur - <mailto:nitin_bahadur@yahoo.com> - - Editor: Hariharan Ananthakrishnan - <mailto:hari@packetdesign.com> - - Editor: Xufeng Liu - <mailto:xufeng.liu.ietf@gmail.com>"; - - 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_new/yang/ietf-routing-types@2017-12-04.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-routing-types@2017-12-04.yang deleted file mode 100644 index 695d9eaeb9e771b945397c8b1c817ce91b0414af..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-routing-types@2017-12-04.yang +++ /dev/null @@ -1,774 +0,0 @@ - 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: <https://datatracker.ietf.org/wg/rtgwg/> - WG List: <mailto:rtgwg@ietf.org> - - Editors: Xufeng Liu - <mailto:Xufeng_Liu@jabail.com> - Yingzhen Qu - <mailto:yingzhen.qu@huawei.com> - Acee Lindem - <mailto:acee@cisco.com> - Christian Hopps - <mailto:chopps@chopps.org> - Lou Berger - <mailto:lberger@labn.com>"; - - 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 <ipv6-address:2-octet-number>. - - 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 <ipv6-address:2-octet-number>. - - 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_new/yang/ietf-yang-types@2013-07-15.yang b/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-yang-types@2013-07-15.yang deleted file mode 100644 index 956562a7b342055127961732d8bde4be21c80d7d..0000000000000000000000000000000000000000 --- a/src/nbi/service/rest_server/nbi_plugins/ietf_network_new/yang/ietf-yang-types@2013-07-15.yang +++ /dev/null @@ -1,475 +0,0 @@ - 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: <http://tools.ietf.org/wg/netmod/> - WG List: <mailto:netmod@ietf.org> - - WG Chair: David Kessens - <mailto:david.kessens@nsn.com> - - WG Chair: Juergen Schoenwaelder - <mailto:j.schoenwaelder@jacobs-university.de> - - Editor: Juergen Schoenwaelder - <mailto:j.schoenwaelder@jacobs-university.de>"; - - 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."; - } - }