Request URLs
Request URLs can be in any of the following forms. These examples assume vovserver is listening on port 2345 of a machine named myserver.
Form 1: Querying for All Fields of an Object
http://myserver:2345/api/v3/jobs/12345
http://myserver:2345/api/v3/jobs/12345/
http://myserver:2345/api/v3/jobs/12345/*
The v3
part of the API refers to the current API revision. Old API
revisions will continue to be supported as new revisions are introduced, e.g. when
the current revision is 4, the v3
URLs will remain functional.
All of the above URL formats are identical in behavior and output, and will return a
formatted list of all fields in job 12345. This is equivalent to vovselect
'*' from jobs where idint==12345
in the CLI.
Form 2: Querying for a Specific Field
http://myserver:2345/api/v3/jobs/12345/status
vovselect status from jobs where idint==12345
. The output will
be similar
to:{"startrow":1,"endrow":1,"query":"SELECT status FROM jobs WHERE idint==1158062","errormsg":"","columns":[{"col":0,"field":"status"}], "rows":[["VALID"]]}
Form 3: Perform a Complex Query
http://myserver:2345/api/v3/query?select=idint,host,status&from=jobs&where=status%3d%3dVALID&limit=10&order=host%20DESC
vovselect
idint,host,status -from jobs -where status==VALID -limit 10 -order "host
DESC".
The output will be similar
to:{"startrow":1,"endrow":8,"query":"SELECT idint,host,status FROM jobs
WHERE status==VALID ORDERBY host DESC LIMIT 10","errormsg":"","columns":[{"col":0,"field":"idint"},
{"col":1,"field":"host"},{"col":2,"field":"status"}], "rows":[[1158051,"titanus","VALID"][1158058,
"titanus","VALID"][1158049,"skull","VALID"][1158062,"skull","VALID"][1158109,"skull","VALID"][1158117,
"skull","VALID"][1158101,"localhost","VALID"][1158105,"localhost","VALID"]]}
Format | Description |
---|---|
json (default) | Return a JSON-formatted list of fields |
csv | Return fields formatted as a CSV, with column headers |
csv-noheader | Return fields formatted as a CSV with no column headers |
http://myserver:2345/api/v3/jobs/12345?format=csv
A complete list of fields, their data types, and the objects to which they belong can be viewed in Node Fields.