Learn R Programming

r311 (version 0.4.3)

validate_endpoints: Validate endpoints

Description

Checks whether and which endpoints are correctly defined, reachable, and/or valid. Iterates through all endpoints defined in o311_endpoints and returns their status along with a reason, if applicable.

Usage

validate_endpoints(
  idx = NULL,
  checks = c("discovery", "services", "requests"),
  methods = c("formal", "down", "valid")
)

Value

A dataframe containing the name of the endpoint, one to three columns on check results, and one to three columns on reasons if a check turned out to be negative.

Arguments

idx

[integer]

Index numbers of endpoints to check. Index numbers follow row numbers in o311_endpoints.

checks

[character]

Which open311 method to check. By default, checks all methods.

methods

[character]

Which checks to apply. formal checks whether an endpoint is uniquely identifiable through given names and jurisdictions in o311_endpoints. down checks whether an endpoint is reachable and ready for requests. valid checks whether a method returns a valid output, i.e. a list or dataframe with more than 0 rows/elements. By default, applies all methods.

Examples

Run this code
# \donttest{
# check the first three endpoints in o311_endpoints()
validate_endpoints(1:3)

# check only requests
validate_endpoints(1:3, checks = "requests")

# check only whether an endpoint is down
validate_endpoints(1:3, methods = "down")
# }

Run the code above in your browser using DataLab