saltext.pushover.utils.pushover

Utility functions for interacting with the Pushover API.

saltext.pushover.utils.pushover.query(function, token=None, api_version='1', method='POST', header_dict=None, data=None, query_params=None, opts=None)[source]

Query the Pushover API.

Parameters:
  • token – The Pushover API key. Ignored. FIXME

  • api_version – The Pushover API version to use, defaults to version 1. (There is only version 1 FIXME).

  • function – The Pushover API function to perform.

  • method – The HTTP method, e.g. GET or POST.

  • data – The data to be sent for POST method.

Returns:

The json response from the API call or False.

saltext.pushover.utils.pushover.validate_sound(sound, token)[source]

Validate that a specified sound value exists.

Parameters:
  • sound – The sound that we want to verify

  • token – The Pushover token.

saltext.pushover.utils.pushover.validate_user(user, device, token)[source]

Validate that a user/group ID (key) exists and has at least one active device. If device is not falsy, additionally validate that the device exists in the account.

Parameters:
  • user – The user or group name, either will work.

  • device – The device for the user.

  • token – The Pushover token.