Courseiva
AutomationPrivileged EXEC

show restconf-yang capabilities

Displays the list of YANG data models and capabilities supported by the device's RESTCONF interface, used to verify RESTCONF compatibility and available modules for automation.

Definition: show restconf-yang capabilities is a Cisco IOS privileged exec command. Displays the list of YANG data models and capabilities supported by the device's RESTCONF interface, used to verify RESTCONF compatibility and available modules for automation.

Overview

The 'show restconf-yang capabilities' command is a powerful tool for network engineers leveraging automation and programmability in modern Cisco IOS-XE devices. It displays the list of YANG data models and capabilities that the device's RESTCONF interface supports, enabling engineers to verify compatibility and discover available modules for automation tasks. RESTCONF is a REST-like protocol that uses HTTP methods to access structured data defined by YANG models, providing a standardized way to configure and monitor network devices.

This command is essential when transitioning from CLI-based management to API-driven automation, as it confirms which YANG modules are available for use with RESTCONF, ensuring that automation scripts or tools like Ansible, Postman, or custom Python applications can interact with the device effectively. Unlike 'show restconf' which shows the RESTCONF service status, or 'show yang models' which lists all YANG models regardless of protocol, this command specifically focuses on the capabilities advertised by the RESTCONF interface, making it the go-to command for verifying RESTCONF-YANG compatibility. In a broader workflow, this command is typically used after enabling RESTCONF on the device (via the 'restconf' command in global config) and before writing automation scripts that rely on specific YANG modules.

It helps answer questions like 'Does this IOS-XE version support the ietf-interfaces model?' or 'Is the Cisco-NX-OS-device model available for RESTCONF?'. The output is often extensive, listing dozens or hundreds of modules, and may be truncated in the terminal; using 'show restconf-yang capabilities | redirect flash:capabilities.txt' can capture the full output. The command requires privileged EXEC mode (enable) and does not affect the running configuration.

Understanding this command is crucial for CCNA and CCNP candidates focusing on automation, as it bridges traditional networking knowledge with modern programmability concepts.

Syntax·Privileged EXEC
show restconf-yang capabilities

When to Use This Command

  • Checking which YANG modules are supported before writing a RESTCONF script to configure OSPF.
  • Verifying that a specific YANG model (e.g., ietf-interfaces) is available after upgrading IOS.
  • Troubleshooting a RESTCONF API call that fails due to unsupported module.
  • Auditing device capabilities for compliance with network automation standards.

Command Examples

Basic capability listing

show restconf-yang capabilities
Capabilities:
    urn:ietf:params:restconf:capability:defaults:1.0?basic-mode=report-all
    urn:ietf:params:restconf:capability:depth:1.0
    urn:ietf:params:restconf:capability:fields:1.0
    urn:ietf:params:restconf:capability:filter:1.0
    urn:ietf:params:restconf:capability:replay:1.0
    urn:ietf:params:restconf:capability:start-time:1.0
    urn:ietf:params:restconf:capability:with-defaults:1.0
    urn:ietf:params:xml:ns:yang:ietf-ip?module=ietf-ip&revision=2018-02-22
    urn:ietf:params:xml:ns:yang:ietf-interfaces?module=ietf-interfaces&revision=2018-02-20
    urn:ietf:params:xml:ns:yang:ietf-routing?module=ietf-routing&revision=2018-03-13
    urn:ietf:params:xml:ns:yang:ietf-ospf?module=ietf-ospf&revision=2019-05-21
    urn:ietf:params:xml:ns:yang:ietf-bgp?module=ietf-bgp&revision=2019-01-25

Each line shows a capability URI. Lines with 'module=' indicate supported YANG modules. The 'revision=' shows the specific version. For example, 'ietf-interfaces' with revision 2018-02-20 is available.

Filtering for a specific module

show restconf-yang capabilities | include ietf-interfaces
urn:ietf:params:xml:ns:yang:ietf-interfaces?module=ietf-interfaces&revision=2018-02-20

The output is filtered to show only lines containing 'ietf-interfaces'. This confirms the module is supported with the given revision.

Understanding the Output

The output lists all RESTCONF capabilities as URIs. Each URI represents a feature or YANG module. Lines containing 'module=' indicate a YANG data model; the module name and revision are key.

For automation, you need the exact module name and revision to construct RESTCONF URLs. If a required module is missing, the device cannot be managed via RESTCONF for that feature. The 'capability:' lines (e.g., depth, filter) are standard RESTCONF features that should always be present.

Watch for missing modules when upgrading IOS; some modules may be removed or added.

Configuration Scenarios

Verify RESTCONF YANG capabilities after enabling RESTCONF

After enabling RESTCONF on a Cisco IOS-XE device, an engineer needs to confirm which YANG models are available to ensure automation scripts can use the required modules.

Topology

R1 (single device, no topology needed)

Steps

  1. 1.Step 1: Enter privileged EXEC mode: enable
  2. 2.Step 2: Display RESTCONF YANG capabilities: show restconf-yang capabilities
  3. 3.Step 3: (Optional) Save output to a file for later reference: show restconf-yang capabilities | redirect flash:capabilities.txt
Configuration
! No configuration required; command is used in privileged EXEC mode
! Ensure RESTCONF is enabled:
Router(config)# restconf

