salt.modules.random_org

Module for retrieving random information from Random.org

New in version 2015.5.0.

configuration

This module can be used by either passing an api key and version directly or by specifying both in a configuration profile in the salt master/minion config.

For example:

random_org:
  api_key: 7be1402d-5719-5bd3-a306-3def9f135da5
  api_version: 1
salt.modules.random_org.generateBlobs(api_key=None, api_version=None, **kwargs)

List all Slack users.

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • format -- Specifies the format in which the blobs will be returned. Values allowed are base64 and hex.

Returns

The user list.

CLI Example:

salt '*' get_integers number=5 min=1 max=6

salt '*' get_integers number=5 min=1 max=6
salt.modules.random_org.generateDecimalFractions(api_key=None, api_version=None, **kwargs)

Generates true random decimal fractions

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • number -- How many random decimal fractions you need. Must be within the [1,1e4] range.

  • decimalPlaces -- The number of decimal places to use. Must be within the [1,20] range.

  • replacement -- Specifies whether the random numbers should be picked with replacement. The default (true) will cause the numbers to be picked with replacement, i.e., the resulting numbers may contain duplicate values (like a series of dice rolls). If you want the numbers picked to be unique (like raffle tickets drawn from a container), set this value to false.

Returns

A list of decimal fraction

CLI Example:

salt '*' random_org.generateDecimalFractions number=10 decimalPlaces=4

salt '*' random_org.generateDecimalFractions number=10 decimalPlaces=4 replacement=True
salt.modules.random_org.generateGaussians(api_key=None, api_version=None, **kwargs)

This method generates true random numbers from a Gaussian distribution (also known as a normal distribution).

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • number -- How many random numbers you need. Must be within the [1,1e4] range.

  • mean -- The distribution's mean. Must be within the [-1e6,1e6] range.

  • standardDeviation -- The distribution's standard deviation. Must be within the [-1e6,1e6] range.

  • significantDigits -- The number of significant digits to use. Must be within the [2,20] range.

Returns

The user list.

CLI Example:

salt '*' random_org.generateGaussians number=10 mean=0.0 standardDeviation=1.0 significantDigits=8
salt.modules.random_org.generateIntegers(api_key=None, api_version=None, **kwargs)

Generate random integers

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • number -- The number of integers to generate

  • minimum -- The lower boundary for the range from which the random numbers will be picked. Must be within the [-1e9,1e9] range.

  • maximum -- The upper boundary for the range from which the random numbers will be picked. Must be within the [-1e9,1e9] range.

  • replacement -- Specifies whether the random numbers should be picked with replacement. The default (true) will cause the numbers to be picked with replacement, i.e., the resulting numbers may contain duplicate values (like a series of dice rolls). If you want the numbers picked to be unique (like raffle tickets drawn from a container), set this value to false.

  • base -- Specifies the base that will be used to display the numbers. Values allowed are 2, 8, 10 and 16. This affects the JSON types and formatting of the resulting data as discussed below.

Returns

A list of integers.

CLI Example:

salt '*' random_org.generateIntegers number=5 minimum=1 maximum=6

salt '*' random_org.generateIntegers number=5 minimum=2 maximum=255 base=2
salt.modules.random_org.generateStrings(api_key=None, api_version=None, **kwargs)

Generate random strings.

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • number -- The number of strings to generate.

  • length -- The length of each string. Must be within the [1,20] range. All strings will be of the same length

  • characters -- A string that contains the set of characters that are allowed to occur in the random strings. The maximum number of characters is 80.

  • replacement -- Specifies whether the random strings should be picked with replacement. The default (true) will cause the strings to be picked with replacement, i.e., the resulting list of strings may contain duplicates (like a series of dice rolls). If you want the strings to be unique (like raffle tickets drawn from a container), set this value to false.

Returns

A list of strings.

CLI Example:

salt '*' random_org.generateStrings number=5 length=8 characters='abcdefghijklmnopqrstuvwxyz'

salt '*' random_org.generateStrings number=10 length=16 characters'abcdefghijklmnopqrstuvwxyz'
salt.modules.random_org.generateUUIDs(api_key=None, api_version=None, **kwargs)

Generate a list of random UUIDs

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

  • number -- How many random UUIDs you need. Must be within the [1,1e3] range.

Returns

A list of UUIDs

CLI Example:

salt '*' random_org.generateUUIDs number=5
salt.modules.random_org.getUsage(api_key=None, api_version=None)

Show current usages statistics

Parameters
  • api_key -- The Random.org api key.

  • api_version -- The Random.org api version.

Returns

The current usage statistics.

CLI Example:

salt '*' random_org.getUsage

salt '*' random_org.getUsage api_key=peWcBiMOS9HrZG15peWcBiMOS9HrZG15 api_version=1