This documentation relates to QuickBuild 9.0.x
Select here if you are using a different version

Interact with Audits

This API is added since QuickBuild 6.0.6.

Search Audits

Syntax

Audits can be searched using http GET method through below url:

http://localhost:8810/rest/audits?<search criteria1>=<value1>&<search criteria2>=<value2>&...

Query string part of the url represents various search criterias to restrict the search result. Supported search criterias are:

Search criteria Explanation
username Name of the user to audit. If not specified, audit log of all users will be searched.
source Specify source of audit to match. The character * can be used in the source string to do wildcard match. If not specified, audits from all sources will be matched.
action Action of the audit to match. If left empty, any action will be matched.
since In the format of yyyy-MM-dd HH:mm, for example: 2009-11-12 13:00. If specified, search audits generated after this date
until In the format of yyyy-MM-dd HH:mm, for example: 2009-11-12 14:00. If specified, search builds generated before this date
first Specified first audit entry to return. If not specified, value 0 is assumed
count Specified number of audit entries to return. This param must be specified in order not to mistakenly return all audits to stress the system

The response is of mime type application/xml, and the content is XML representation of list of matched builds. If no any search criterias are specified, all builds in the system will be returned.

Security

You will need to use http BASIC authentication to login as administrator if the anonymous does not have administative permission.

Demo

Below curl commands demonstrates how to combine different criterias to perform search:

  1. Search recent 100 audit entries for user robin under configuration tree root/test:
    curl -u admin:admin "http://localhost:8810/rest/audits?username=robin&source=root/test/*&count=100"
    Make sure to append "/" to configuration path if you want to search against certain configuration as QuickBuild uses trailing slash to differenticate audits generated from configurations and other sources. In this example we also append * to end of source param to match all sub configurations under root/test
  2. Search all audits bewteen generated after 2015-01-12 13:00 and after 2015-01-12 23:00 in the system:
    curl -u admin:admin "http://localhost:8810/rest/audits?since=2015-01-12+13:00&until=2015-01-12+23:00"
    Here we use 2015-01-12+13:00 instead of 2015-01-12 13:00 as the white space in query string has to be encoded as plus sign.

Count Audits

Counting audits uses the same syntax as searching audits, except that:

  1. It goes to url _http://localhost:8810/rest/audits/count_ instead of _http://localhost:8810/rest/audits_.
  2. first and count param should not be specified.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.