mirror of https://git.sr.ht/~hrbrmstr/metis
boB Rudis
6 years ago
12 changed files with 109 additions and 45 deletions
@ -0,0 +1,26 @@ |
|||
.aws_bin <- function() { |
|||
unname(Sys.which('aws')) |
|||
} |
|||
|
|||
.athenacli <- function(...) { |
|||
|
|||
args <- c("athena") |
|||
|
|||
in_args <- list(...) |
|||
if (length(in_args) == 0) in_args <- "help" |
|||
|
|||
args <- c(args, unlist(in_args, use.names=FALSE)) |
|||
|
|||
res <- sys::exec_internal(.aws_bin(), args = args, error = FALSE) |
|||
|
|||
if (length(res$stdout) > 0) { |
|||
|
|||
out <- rawToChar(res$stdout) |
|||
|
|||
if ("help" %in% args) cat(out, sep="") |
|||
|
|||
invisible(out) |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
list_query_executions <- function(max_items=10, starting_token=NULL, page_size=NULL) { |
|||
|
|||
|
|||
args <- c("list-query-executions", sprintf("--max-items=%s", as.integer(max_items))) |
|||
|
|||
if (!is.null(starting_token)) args <- c(args, sprintf("--starting-token=%s", starting_token)) |
|||
if (!is.null(page_size)) args <- c(args, sprintf("--page-size=%s", as.integer(page_size))) |
|||
|
|||
res <- .athenacli(args) |
|||
|
|||
jsonlite::fromJSON() |
|||
|
|||
} |
Loading…
Reference in new issue