drmofu / drmofu.fortiflexvm / 1.0.1 / module / fortiflexvm_vms_list_info Get list of existing VMs for FlexVM Configuration. | "added in version" 1.0.0 of drmofu.fortiflexvm" Authors: Xinwei Du (@DrMofu)drmofu.fortiflexvm.fortiflexvm_vms_list_info (1.0.1) — module
Install with ansible-galaxy collection install drmofu.fortiflexvm:==1.0.1
collections: - name: drmofu.fortiflexvm version: 1.0.1
This module retrieves a list of VMs associated with a specific config ID from FortiFlexVM API using the provided credentials.
- name: Get list of VMs for a specific config ID hosts: localhost collections: - drmofu.fortiflexvm vars: username: "<your_own_value>" password: "<your_own_value>" tasks: - name: Get VMs list drmofu.fortiflexvm.fortiflexvm_vms_list_info: username: "{{ username }}" password: "{{ password }}" configId: 22 register: result - name: Display response debug: var: result.vms
configId: description: - The ID of the configuration for which to retrieve the list of VMs. required: true type: int password: description: - The password to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_PASSWORD. required: false type: str username: description: - The username to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_USERNAME. required: false type: str
vms: contains: configId: description: The config ID of the VM. returned: always sample: 22 type: int description: description: The description of the VM. returned: always sample: VM created for department X type: str endDate: description: The end date of the VM. returned: always sample: '2020-09-12 12:13:37' type: str serialNumber: description: The serial number of the VM. returned: always sample: FGVMELTM20000004 type: str startDate: description: The start date of the VM. returned: always sample: '2020-08-25 10:12:25' type: str status: description: The status of the VM. Possible values are "PENDING", "ACTIVE", "STOPPED" or "EXPIRED". returned: always sample: STOPPED type: str token: description: The token of the VM. returned: always type: str tokenStatus: description: The token status of the VM. Possible values are "NOTUSED" or "USED". returned: always sample: USED type: str description: List of VMs associated with the specified config ID. returned: always type: list