mantaAttempt: raw REST API Manta Caller with exception handling for...

Description Usage Arguments Details Value

View source: R/mantaAttempt.R

Description

Exported to access HTTPS Manta API and metadata retrieval.

Usage

1
2
mantaAttempt(action, method, headers, returncode, limit, marker, json = TRUE,
  test = FALSE, silent = FALSE, verbose = FALSE)

Arguments

action

character, optional. Path to a manta object or directory with optional query terms. When unspecified, uses current Manta Directory and returns JSON listing values for the directory.

method

character, optional. Default is "GET", passed "GET", "POST", "OPTIONS", "PUT", "DELETE" or "HEAD" from higher level library callers.

headers,

array of named characters, optional. The headers follow the RCurl structure of vector of characters where HTTP header tags are the names, values as named characters, no semicolons or delimiters.

returncode,

character, optional. Set to expected HTTP return code, e.g. "200", "204" - used when test is TRUE.

limit,

numeric, optional. Set to limit number of returned listed JSON lines - number of directory entries Otherwise uses default value in mantaSetLimits

marker,

character, optional. Name or id character value of directory entry to start next listing segment of length limit.

json

logical, optional. FALSE means return R data, TRUE means return JSON data.

test

logical, optional, Set to TRUE to return logical as to whether the request passed or failed. Also affects the behavior of the silent parameter. See Value for output table.

silent

logical, optional. Controls whether > "400" service errors are emitted by cat or stop depending on the value of test. See Value for output table.

verbose

logical, optional. Passed to RCurl GetURL, Set to TRUE to see background HTTPS REST communication.

Details

If test == TRUE, it returns pass/fail logical If passed a Manta subdirectory, it returns the directory JSON according to the length limit set with mantaSetLimits

Note getURL verbose = TRUE writes to UNIX stderr which is invisible on Windows R.

Value

The Manta reply data in JSON or R format, OR a logical value if test = TRUE. Return values and Manta server error message display or stop behavior depends on values of test, silent:

test = TRUE, silent = TRUE
logical - success returned, Errors are logged.
test = TRUE, silent = FALSE
logical - success returned, Errors are logged, emitted to console.
test = FALSE, silent = TRUE
data returned, Errors are logged, empty data on error.
test = FALSE, silent = FALSE data returned, Errors are logged, stop() on 400 series errors.


joyent/mantaRSDK documentation built on May 19, 2019, 10:43 p.m.