Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenDaylight Cookbook

You're reading from   OpenDaylight Cookbook Deploy and operate software-defined networking in your organization

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781786462305
Length 336 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (6):
Arrow left icon
Rashmi Pujar Rashmi Pujar
Author Profile Icon Rashmi Pujar
Rashmi Pujar
ICARO CAMELO ICARO CAMELO
Author Profile Icon ICARO CAMELO
ICARO CAMELO
Mohamed Elserngawy Mohamed Elserngawy
Author Profile Icon Mohamed Elserngawy
Mohamed Elserngawy
Jamie Goodyear Jamie Goodyear
Author Profile Icon Jamie Goodyear
Jamie Goodyear
Mathieu Lemay Mathieu Lemay
Author Profile Icon Mathieu Lemay
Mathieu Lemay
Yrineu Rodrigues Yrineu Rodrigues
Author Profile Icon Yrineu Rodrigues
Yrineu Rodrigues
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. OpenDaylight Fundamentals 2. Virtual Customer Edge FREE CHAPTER 3. Dynamic Interconnects 4. Network Virtualization 5. Virtual Core and Aggregation 6. Intent and Policy Networking 7. OpenDaylight Container Customizations 8. Authentication and Authorization

Browsing data models with YANGUI

YANGUI is a user interface application through which one can navigate among all YANG models available in the OpenDaylight controller. Not only does it aggregate all data models, it also enables their usage. Using this interface, you can create, remove, update, and delete any part of the model-driven data store. It provides a nice, smooth user interface making it easier to browse through the model(s).

This recipe will guide you through those functionalities.

Getting ready

This recipe only requires the OpenDaylight controller and a web browser.

How to do it...

Perform the following steps:

  1. Start your OpenDaylight distribution using the karaf script. Using this client will give you access to the Karaf CLI:
$ ./bin/karaf
  1. Install the user-facing feature responsible to pull in all dependencies needed to use YANGUI:
opendaylight-user@root>feature:install odl-dlux-yangui  

It might take a minute or so to complete the installation.

  1. Navigate to http://localhost:8181/index.html#/yangui/index:
    • Username: admin
    • Password: admin

Once logged in, all modules will be loaded until you see this message at the bottom of the screen:

Loading completed successfully

You should see the API tab listing all YANG models in the following format:

<module-name> rev.<revision-date>

For instance:

  • cluster-admin rev.2015-10-13
  • config rev.2013-04-05
  • credential-store rev.2015-02-26

By default, there isn't much you can do with the provided YANG models. So let's connect an OpenFlow switch to better understand how to use this YANGUI. To do so, please refer to the first recipe, Connecting OpenFlow switches, step 2.

Once done, refresh your web page to load newly added modules.

  1. Look for opendaylight-inventory rev.2013-08-19 and select the operational tab, as nothing will yet be in the config data store. Then click on nodes and you'll see a request bar at the bottom of the page with multiple options.

You can either copy the request to the clipboard to use it in your browser, send it, show a preview of it, or define a custom API request.

For now, we will only send the request.

You should see Request sent successfully and under this message should be the retrieved data. As we only have one switch connected, there is only one node. All the switch operational information is now printed on your screen.

You could do the same request by specifying the node-id in the request. To do that you will need to expand nodes and click on node {id}, which will enable a more fine-grained search.

How it works...

OpenDaylight has a model-driven architecture, which means that all of its components are modeled using YANG. While installing features, OpenDaylight loads YANG models, making them available within the MD-SAL data store.

YANGUI is a representation of this data store. Each schema represents a subtree based on the name of the module and its revision-date. YANGUI aggregates and parses all those models. It also acts as a REST client; through its web interface we can execute functions such as GET, POST, PUT, and DELETE.

There's more...

The example shown previously can be improved upon, as there was no user YANG model loaded. For instance, if you mount a NETCONF device containing its own YANG model, you could interact with it through YANGUI.

You would use the config data store to push/update some data, and you would see the operational data store updated accordingly. In addition, accessing your data would be much easier than having to define the exact URL, as mentioned in the Mounting a NETCONF device recipe.

See also

  • Using API doc as a REST API client
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime