Skip to contents

This function allows users to get or set configuration options for the Eratos and Senaps APIs.

Usage

eratos_options(...)

Arguments

...

Option names to retrieve or key-value pairs to set.

Value

If called with no arguments, returns all current options. If called with named arguments, updates and returns the modified options.

Details

The options are managed via a nested structure that distinguishes between the Eratos and Senaps APIs.

Supported options

eratos.root

Base URL for the Eratos Workspace API.

eratos.key

Eratos API key (client ID).

eratos.secret

Eratos API secret (client secret).

senaps.sensor_url

Base URL for Senaps Sensor API.

senaps.datasource_url

Base URL for Senaps Datasource API.

senaps.tmd_url

Base URL for Senaps TMD API.

senaps.username

Username for Senaps.

senaps.password

Password for Senaps.

senaps.apikey

API key for Senaps.

senaps.token

Bearer token for Senaps (if available).

default_api

Default API to use ("eratos" or "senaps").

Examples

# Get all options
eratos_options()
#> $eratos
#> $eratos$workspace_url
#> [1] "https://api.eratos.com/api/workspace/v1"
#> 
#> $eratos$key
#> [1] ""
#> 
#> $eratos$secret
#> [1] ""
#> 
#> 
#> $senaps
#> $senaps$sensor_url
#> [1] "https://senaps.eratos.com/api/sensor/v2/"
#> 
#> $senaps$datasource_url
#> [1] "https://senaps.eratos.com/api/datasource/v1/"
#> 
#> $senaps$tmd_url
#> [1] "https://senaps.io/thredds/ncss/"
#> 
#> $senaps$username
#> [1] ""
#> 
#> $senaps$password
#> [1] ""
#> 
#> $senaps$apikey
#> [1] ""
#> 
#> $senaps$token
#> [1] ""
#> 
#> 

# Set Eratos credentials
eratos_options(eratos.key = "mykey", eratos.secret = "mysecret")

# Set Senaps API key
eratos_options(senaps.apikey = "xyz123")