Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add definitions data back to the bucket #57

Merged
merged 1 commit into from
Jan 16, 2024
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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(add_definitions_to_bucket)
export(annual_rainfall_summaries)
export(annual_temperature_summaries)
export(crop_success_probabilities)
Expand Down
14 changes: 14 additions & 0 deletions R/add_definitions_to_bucket.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#' Add New Definitions to Google Cloud Storage Bucket
#'
#' This function adds a new definitions file with a timestamp to a specified Google Cloud Storage (GCS) bucket. The new definitions are sourced from a JSON file provided as input.
#'
#' @param country A character vector specifying the country or countries from which to get the definitions data. Options are `"mz"` and `"zm"`.
#' @param station_id A character string specifying the ID of the station for which to get the definitions data.
#' @param new_definitions A character vector specifying the path to the JSON file containing the new definitions.
#'
#' @export
#' @details
#' The function creates a timestamp in the format "YYYYMMDDHHMMSS" and appends it to the station_id to form the filename. It then reads the provided JSON file, creates a new JSON file with the timestamped filename, and uploads it to the specified GCS bucket.
add_definitions_to_bucket <- function(country, station_id, new_definitions){
return(epicsadata::add_definitions_to_bucket(country = country, station_id = station_id, new_definitions = new_definitions))
}
21 changes: 21 additions & 0 deletions man/add_definitions_to_bucket.Rd

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