ansible.builtin.restconf_get (v2.9.27) — module

Fetch configuration/state data from RESTCONF enabled devices.

| "added in version" 2.8 of ansible.builtin"

Authors: Ganesh Nalawade (@ganeshrn)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get l3vpn services
  restconf_get:
      path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services

Inputs

    
path:
    description:
    - URI being used to execute API calls.
    required: true

output:
    choices:
    - json
    - xml
    default: json
    description:
    - The output of response received.
    required: false

content:
    choices:
    - config
    - nonconfig
    - all
    description:
    - 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)
    required: false

Outputs

response:
  description: A dictionary representing a JSON-formatted response
  returned: when the device response is valid JSON
  sample: "{\n    \"vpn-services\": {\n        \"vpn-service\": [\n            {\n\
    \                \"customer-name\": \"red\",\n                \"vpn-id\": \"blue_vpn1\"\
    ,\n                \"vpn-service-topology\": \"ietf-l3vpn-svc:any-to-any\"\n \
    \           }\n        ]\n    }\n}\n"
  type: dict