netapp.ontap.iso8601_duration_to_seconds filter – Decode a ISO 8601 duration string as seconds
Note
This filter plugin is part of the netapp.ontap collection (version 22.12.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install netapp.ontap
.
To use it in a playbook, specify: netapp.ontap.iso8601_duration_to_seconds
.
New in netapp.ontap 21.24.0
Synopsis
Decode a ISO 8601 duration string as seconds
Input
This describes the input of the filter, the value before | netapp.ontap.iso8601_duration_to_seconds
.
Parameter |
Comments |
---|---|
A string to decode |
Notes
Note
requires isodate and datetime python modules.
set filter_plugins path to <installation_path>/ansible_collections/netapp/ontap/plugins/filter in ansible.cfg.
documentation can be generated locally using a version of ansible-doc (2.14) that supports ‘-t filter’
ansible-doc -t filter netapp.ontap.iso8601_duration_to_seconds
Examples
# Decode a string
duration_in_seconds: "{{ 'P689DT13H57M44S' | netapp.ontap.iso8601_duration_to_seconds }}"
# Decode 'iso_duration' variable
duration_in_seconds: "{{ iso_duration | netapp.ontap.iso8601_duration_to_seconds }}"
Return Value
Key |
Description |
---|---|
A float representing the number of seconds. The fractional part may represent milliseconds. Returned: success |