diff --git a/DESCRIPTION b/DESCRIPTION index 35e4a88..86d2a87 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,13 +1,22 @@ Package: AotClient Type: Package -Title: Office Array of Things API Client +Title: Official 'Array of Things' API Client Version: 0.1.0 -Author: Vince Forgione +Date: 2018-11-09 +Authors@R: person("Vince", "Forgione", email = "vforgione@uchicago.edu", + role = c("aut", "cre")) Maintainer: "Vince Forgione" -Description: HTTP API Client -License: Apache 2 +Description: The library serves as the official client + for the 'Array of Things' API . + It allows users to list available node and get detailed + statistics for each node. +License: Apache License 2.0 Encoding: UTF-8 LazyData: true +Imports: + httr, + jsonlite Suggests: testthat -RoxygenNote: 6.1.0 +RoxygenNote: 6.1.1 +URL: https://github.com/UrbanCCD-UChicago/aot-client-r diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e467085..0000000 --- a/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2018 University of Chicago - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/NAMESPACE b/NAMESPACE index 8c9514c..d92193d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,3 +8,5 @@ export(ls.sensors) export(stat.node) export(stat.project) export(stat.sensor) +importFrom(httr,GET) +importFrom(jsonlite,fromJSON) diff --git a/R/AotClient.R b/R/AotClient.R index 7c77e63..4fc3adb 100644 --- a/R/AotClient.R +++ b/R/AotClient.R @@ -19,6 +19,7 @@ log_msg <- function (msg) { #' @param url - The URL to send the request to #' @param filters - A list of tuples to build filters/query params #' @return The entire response +#' @importFrom httr GET #' @noRd send_request <- function (url, filters = NULL) { # send request; get response @@ -48,6 +49,7 @@ send_request <- function (url, filters = NULL) { #' #' @param resp - The response object #' @return The parsed JSON body +#' @importFrom jsonlite fromJSON #' @noRd parse_content <- function (resp) { content <- httr::content(resp, as="text")