platform_connect: Set up a connection object, and call the health endpoint to...

View source: R/platform_connect.R

platform_connectR Documentation

Set up a connection object, and call the health endpoint to make sure everything is up and running on the server side

Description

Set up a connection object, and call the health endpoint to make sure everything is up and running on the server side

Usage

platform_connect(
  api_key = NULL,
  project = NULL,
  root_url = NULL,
  api_endpoint = NULL
)

Arguments

api_key

the api key from the /api-key-service endpoint of your CSA host through a browser

project

project name

root_url

root_url of the Query API to use, e.g. "http://localhost:1337". If left as NULL the function will try to get it from the environment variable GOR_API_ROOT_URL, otherwise it will take it from the iss part of the decoded JWT (api_key)

api_endpoint

the api endpoint path on the server. If left as NULL the function will try to get it from the environment variable GOR_API_ENDPOINT, otherwise defaults to set up connection to /api/query and /api/phenotype-catalog

Value

returns a list with the connection data

Examples

## Not run: 
api_key <- "...paste from your /api-key-service/token endpoint..."
conn <- platform_connect(api_key, "test_project")

# or have platform_connect take the api_key from the environment variable GOR_API_KEY:
conn <- platform_connect(project = "test_project")


## End(Not run)

wuxi-nextcode/gorr documentation built on Jan. 1, 2023, 7:54 a.m.