MENU
Acquiring the YANG Model
  • 24 Jan 2024
  • 2 Minutes to read
  • Contributors

Acquiring the YANG Model


Article summary

The Yet Another Next Generation (YANG) models are stored on the device as part of the firmware package. In order to retrieve them the user must use a NETCONF tool, for instance:

  • SSH console
  • Tools from Cisco orchestrator (e.g.: Yang Explorer):
    https://github.com/CiscoDevNet/yang-explorer

or Cisco YANG suite:
https://github.com/CiscoDevNet/yangsuite

  • Tools from MG-Soft (e.g.: MG Soft NETCONF Browser)

Basic SSH Console NETCONF Tool

For the most basic NETCONF tool, SSH console, YANG models can be acquired by sending specific requests.


Note: Both NETCONF request and response are in XML format.

To send the proper requests:

  1. Connect Accedian NETCONF device by entering:
    ssh admin@10.230.111.130 -p 830 -s netconf

  2. Send HELLO message to device by entering:
    < ?xml version="1.0" encoding="UTF-8"? >
    < hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
    < capabilities >
    < capability >urn:ietf:params:netconf:base:1.0< /capability>
    < /capabilities >
    < /hello >
    ]]>]]>

  3. Send the request to acquire information regarding all available YANG schema by entering:
    < rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
    < get >
    < filter >
    < netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"
    < schemas/ >
    < /netconf-state >
    < /filter >
    < /get >
    < ]>]]>

  4. Send the request to acquire a specific YANG schema, for example “accedian-alarm” model, by entering:
    < rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
    < get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring" >
    < identifier >accedian-alarm< /identifier >
    < version >2017-12-15< /version >
    < format >yang< /format >
    < /get-schema >
    < /rpc >
    ]]>]]>

  5. Close the session by entering:
    < rpc message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >< close-session/ >
    < /rpc >]]>]]>

Additional UI NETCONF Tools

For additional UI NETCONF tools (YANG Explorer, or MG Soft NETCONF browser), the Accedian device must be connected prior to running the corresponding built-in UI functions.

To acquire YANG models by using YANG Explorer:

  1. The overview information regarding all YANG schemas on the device can be listed as shown below:
    Skylight element LX v7.9_8.bmp

  2. The request can be sent in order to get a specific YANG file. Note that the RPC created automatically by YANG Explorer will not work. The request must be customized by removing the lines that read < get > and < filter >.
    Skylight element LX v7.9_9.bmp
    Skylight element LX v7.9_10.bmp

  3. YANG Explorer 0.8.0 (Beta) supports the functionality to download YANG files directly, but can be unstable.
    Skylight element LX v7.9_11.bmp

To acquire YANG models by using YANG Suite:

  1. Install Cisco YANG Suite: https://github.com/CiscoDevNet/yangsuite (Cisco YANG Suite document: https://developer.cisco.com/docs/yangsuite/ )

  2. Access Docker via WEB browser:
    a. Login: http://localhost:8480/
    Skylight element LX v7.9_12.bmp
    b. Create a new device profile and SSH session:
    Skylight element LX v7.9_13.bmp
    Skylight element LX v7.9_14.bmp
    c. Check the connection to profile created:
    Skylight element LX v7.9_15.bmp
    d. Create defualt Repository and YANG set from profile created:
    Skylight element LX v7.9_16.bmp
    e. Copy yand-files from: "/usr/share/yang"
    Skylight element LX v7.9_17.bmp


Note: Yang-files are stored in < yang-suite-data-dir >/ysdata/ users/< name > /repositories/< repo-name >. Example: /ysdata/users/admin/repositories/test-10-230-116-41-default-repo).

Skylight element LX v7.9_18.bmp

f. Select YANG set from YANG repository:

Skylight element LX v7.9_19.bmp

g. Load modules and explore YANG models
Skylight element LX v7.9_20.bmp
Skylight element LX v7.9_21.bmp

© 2024 Cisco and/or its affiliates. All rights reserved.
 
For more information about trademarks, please visit: Cisco trademarks
For more information about legal terms, please visit: Cisco legal terms

For legal information about Accedian Skylight products, please visit: Accedian legal terms and tradmarks



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.