Fortinet black logo

Administration Guide

Get the next available tokens

Get the next available tokens

Use the fortiflexvm_groups_nexttoken_info to get the first available token by asset folder and configuration ID.

Parameters

The following parameters are included:

Parameter

Type

Description

username

String (Optional)

The username to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_USERNAME.

password

String (Optional)

The password to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_PASSWORD.

folderPath

String (Optional)

The folder path.

configId

Integer (Optional)

The ID of the FortiFlex configuration.

Note

You must declare at least one of the folderPath or configId arguments.

Example

The following is an example use of this module:

- name: Get next available (unused) token
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars:
    username: "<your_own_value>"
    password: "<your_own_value>"
  tasks:
    - name: Get groups nexttoken
      fortinet.fortiflexvm.fortiflexvm_groups_nexttoken_info:
        username: "{{ username }}"
        password: "{{ password }}"
        # Please declare at least one of the following two arguments: folderPath and configId.
        # You can annotate at most one argument that you don't want to specify.
        folderPath: "My Assets"
        configId: 22
      register: result

    - name: Display response
      debug:
        var: result.vms

Return values

The following parameters are returned:

Parameter

Type Returned

Description

vms

List

The next available, unused token. This list only has one element.

The vms list includes:

Parameter

Type Returned

Description

configId

Integer

The configuration ID of the VM.

description

String

The description of the VM.

endDate

String

The end date of the VM.

serialNumber

String

The serial number of the VM.

startDate

String

The start date of the VM.

status

String

The status of the VM; either "PENDING", "ACTIVE", "STOPPED", or "EXPIRED".

token

String

The token of the VM.

tokenStatus

String

The token status of the VM.

Get the next available tokens

Use the fortiflexvm_groups_nexttoken_info to get the first available token by asset folder and configuration ID.

Parameters

The following parameters are included:

Parameter

Type

Description

username

String (Optional)

The username to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_USERNAME.

password

String (Optional)

The password to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_PASSWORD.

folderPath

String (Optional)

The folder path.

configId

Integer (Optional)

The ID of the FortiFlex configuration.

Note

You must declare at least one of the folderPath or configId arguments.

Example

The following is an example use of this module:

- name: Get next available (unused) token
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars:
    username: "<your_own_value>"
    password: "<your_own_value>"
  tasks:
    - name: Get groups nexttoken
      fortinet.fortiflexvm.fortiflexvm_groups_nexttoken_info:
        username: "{{ username }}"
        password: "{{ password }}"
        # Please declare at least one of the following two arguments: folderPath and configId.
        # You can annotate at most one argument that you don't want to specify.
        folderPath: "My Assets"
        configId: 22
      register: result

    - name: Display response
      debug:
        var: result.vms

Return values

The following parameters are returned:

Parameter

Type Returned

Description

vms

List

The next available, unused token. This list only has one element.

The vms list includes:

Parameter

Type Returned

Description

configId

Integer

The configuration ID of the VM.

description

String

The description of the VM.

endDate

String

The end date of the VM.

serialNumber

String

The serial number of the VM.

startDate

String

The start date of the VM.

status

String

The status of the VM; either "PENDING", "ACTIVE", "STOPPED", or "EXPIRED".

token

String

The token of the VM.

tokenStatus

String

The token status of the VM.