Update win_scheduled_task.py (#46720)

* Update win_scheduled_task.py to document that the duration of a task trigger can be null, which will cause it to run indefinitely - docs update makes use of suboptions

* Add a fix for the validate-modules schema
pull/46798/merge
Justin England 6 years ago committed by Alicia Cozine
parent fd97c8e56c
commit 0bc5b799a6

@ -186,9 +186,22 @@ options:
- Allows you to define the repetition action of the trigger that defines how often the task is run and how long the repetition pattern is repeated - Allows you to define the repetition action of the trigger that defines how often the task is run and how long the repetition pattern is repeated
after the task is started. after the task is started.
- It takes in the following keys, C(duration), C(interval), C(stop_at_duration_end) - It takes in the following keys, C(duration), C(interval), C(stop_at_duration_end)
- C(duration) is how long the pattern is repeated and is written in the ISO 8601 Duration format C(P[n]Y[n]M[n]DT[n]H[n]M[n]S). suboptions:
- C(interval) is the amount of time between earch restart of the task and is written in the ISO 8601 Duration format C(P[n]Y[n]M[n]DT[n]H[n]M[n]S). duration:
- C(stop_at_duration_end) is a boolean value that indicates if a running instance of the task is stopped at the end of the repetition pattern. description:
- Defines how long the pattern is repeated.
- The value is in the ISO 8601 Duration format C(P[n]Y[n]M[n]DT[n]H[n]M[n]S).
- By default this is not set which means it will repeat indefinitely.
type: str
interval:
description:
- The amount of time between each restart of the task.
- The value is written in the ISO 8601 Duration format C(P[n]Y[n]M[n]DT[n]H[n]M[n]S).
type: str
stop_at_duration_end:
description:
- Whether a running instance of the task is stopped at the end of the repetition pattern.
type: bool
version_added: '2.5' version_added: '2.5'
# Principal options # Principal options

@ -61,7 +61,7 @@ suboption_schema = Schema(
'version_added': Any(float, *string_types), 'version_added': Any(float, *string_types),
'default': Any(None, float, int, bool, list, dict, *string_types), 'default': Any(None, float, int, bool, list, dict, *string_types),
# Note: Types are strings, not literal bools, such as True or False # Note: Types are strings, not literal bools, such as True or False
'type': Any(None, "bool"), 'type': Any(None, 'str', 'list', 'dict', 'bool', 'int', 'float', 'path', 'raw', 'jsonarg', 'json', 'bytes', 'bits'),
# Recursive suboptions # Recursive suboptions
'suboptions': Any(None, *list({str_type: Self} for str_type in string_types)), 'suboptions': Any(None, *list({str_type: Self} for str_type in string_types)),
}, },
@ -82,7 +82,7 @@ option_schema = Schema(
'default': Any(None, float, int, bool, list, dict, *string_types), 'default': Any(None, float, int, bool, list, dict, *string_types),
'suboptions': Any(None, *list_dict_suboption_schema), 'suboptions': Any(None, *list_dict_suboption_schema),
# Note: Types are strings, not literal bools, such as True or False # Note: Types are strings, not literal bools, such as True or False
'type': Any(None, 'str', 'list', 'dict', 'bool', 'int', 'float', 'path', 'raw', 'jsonarg', 'json', 'bytes', 'bits') 'type': Any(None, 'str', 'list', 'dict', 'bool', 'int', 'float', 'path', 'raw', 'jsonarg', 'json', 'bytes', 'bits'),
}, },
extra=PREVENT_EXTRA extra=PREVENT_EXTRA
) )

Loading…
Cancel
Save