integer#
State module for generating random integers
- idem_random.states.random.integer.present(hub, ctx, name: str, min: int, max: int, resource_id: int = None, keepers: Dict[str, Any] = None, seed: str = None) Dict[str, Any] [source]#
This is a logical state and doesn’t interact with any cloud providers. This state can be used in conjunction with any other state to generate random integer with the provided configurations. State’s configuration data is stored in esm. If for a given state , the configuration changes , a new random integer is generated. If there are no configuration changes , then the old integer is retained.
- Parameters:
name (str) – An Idem name of the resource.
min (int) – The minimum inclusive value of the range.
max (int) – The maximum inclusive value of the range.
resource_id (int, Optional) – Unique random Integer
keepers (dict, Optional) – Arbitrary map of values that, when changed, will trigger recreation of resource.
seed (str, Optional) – A custom seed to always produce the same value.
Request Syntax:
[random_integer_state]: random.integer.present: - name: 'string' - keepers: 'string': 'string' - min: 'int' - max: 'int' - seed: 'string'
- Returns:
Dict[str, Any]
Examples:
random_integer_state: random.integer.present: - name: random_integer - min: 0 - max: 9 - keepers: key: value
- idem_random.states.random.integer.absent(hub, ctx, name: str) Dict[str, Any] [source]#
This logical state is used to invalidate/delete the random integer resource.
- Parameters:
name (str) – An Idem name of the resource.
Request Syntax:
[random_integer_state]: random.integer.absent: - name: 'string'
- Returns:
Dict[str, Any]
Example:
random_state01011: random.integer.absent: - name: rs01011