mikewiebe / mikewiebe.ndfc / 2.1.3 / module / dcnm_rest Send REST API requests to DCNM controller. | "added in version" 0.9.0 of mikewiebe.ndfc" Authors: Mike Wiebe (@mikewiebe)mikewiebe.ndfc.dcnm_rest (2.1.3) — module
Install with ansible-galaxy collection install mikewiebe.ndfc:==2.1.3
collections: - name: mikewiebe.ndfc version: 2.1.3
Send REST API requests to DCNM controller.
# This module can be used to send any REST API requests that are supported by # the DCNM controller. # # This module is not idempotent but can be used as a stop gap until a feature # module can be developed for the target DCNM functionality. - name: Gather List of Fabrics from DCNM dcnm_rest: method: GET path: /rest/control/fabrics
- name: Set deployment to false in lanAttachList for vrf dcnm_rest: method: POST path: /rest/top-down/fabrics/fabric1/vrfs/attachments json_data: '[{"vrfName":"sales66_vrf1","lanAttachList":[{"fabric":"fabric1","vrfName":"sales66_vrf1","serialNumber":"FDO21392QKM","vlan":2000,"freeformConfig":"","deployment":false,"extensionValues":"","instanceValues":"{"loopbackId":"","loopbackIpAddress":"","loopbackIpV6Address":""}"}]}]'
# Read payload data from file and validate a template - set_fact: data: "{{ lookup('file', 'validate_payload') }}"
- name: Validate a template cisco.dcnm.dcnm_rest: method: POST path: /fm/fmrest/config/templates/validate json_data: "{{ data }}" register: result
data: aliases: - json_data description: - Additional data in JSON or TEXT to include with the REST API call required: false type: raw path: description: - REST API Path Endpoint required: true type: str method: choices: - GET - POST - PUT - DELETE description: - REST API Method required: true type: str
response: description: - Success or Error Data retrieved from DCNM elements: dict returned: always type: list