pushbullet.endpoint() function
The pushbullet.endpoint()
function creates the endpoint for the Pushbullet API
and sends a notification of type note
.
Function type: Output
import "pushbullet"
pushbullet.endpoint(
url: "https://api.pushbullet.com/v2/pushes",
token: ""
)
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
Usage
pushbullet.endpoint
is a factory function that outputs another function.
The output function requires a mapFn
parameter.
mapFn
A function that builds the record used to generate the API request.
Requires an r
parameter.
Data type: Function
mapFn
accepts a table row (r
) and returns a record that must include the
following fields (as defined in pushbullet.pushNote()
):
title
text
Examples
Send the last reported status to Pushbullet
import "pushbullet"
import "influxdata/influxdb/secrets"
token = secrets.get(key: "PUSHBULLET_TOKEN")
e = pushbullet.endpoint(token: token)
lastReported =
from(bucket: "example-bucket")
|> range(start: -10m)
|> filter(fn: (r) => r._measurement == "statuses")
|> last()
lastReported
|> e(mapFn: (r) => ({
r with
title: r.title,
text: "${string(v: r._time)}: ${r.status}."
})
)()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.