View Source

QuickBuild database backup can be taken via RESTful call.

h1. Syntax
The backup can be taken by posting XML representation of the database backup request object to below url:
{code}http://localhost:8810/rest/backup{code}
A sample XML of backup request object is like below:
{code}
<com.pmease.quickbuild.web.page.administration.BackupNowOption>
<!-- Destination file for the backup -->
<backupTo>/path/to/backup.zip</backupTo>

<!-- Whether or not to exclude builds in the backup -->
<excludeBuilds>false</excludeBuilds>

<!-- Whether or not to exclude measurement data in the backup -->
<excludeMeasurements>false</excludeMeasurements>

<!-- Whether or not to exclude audits in the backup -->
<excludeAudits>false</excludeAudits>

<!-- Whether or not to clear passwords in the backup -->
<clearPasswords>false</clearPasswords>
</com.pmease.quickbuild.web.page.administration.BackupNowOption>
{code}

The response is of mime type _text/plain_ and the content is absolute path to the backup file.

h2. Security
You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have _RUN_BUILD_ permission for the requested configuration.

h2. Demo
We use [curl|http://curl.haxx.se/] to demonstrate how to request a build in configuration _root/test_:
# Get configuration id using [id service|retrieve object identifier]:
{code}curl http://localhost:8810/rest/ids?configuration_path=root/test{code}
# Save the sample build request XML described above to file _tempfile.xml_, and modify configuration id to use value returned by the first step.
# Post content of _tempfile.xml_ to QuickBuild using below command:
{code}curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/build_requests{code}

{anchor:delete build request}
h1. Delete a Build Request

h2. Syntax
Existing build request can be deleted using http DELETE method through below url:
{code}http://localhost:8810/rest/build_requests/<build request id>{code}
{note}If the build associated with the build request is already running, it will be forcibly stopped.{note}

h2. Security
You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have _STOP_BUILD_ permission for the associated configuration.

h2. Demo
We use [curl|http://curl.haxx.se/] to demonstrate how to delete build request _0136ed89-d47f-4307-8e69-c8535fae0e84_:
{code}curl -X DELETE -u admin:admin http://localhost:8810/rest/build_requests/0136ed89-d47f-4307-8e69-c8535fae0e84{code}