Example Queries

Empty Query

The following example returns an error code of 1; this is the result of an empty query. The text to be appended to the command lines for this example is:

username=system\&password=system

In this case, the query=SEARCH%20Host string is missing. Use the cat command to view the output file; it contains only the returned error code; a 1.

No Client Timeout

You may experience client-side timeouts; in this case you will encounter an unexpected end of file in the output. To avoid this, increase the client timeout to a value in excess of the web server timeout, or disable it entirely.

The following example shows how to disable the wget timeout. If the query takes longer to run than the appliance web server timeout, no output will be received.

$ wget --timeout=0 http://appliance/ui/api/...

Invalid Query

The following example returns an error code of 3; this is the result of an invalid query. The text to be appended to the command lines for this example is:

query=SEARCHX%20Host\&username=system\&password=system

The query string now uses SEARCHX instead of SEARCH. This query will fail as there is no SEARCHX command defined in the query language. Use the cat command to view the output file; it contains only the returned error code; a 3.

Authorisation Failure

The following example shows an authorisation failure; this is the result of an invalid password. The text to be appended to the command lines for this example is:

query=SEARCH%20Host\&username=system\&password=system1

The query string now uses a password of system1 instead of system. This causes an authorisation failure returning a server response code of 401. This can be seen on the terminal the command was issued from.

Was this page helpful? Yes No Submitting... Thank you

Comments