docs-v2/content/influxdb/cloud/reference/flux/stdlib/pushbullet/pushnote.md

1.6 KiB

title description menu weight
pushbullet.pushNote() function The `pushbullet.pushNote()` function sends a push notification of type `note` to the Pushbullet API.
influxdb_cloud_ref
name parent
pushbullet.pushNote Pushbullet
202

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

Function type: Output

import "pushbullet"

pushbullet.pushNote(
  url: "https://api.pushbullet.com/v2/pushes",
  token: "",
  title: "This is a push notification!",
  text: "This push notification came from Flux."
)

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

({{< req >}})
Title of the notification.

Data type: String

text

({{< req >}})
Text to display in the notification.

Data type: String

Examples

Send the last reported status to Pushbullet
import "pushbullet"
import "influxdata/influxdb/secrets"

token = secrets.get(key: "PUSHBULLET_TOKEN")

lastReported =
  from(bucket: "example-bucket")
    |> range(start: -1m)
    |> filter(fn: (r) => r._measurement == "statuses")
    |> last()
    |> tableFind(fn: (key) => true)
    |> getRecord(idx: 0)

pushbullet.pushNote(
  token: token,
  title: "Last reported status",
  text: "${lastReported._time}: ${lastReported.status}."
)