Get a list of existing VMs for the FortiFlex configuration
Use the fortiflexvm_vms_list_info
module to get a list of VMs associated with a specific configuration ID from the FortiFlex API using the provided credentials.
Parameters
The following parameters are included:
Parameter |
Type |
Description |
---|---|---|
|
String (Optional) |
The username to authenticate. If not declared, the code will read the environment variable |
password
|
String (Optional) |
The password to authenticate. If not declared, the code will read the environment variable |
|
Integer |
The ID of the configuration for which to retrieve the list of VMs. |
Example
The following is an example use of this module:
- name: Get list of VMs for a specific config ID hosts: localhost collections: - fortinet.fortiflexvm vars: username: "<your_own_value>" password: "<your_own_value>" tasks: - name: Get VMs list fortinet.fortiflexvm.fortiflexvm_vms_list_info: username: "{{ username }}" password: "{{ password }}" configId: 22 register: result - name: Display response debug: var: result.vms
Return values
The following parameters are returned:
Parameter |
Type Returned |
Description |
---|---|---|
|
List |
The list of virtual machines associated with the specified configuration ID. |
The vms
list includes:
Parameter |
Type Returned |
Description |
---|---|---|
|
String |
The serial number of the VM. |
|
String |
The description of the VM. |
|
Integer |
The configuration ID of the VM. |
|
String |
The start date of the VM. |
|
String |
The end date of the VM. |
|
String |
The status of the VM; either |
|
String |
The token of the VM. |
|
String |
The status of the VM; either |