pi_connect: Connect to the PI web API

Description Usage Arguments Value Examples

View source: R/connection.R

Description

Connects to a web API endpoint, optionally with authentication. Never store passwords in script files or type them into the console!!!! Instead, this function will propmpt you for a password in RStudio, or you can set the R_PI_PASSWORD environment variable (you could do so using usethis::edit_r_environ()). Use pi_connect_public() to connect to the OSIsoft public web API endpoint (to do so, you'll need to set the R_PI_PUBLIC_USER and R_PI_PUBLIC_PASSWORD environment variables).

Usage

1
2
3
4
pi_connect(endpoint = Sys.getenv("R_PI_ENDPOINT"),
  user = Sys.getenv("R_PI_USER"), test = TRUE)

pi_connect_public(test = TRUE)

Arguments

endpoint

The base URL for the endpoint.

user

Username for authentication.

test

Use test = FALSE to skip testing the endpoint/authentication. This is used to reduce the number of HTTP calls in the package tests.

Value

A connection object

Examples

1

paleolimbot/piplyr documentation built on Nov. 4, 2019, 11:17 p.m.