Operational Data Parser Polling

YANG data models enables you to read operational state data from devices.

Information About Operational Data Parser Polling

Operational Data Overview

You can use YANG data models to read operational state data from a device. The operational data allows you to determine the current state and behavior of a device, similar to IOS show commands.

You can perform NETCONF GET operations to retrieve read-only operational state data from a system. You must enable NETCONF, activate data parsers (where applicable), and then retrieve the data through an appropriate YANG model.

The How to Configure Operational Data section provides information on configuring operational data through a programmable interface and the CLI.

Restrictions for Operational Data

In Cisco IOS XE Fuji 16.7.1, operational data model is not supported on Cisco ASR 9xx platforms.

Operational Data Parsers and Corresponding YANG Models

There are two types of operational data parsers; one that is always on, and the other that must be configured to poll operational data at regular intervals. For the first type of operational data parser, no configuration is required. Data is always fetched from the device during a NETCONF GET request. These data parsers do not have a polling-interval, and operational data is updated as soon as a change occurs.

The second type of operational data parsers must be activated either via the CLI or a NETCONF message (For more information, see the How to Enable Operational Data Parser Polling section.). The operational data for these types of parsers is polled at regular polling intervals and this information is retrieved during a NETCONF GET request.

The following table lists the data parsers that must be activated, and the corresponding YANG model where the operational data is stored.

Table 1. Operational Data Parsers to be Activated and Corresponding Yang Models

Operational Data Parser Name

YANG Model to Access Operational Data

BGP

Cisco-IOS-XE-bgp-oper.yang

BFD

Cisco-IOS-XE-bfd-oper.yang

BridgeDomain

Cisco-IOS-XE-bridge-domain.yang

Note 

Supported only on routing platforms.

DiffServ

ietf-diffserv-target.yang

EthernetCFMStats

Cisco-IOS-XE-cfm-oper.yang

Note 

Supported only on routing platforms.

FlowMonitor

Cisco-IOS-XE-flow-monitor-oper.yang

IPRoute

ietf-routing.yang

MPLSLForwarding

Cisco-IOS-XE-mpls-fwd-oper.yang

MPLSLDPNeighbor

Cisco-IOS-XE-mpls-ldp.yang

MPLSStaticBinding

common-mpls-static.yang

OSPF

ietf-ospf.yang

PlatformSoftware

Cisco-IOS-XE-platform-software-oper.yang

VirtualService

Cisco-IOS-XE-virtual-service-oper.yang

Note 

Supported only on routing platforms.

How to Enable Operational Data Parser Polling

Enabling Operational Data Parser Polling Through a Programmable Interface

Perform this task to enable operational data parser polling through a programmable interface:

  1. After enabling NETCONF-YANG, send an <edit-config> remote procedure call (RPC) using cisco-odm.yang (available in the GitHub Repository) to enable operational data polling. When the polling is enabled, all operational data parsers are activated by default. The default polling-interval of each parser is 120 seconds (120000 milliseconds). The polling interval decides the frequency at which the parser obtains the operational data and updates the corresponding YANG model in the datastore.

  2. After operational data polling is enabled, send a <get> RPC to obtain the operational data. Use the parser-to-YANG model mapping to determine which operational YANG model should be used to retrieve the operational data. The following RPC reply fetches access control list (ACL) operational data using Cisco-IOS-XE-acl-oper.yang:

    
         CORRESPONDING RPC REPLY:
    <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
        <data>
            <access-lists xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-acl-oper"> 
                <access-list>
                    <access-control-list-name>TEST</access-control-list-name>
                    <access-list-entries>
                        <access-list-entry>
                            <rule-name>10</rule-name>
                            <access-list-entries-oper-data>
                            <match-counter>100</match-counter>
                        </access-list-entry>
                        <access-list-entry>
                            <rule-name>20</rule-name>
                            <access-list-entries-oper-data>
                            <match-counter>122</match-counter>
                        </access-list-entry>
                    </access-list-entries>
                </access-list>
            </access-lists>
        </data>
    </rpc-reply>
    
    

Note

For more information, see the cisco-odm.yang model in the GitHub repository.


Enabling Operational Data Parser Polling Through the CLI

After enabling NETCONF-YANG, perform this task to enable operational data parser polling and to adjust the polling interval.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:

Device# configure terminal

Enters global configuration mode.

Step 3

netconf-yang cisco-odm polling-enable

Example:

Device(config)# netconf-yang cisco-odm polling-enable

Enables operational data polling.

Step 4

netconf-yang cisco-odm actions action-name

Example:

Device(config)# netconf-yang cisco-odm actions OSPF 

Enables the specified action, and enters ODM-action configuration mode.

  • Specify the operational data parser name to retrieve operational data.

Step 5

mode poll

Example:

Device(config-odm-action)# mode poll 

Configures the data parser in poll mode.

Step 6

polling-interval seconds

Example:

Device(config-odm-action)# polling-interval 1000

Changes the default parser-polling interval.

  • To stop the parser from polling data, configure the mode none command.

Step 7

end

Example:

Device(config-odm-action)# end

Exits ODM-action configuration mode and returns to privileged EXEC mode.

What to do next

After enabling operational data polling, send a <get> RPC to obtain operational data from the device.

Additional References for Operational Data Parser Polling

Related Documents

Related Topic Document Title

YANG data models for Cisco IOS XE

To access Cisco YANG models in a developer-friendly way, please clone the GitHub repository, and navigate to the vendor/cisco subdirectory.

Programmability Command Reference, Cisco IOS XE Everest 16.6.1

MIBs

MIB MIBs Link

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

Technical Assistance

Description Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/support

Feature Information for Operational Data Parser Polling

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 2. Feature Information for Operational Data Parser Polling

Feature Name

Release

Feature Information

Operational Data Parser Polling

Cisco IOS XE Denali 16.3.1

YANG data models, enables you to read operational state data from a device.

Cisco IOS XE Everest 16.5.1a

This feature was implemented on the following platforms:
  • Cisco Catalyst 3650 Series Switches

  • Cisco Catalyst 3850 Series Switches

  • Cisco Catalyst 9300 Series Switches

  • Cisco Catalyst 9500 Series Switches