pushbullet.pushNote() function

The pushbullet.pushNote() function sends a push notification of type note to the Pushbullet API.

*Function type: Output*

  1. import "pushbullet"
  2. pushbullet.pushNote(
  3. url: "https://api.pushbullet.com/v2/pushes",
  4. token: "",
  5. title: "This is a push notification!",
  6. text: "This push notification came from Flux."
  7. )

Parameters

url

Pushbullet API URL. Defaults to https://api.pushbullet.com/v2/pushes.

*Data type: String*

token

Pushbullet API token to use when interacting with Pushbullet. Defaults to "".

*Data type: String*

title

Required
Title of the notification.

*Data type: String*

text

Required
Text to display in the notification.

*Data type: String*

Examples

Send the last reported status to Pushbullet
  1. import "pushbullet"
  2. import "influxdata/influxdb/secrets"
  3. token = secrets.get(key: "PUSHBULLET_TOKEN")
  4. lastReported =
  5. from(bucket: "example-bucket")
  6. |> range(start: -1m)
  7. |> filter(fn: (r) => r._measurement == "statuses")
  8. |> last()
  9. |> tableFind(fn: (key) => true)
  10. |> getRecord(idx: 0)
  11. pushbullet.pushNote(
  12. token: token,
  13. title: "Last reported status",
  14. text: "${lastReported._time}: ${lastReported.status}."
  15. )