Search PEcAn Sites from the database using search string based on sitename. Hits the /api/sites/ API endpoint with relevant query parameters

search.sites(server, sitename = "", ignore_case = TRUE)

Arguments

server

Server object obtained using the connect() function

sitename

Search string for site name Default: "" (Returns all sites)

ignore_case

Indicator of case sensitive or case insensitive search

Value

Response obtained from the /api/sites/ endpoint with relevant query parameters

Author

Tezan Sahu

Examples

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

# Get details of all sites
res1 <- search.sites(server)
#> Sorry! Server not responding.

# Get details of all sites containing 'willow' in their name
res2 <- search.sites(server, sitename="willow")
#> Sorry! Server not responding.

# Get details of sites where name contains "Willow" (case sensitive)
res3 <- search.sites(server, sitename="Willow", ignore_case=FALSE)
#> Sorry! Server not responding.