ansible.netcommon.restconf_get (3.1.3) — module

Fetch configuration/state data from RESTCONF enabled devices.

| "added in version" 1.0.0 of ansible.netcommon"

Authors: Ganesh Nalawade (@ganeshrn)

Install collection

Install with ansible-galaxy collection install ansible.netcommon:==3.1.3


Add to requirements.yml

  collections:
    - name: ansible.netcommon
      version: 3.1.3

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
  ansible.netcommon.restconf_get:
    path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services

Inputs

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

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

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
    type: str

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