Skip to content

restconf_get

Collection Note

This module is part of the ansible.netcommon collection. To install the collection, use:

ansible-galaxy collection install ansible.netcommon
Added in version 1.0.0.

Synopsis

  • RESTCONF is a standard mechanisms to allow web applications to access the configuration data and state data developed and standardized by the IETF. It is documented in RFC 8040.
  • This module allows the user to fetch configuration and state data from RESTCONF enabled devices.

Parameters

Parameter Defaults / Choices Comments
content
str
Choices: config, nonconfig, all The C(content) is a query parameter that controls how descendant nodes of the requested data nodes in C(path) will be processed in the reply. If value is I(config) return only configuration descendant data nodes of value in C(path). If value is I(nonconfig) return only non-configuration descendant data nodes of value in C(path). If value is I(all) return all descendant data nodes of value in C(path)
output
str
Default: json
Choices: json, xml
The output of response received.
path
str
required
URI being used to execute API calls.

Notes

Note

  • This module requires the RESTCONF system service be enabled on the remote device being managed.
  • This module is supported with I(ansible_connection) value of I(ansible.netcommon.httpapi) and I(ansible_network_os) value of I(ansible.netcommon.restconf).
  • This module is tested against Cisco IOSXE 16.12.02 version.

Examples

- name: get l3vpn services
  ansible.netcommon.restconf_get:
    path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services

Return Values

Key Data Type Description Returned
response dict A dictionary representing a JSON-formatted response when the device response is valid JSON

Authors

  • Ganesh Nalawade (@ganeshrn)