Downloads & saves the desired input file. Hits the /api/inputs/{input_id} API endpoint

download.input(server, input_id, filename = NULL, save_as = NULL)

Arguments

server

Server object obtained using the connect() function

input_id

ID of the PEcAn input to be downloaded

filename

Optional filename specified if the id points to a folder instead of file

save_as

File name to save the downloaded file as. Default: NULL (same as 'filename' if specified, else defaults to 'pecan_input_file')

Value

Response obtained from the /api/inputs/{input_id} endpoint

Author

Tezan Sahu

Examples

server <- connect(url="http://pecan.localhost:80", username="carya", password="illinois")

# Download the 'niwot.clim' file (id = 99000000003)
download.input(server, input_id='99000000003', save_as='local.niwot.clim')
#> Sorry! Server not responding.