Verify: The output should list multiple YANG modules, e.g., 'ietf-interfaces', 'ietf-ip', 'Cisco-IOS-XE-interfaces'. If no modules appear, RESTCONF may not be enabled or the device may not support it.

Watch out: The output can be very long and may be truncated in the terminal. Always use '| redirect' or '| begin' to capture full output.

Check for a specific YANG module before writing automation script

A network automation engineer needs to verify that the 'ietf-interfaces' YANG model is supported via RESTCONF before writing a script to configure interfaces using that model.

Topology

R1 (single device)

Steps

  1. 1.Step 1: Enter privileged EXEC mode: enable
  2. 2.Step 2: Display capabilities and filter for the specific module: show restconf-yang capabilities | include ietf-interfaces
  3. 3.Step 3: If the module is listed, proceed with automation; if not, consider using a different model or upgrading IOS-XE.
Configuration
! No configuration required

Verify: Expected output: 'ietf-interfaces?module=...' or similar. If no output, the module is not supported.

Watch out: Module names are case-sensitive. Use exact casing as shown in documentation.

Troubleshooting with This Command

When troubleshooting RESTCONF automation issues, the 'show restconf-yang capabilities' command is invaluable for verifying that the required YANG modules are available. A healthy output will list numerous modules, including standard IETF models (e.g., ietf-interfaces, ietf-ip) and Cisco proprietary models (e.g., Cisco-IOS-XE-interfaces, Cisco-IOS-XE-ospf). Problem indicators include an empty output or a very short list (only a few modules).

An empty output often means RESTCONF is not enabled globally; check with 'show restconf' to confirm the service is running. A short list may indicate that the device is running an older IOS-XE version with limited YANG support, or that the 'restconf' command was issued but the device hasn't fully loaded the modules (try reloading or upgrading). Focus on specific fields: the module name and its revision date.

If a module you need is missing, you may need to upgrade IOS-XE or use a different module. Common symptoms this command helps diagnose include HTTP 404 errors when accessing RESTCONF endpoints (indicating the module is not supported) or 501 Not Implemented errors. A step-by-step diagnostic flow: 1) Verify RESTCONF is enabled: 'show restconf'. 2) Check capabilities: 'show restconf-yang capabilities'. 3) If capabilities are missing, check the device's YANG model list: 'show yang models'. 4) If models are present but not in capabilities, ensure the device is running a compatible IOS-XE version (16.x or later). 5) Correlate with debug commands: 'debug restconf all' can show HTTP requests and responses, helping pinpoint which module is failing.

Also, use 'show platform software yang-management process' to verify YANG processes are running. This command is often used alongside 'show restconf' and 'show yang models' to get a complete picture of the device's programmability capabilities.

CCNA Exam Tips

1.

CCNA exam may ask which command verifies YANG module support for RESTCONF.

2.

Remember that 'show restconf-yang capabilities' is a privileged EXEC command, not config mode.

3.

The output includes revision dates; exam might test that different revisions affect compatibility.

4.

Know that 'ietf-interfaces' is a common YANG module for interface configuration.

Common Mistakes

Mistake: Using 'show restconf capabilities' (missing 'yang') — command will fail.

Mistake: Assuming all YANG modules are supported; always verify with this command.

Mistake: Ignoring revision dates; using wrong revision in RESTCONF URL causes errors.

show restconf-yang capabilities vs show ip http server status

Both commands are essential for troubleshooting RESTCONF-based automation, but they serve different purposes: one reveals supported YANG data models, while the other checks if the HTTP server (needed for RESTCONF) is actually running. They are often confused because both are prerequisites for RESTCONF functionality.

Aspectshow restconf-yang capabilitiesshow ip http server status
ScopeLists all YANG modules and capabilities advertised via RESTCONFShows HTTP server enable state, port, and authentication settings
Configuration DependencyRequires restconf transport enabled via 'restconf' commandDepends on 'ip http server' and related global config
Output FormatOutput is a long list of module names, revisions, and featuresOutput is a structured summary table of server parameters
Use CaseDetermine available YANG models for NETCONF/RESTCONF automation scriptsVerify that the HTTP/REST interface is listening and reachable
PersistenceStatic; reflects current software image capabilitiesDynamic; reflects runtime server state (e.g., up/down)

Use show restconf-yang capabilities when you need to confirm that a specific YANG module (e.g., Cisco-IOS-XE-interfaces) is supported before building an automation workflow.

Use show ip http server status when troubleshooting RESTCONF connectivity issues, to ensure the HTTP server is enabled, not blocked by ACLs, and listening on the expected port.

Platform Notes

In IOS-XE (Cisco IOS XE 16.x and later), the command syntax is exactly 'show restconf-yang capabilities'. Output format is consistent across versions, but the list of modules grows with newer releases. In NX-OS, the equivalent command is 'show restconf yang models' or 'show yang models' (the latter lists all YANG models, not just RESTCONF).

NX-OS also supports 'show restconf capabilities' but with different output. For ASA, there is no direct equivalent; ASA does not support RESTCONF natively. In IOS-XR, the command is 'show restconf yang capabilities' (similar to IOS-XE) but output may differ.

For older IOS versions (12.x, 15.x), RESTCONF is not supported; these platforms use only CLI or SNMP. Always verify the specific IOS-XE version, as module availability varies significantly between versions (e.g., 16.6 vs 16.12). The command is available in privileged EXEC mode only; no configuration is required beyond enabling RESTCONF globally.

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions