-
Sub-task
-
Resolution: Done
-
Medium
-
None
-
None
-
None
-
None
Investigate if yang model can be fetched from ONAP NETCONF simulator using NETCONF communication channel.
===============================================================================================================================================
Investigation done is given below:
In this pnf-simulator image /onap/integration/simulators/netconf-pnp-simulator:2.8.6 and sdnc image /onap/so/sdnc-adapter:1.8.0 is used for investigation.
Attached Yang model is imported in to netconf-sim and its been accessed using below given requests.
TLS connection is made to access yang model and data b/w sdnc/odl and neconf sim.
netconf/rest request to fetch all schemas -> name , revision, format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc message-id="m-13" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree"> <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"> <schemas/> </netconf-state> </filter> </get> </rpc>
http://localhost:8282/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/ietf-netconf-monitoring:netconf-state/schemas
netconf/rest request to fetch specific schemas -> name, revision, format:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc message-id="m-17" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree"> <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"> <schemas> <schema> <format>yang</format> <version>2019-12-03</version> <identifier>pnf-sw-upgrade</identifier> </schema> </schemas> </netconf-state> </filter> </get> </rpc>
http://localhost:8282/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/ietf-netconf-monitoring:netconf-state/schemas/schema/pnf-sw-upgrade/2019-12-03/ietf-netconf-monitoring:yang
Rest request to fetch yang schema content using odl:
curl --location --request POST 'http://localhost:8282/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/ietf-netconf-monitoring:get-schema' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \ --header 'Cookie: JSESSIONID=node0b90wyt06ujdf1qpj0gowb7bq8132.node0' \ --data-raw '{ "ietf-netconf-monitoring:input":{ "identifier": "pnf-sw-upgrade" }}'
Response:
{ "output": { "data": "module pnf-sw-upgrade {\n namespace \"http://onap.org/pnf-sw-upgrade\";\n prefix upgrade;\n\n import ietf-yang-types {\n prefix yang;\n }\n\n revision 2019-12-03 {\n description\n \"initial version\";\n }\n\n container software-upgrade {\n list upgrade-package {\n key \"id\";\n leaf id {\n type string;\n }\n\n leaf current-status {\n type enumeration {\n enum \"CREATED\";\n enum \"INITIALIZED\";\n enum \"DOWNLOAD_IN_PROGRESS\";\n enum \"DOWNLOAD_COMPLETED\";\n enum \"ACTIVATION_IN_PROGRESS\";\n enum \"ACTIVATION_COMPLETED\";\n }\n description\n \"List of possible states of the upgrade\";\n }\n\n leaf state-change-time {\n type yang:date-and-time;\n mandatory false;\n description\n \"Date and time of the last state change.\";\n }\n\n leaf action {\n type enumeration {\n enum \"NONE\";\n enum \"PRE_CHECK\";\n enum \"DOWNLOAD_NE_SW\";\n enum \"ACTIVATE_NE_SW\";\n enum \"CANCEL\";\n }\n mandatory false;\n description\n \"List of possible actions for the upgrade\";\n }\n\n leaf software-version {\n type string;\n description\n \"Possible name or release version of the UP\";\n }\n\n leaf uri {\n type string;\n description\n \"A URI that points to the directory where the UP can be found.\";\n }\n\n leaf user {\n type string;\n description\n \"Indicates the user.\";\n }\n\n leaf password {\n type string;\n description\n \"Indicates the password.\";\n }\n\n leaf user-label {\n type string;\n description\n \"Free-text description of the UP.\";\n }\n\n leaf node-health {\n type string;\n description\n \"Reflect Node Health Status\";\n }\n }\n }\n}" } }
Equivalent netconf request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <rpc message-id="m-4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"> <identifier>pnf-sw-upgrade</identifier> </get-schema> </rpc>
- mentioned in
-
Page Loading...