cisco / cisco.intersight / 1.0.6 / module / intersight_rest_api REST API configuration for Cisco Intersight | "added in version" 2.8 of cisco.intersight" Authors: David Soper (@dsoper2), CiscoUcs (@CiscoUcs) preview | supported by communitycisco.intersight.intersight_rest_api (1.0.6) — module
Install with ansible-galaxy collection install cisco.intersight:==1.0.6
collections: - name: cisco.intersight version: 1.0.6
Direct REST API configuration for Cisco Intersight.
All REST API resources and properties must be specified.
For more information see L(Cisco Intersight,https://intersight.com/apidocs).
- name: Configure Boot Policy intersight_rest_api: api_private_key: "{{ api_private_key }}" api_key_id: "{{ api_key_id }}" api_key_uri: "{{ api_key_uri }}" validate_certs: "{{ validate_certs }}" resource_path: /boot/PrecisionPolicies query_params: $filter: "Name eq 'vmedia-localdisk'" api_body: { "Name": "vmedia-localdisk", "ConfiguredBootMode": "Legacy", "BootDevices": [ { "ObjectType": "boot.VirtualMedia", "Enabled": true, "Name": "remote-vmedia", "Subtype": "cimc-mapped-dvd" }, { "ObjectType": "boot.LocalDisk", "Enabled": true, "Name": "localdisk", "Slot": "MRAID", "Bootloader": null } ], } state: present
- name: Delete Boot Policy intersight_rest_api: api_private_key: "{{ api_private_key }}" api_key_id: "{{ api_key_id }}" api_key_uri: "{{ api_key_uri }}" validate_certs: "{{ validate_certs }}" resource_path: /boot/PrecisionPolicies query_params: $filter: "Name eq 'vmedia-localdisk'" state: absent
state: choices: - present - absent default: present description: - If C(present), will verify the resource is present and will create if needed. - If C(absent), will verify the resource is absent and will delete if needed. api_uri: default: https://intersight.com/api/v1 description: - URI used to access the Intersight API. type: str api_body: description: - The paylod for API requests used to modify resources. type: dict use_proxy: default: true description: - If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts. type: bool api_key_id: description: - Public API Key ID associated with the private key. required: true type: str return_list: default: false description: - If C(yes), will return a list of API results in the api_response. - By default only the 1st element of the API Results list is returned. - Can only be used with GET operations. type: bool query_params: description: - Query parameters for the Intersight API query languange. type: dict resource_path: description: - Resource URI being configured related to api_uri. required: true type: str update_method: choices: - patch - post default: patch description: - The HTTP method used for update operations. - Some Intersight resources require POST operations for modifications. type: str validate_certs: default: true description: - Boolean control for verifying the api_uri TLS certificate type: bool api_private_key: description: - Filename (absolute path) of a PEM formatted file that contains your private key to be used for Intersight API authentication. required: true type: path
api_repsonse: description: The API response output returned by the specified resource. returned: always sample: api_response: BootDevices: - Enabled: true Name: remote-vmedia ObjectType: boot.VirtualMedia Subtype: cimc-mapped-dvd - Bootloader: null Enabled: true Name: boot-lun ObjectType: boot.LocalDisk Slot: MRAID ConfiguredBootMode: Legacy Name: vmedia-localdisk ObjectType: boot.PrecisionPolicy type: dict