Ë
    ÇVh”  ã                   ó„   — d dl mZmZmZ eZdZdZdZd dl	m
Z
 d dlmZ d dlmZ d dlmZ d d	lmZ d
„ Zedk(  r e«        yy)é    )Úabsolute_importÚdivisionÚprint_functionaB  
module: restconf_get
author: Ganesh Nalawade (@ganeshrn)
short_description: Fetch configuration/state data from RESTCONF enabled devices.
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.
version_added: 1.0.0
options:
  path:
    description:
    - URI being used to execute API calls.
    required: true
    type: str
  content:
    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)
    type: str
    required: false
    choices:
    - config
    - nonconfig
    - all
  output:
    description:
    - The output of response received.
    required: false
    type: str
    default: json
    choices:
    - json
    - xml
notes:
- 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.
zv
- name: get l3vpn services
  ansible.netcommon.restconf_get:
    path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services
aå  
response:
  description: A dictionary representing a JSON-formatted response
  returned: when the device response is valid JSON
  type: dict
  sample: |
        {
            "vpn-services": {
                "vpn-service": [
                    {
                        "customer-name": "red",
                        "vpn-id": "blue_vpn1",
                        "vpn-service-topology": "ietf-l3vpn-svc:any-to-any"
                    }
                ]
            }
        }

)Úto_text)ÚAnsibleModule)ÚConnectionError)Úrestconf)Úxml_to_dictc                  ó*  — t        t        d¬«      t        g d¢¬«      t        ddgd¬«      ¬«      } t        | d¬	«      }d
di}	 t        j                  |fi |j                  ¤Ž}|j                  d   dk(  r	 t        «      }|j                  di«        |j                  di |¤Ž y# t
        $ r0}|j                  t        |«      |j                  ¬«       Y d}~Œxd}~ww xY w# t        $ r%}|j                  t        |«      ¬«       Y d}~Œ‹d}~ww xY w)z entry point for module executionT)Úrequired)ÚconfigÚ	nonconfigÚall)ÚchoicesÚjsonÚxml)r   Údefault)ÚpathÚcontentÚoutput)Úargument_specÚsupports_check_modeÚchangedF)ÚmsgÚcodeNr   )r   Úresponse© )Údictr   r	   ÚgetÚparamsr   Ú	fail_jsonr   r   r
   Ú	ExceptionÚupdateÚ	exit_json)r   ÚmoduleÚresultr   Úexcs        úr/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ansible/netcommon/plugins/modules/restconf_get.pyÚmainr)   ^   s   € äÜ˜4Ô ÜÒ;Ô<Ü˜V U˜O°VÔ<ô€Mô ¨ÈDÔQ€Fà˜Ð€Fð:Ü—<‘< Ñ8¨&¯-©-Ñ8ˆð ‡}}XÑ %Ò'ð	/Ü" 8Ó,ˆHð ‡MM:˜xÐ(Ô)à€F×ÑÑvÓøô ò :Ø×ÑœW S›\°·±Ð×9Ñ9ûð:ûô ò 	/Ø×Ñ¤¨£Ð×.Ñ.ûð	/ús0   Á B( Á7C$ Â(	C!Â1&CÃC!Ã$	DÃ-DÄDÚ__main__N)Ú
__future__r   r   r   ÚtypeÚ__metaclass__ÚDOCUMENTATIONÚEXAMPLESÚRETURNÚansible.module_utils._textr   Úansible.module_utils.basicr   Úansible.module_utils.connectionr   ÚKansible_collections.ansible.netcommon.plugins.module_utils.network.restconfr	   ÚEansible_collections.ansible.netcommon.plugins.module_utils.utils.datar
   r)   Ú__name__r   ó    r(   ú<module>r8      sU   ð÷ AÑ @ð €ð.€ð`€ð
€õ( /Ý 4Ý ;å `Ý ]òð8 ˆzÒÙ…Fð r7   