discovery.restfulGet(target, protocol, path[, header])
Performs a GET request on the target using the RESTful protocol specified and returns a node containing information on the discovered system.The function takes the following parameters:
target– the device against which the request is performed.
protocol– distinguishes the RESTful protocol for distinguishing credentials and handling any device specific behaviour. VPLEX is the only protocol currently supported.
path– for example
/vplex/clusters. The IP address and access method are automatically added according to the credential and endpoint being discovered.
header– an optional table with additional values to be passed in the headers of the request. For VPLEX the username and password fields are automatically added. It is not possible to override automatically added values.
and returns a DiscoveryAPIResult node containing the following:
– the response status.
– the response reason.
response_header– a table of header entries. Sensitive fields are removed.
response_body– the body of the response.
When data is successfully retrieved using the VPLEX protocol
response_body is a JSON string which can be decoded using the json.decode function.
If the discovery request fails the
discovery.restfulGet function returns none.