Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hakaiApi/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-CA
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Config/testthat/edition: 3
Config/Needs/website: rmarkdown
10 changes: 5 additions & 5 deletions hakaiApi/R/client.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ Client <- R6::R6Class(
#' @description
#' Log into Google to gain credential access to the API
#' @param api_root Optional API base url to fetch data.
#' Defaults to "https://hecate.hakai.org/api"
#' Defaults to "https://portal.hakai.org/api"
#' @param login_page Optional API login page url to display to user.
#' Defaults to "https://hecate.hakai.org/api-client-login"
#' Defaults to "https://portal.hakai.org/api-client-login"
#' @param credentials_file Optional path to the credentials cache file.
#' Defaults to a file in the user's data directory as determined by tools::R_user_dir()
#' @details
Expand All @@ -74,8 +74,8 @@ Client <- R6::R6Class(
#' client <- Client$new(credentials_file = "/path/to/creds")
#' )
initialize = function(
api_root = "https://hecate.hakai.org/api",
login_page = "https://hecate.hakai.org/api-client-login",
api_root = "https://portal.hakai.org/api",
login_page = "https://portal.hakai.org/api-client-login",
credentials_file = NULL
) {
self$api_root <- api_root
Expand Down Expand Up @@ -105,7 +105,7 @@ Client <- R6::R6Class(
#' @return A dataframe of the requested data
#' @examples
#' try(client$get("/aco/views/projects"))
#' try(client$get("https://hecate.hakai.org/api/aco/views/projects"))
#' try(client$get("https://portal.hakai.org/api/aco/views/projects"))
get = function(endpoint_url, col_types = NULL) {
resolved_url <- private$resolve_url(endpoint_url)
token <- paste(
Expand Down
4 changes: 2 additions & 2 deletions hakaiApi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ remotes::install_github("HakaiInstitute/hakai-api-client-r", subdir='hakaiApi')

```r
# Initialize the client
client <- hakaiApi::Client$new("https://hecate.hakai.org")
client <- hakaiApi::Client$new("https://portal.hakai.org")

# Request some data (request chlorophyll data here)
data <- client$get("api/eims/views/output/chlorophyll?limit=50")
Expand All @@ -47,7 +47,7 @@ For details about the API, including available endpoints where data can be reque

## Advanced usage

You can specify which API to access when instantiating the Client. By default, the API uses `https://hecate.hakai.org/api` as the API root. It may be useful to use this library to access a locally running API instance or to access the Goose API for testing purposes.
You can specify which API to access when instantiating the Client. By default, the API uses `https://portal.hakai.org/api` as the API root. It may be useful to use this library to access a locally running API instance or to access the Goose API for testing purposes.

```r
# Get a client for a locally running API instance
Expand Down
12 changes: 6 additions & 6 deletions hakaiApi/man/Client.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hakaiApi/vignettes/articles/Viewing-Recent-Stations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We first need to access the stations endpoint using the `Client` class from the

```{r get-data}
#| eval: FALSE
hakai_client <- hakaiApi::Client$new("https://hecate.hakai.org/api")
hakai_client <- hakaiApi::Client$new("https://portal.hakai.org/api")
stations <- hakai_client$get_stations()
```

Expand Down