Set or get options for reratos
eratos_options.RdThis function allows users to get or set configuration options for the Eratos and Senaps APIs.
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.rootBase URL for the Eratos Workspace API.
eratos.keyEratos API key (client ID).
eratos.secretEratos API secret (client secret).
senaps.sensor_urlBase URL for Senaps Sensor API.
senaps.datasource_urlBase URL for Senaps Datasource API.
senaps.tmd_urlBase URL for Senaps TMD API.
senaps.usernameUsername for Senaps.
senaps.passwordPassword for Senaps.
senaps.apikeyAPI key for Senaps.
senaps.tokenBearer token for Senaps (if available).
default_apiDefault 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")