View Source

h1. Get child configurations of specified configuration

h2. Syntax
A list of child configurations can be accessed by parent configuration id using http GET method through below url:
{code}http://localhost:8810/rest/configurations?parent_id=<parent configuration id>{code}
Here _<parent configuration id>_ represents id of the parent configuration. The response is of mime type _application/xml_ and the content is xml representation of list of all child configurations.
{note}For performance reason, only key information of the configuration will be returned here, including id, name, description, schedule, runMode, errorMessage, and parent id. Use [this method|#get configuration by id] to get full xml representation of a configuration if necessary.{note}

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous does not have permission to access any of the child configurations.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get child configurations under the configuration with id of _1_:
{code}curl -u admin:admin http://localhost:8810/rest/configurations?parent_id=1{code}

h1. Get all descendent configurations of specified configuration

h2. Syntax
All descendent configurations can be accessed by parent configuration id using http GET method through below url:
{code}http://localhost:8810/rest/configurations?id=<parent configuration id>&recursive=true{code}
Here _<parent configuration id>_ represents id of the parent configuration. The response is of mime type _application/xml_ and the content is xml representation of list of all descendent configurations.

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous does not have _ACCESS_SETTINGS_ permission of any of the descendent configurations.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get descendent configurations under the configuration with id of _1_:
{code}curl -u admin:admin "http://localhost:8810/rest/configurations?id=1&recursive=true"{code}

{anchor:get configuration by id}
h1. Access configuration by path

h2. Syntax
Configuration can be accessed by path using http GET method through below url:
{code}http://qb-server:8810/rest/configuration?path=<configuration path>{code}
Here _<configuration path>_ stands for path name of the configuration. The response is of mime type _application/xml_ and the content is xml representation of the configuration.

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

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get xml representation of configuration _root/test_:
{code}curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test{code}

h1. Access configuration by id

h2. Syntax
Configuration can be accessed by id using http GET method through below url:
{code}http://qb-server:8810/rest/configuration?id=<configuration id>{code}
Here _<configuration id>_ stands for id of the configuration. The response is of mime type _application/xml_ and the content is xml representation of the configuration.

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

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get xml representation of configuration with identifier _1_ (the root configuration):
{code}curl -u admin:admin http://localhost:8810/rest/configuration?id=1{code}

h1. Access configuration id by path

h2. Syntax
Configuration id can be accessed by path using http GET method through below url:
{code}http://localhost:8810/rest/configuration/id?path=<configuration path>{code}
Here _<configuration path>_ stands for path name of the configuration. The response is of mime type _plain/text_ and the content is string representation of the configuration id.

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous is not allowed to access the requested configuration.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get id of configuration with path _root/test_:
{code}curl -u admin:admin http://localhost:8810/rest/configuration/id?path=root/test{code}

h1. Access configuration path by id

h2. Syntax
Configuration path can be accessed by id using http GET method through below url:
{code}http://localhost:8810/rest/configuration/path?id=<configuration id>{code}
Here _<configuration id>_ stands for id of the configuration. The response is of mime type _plain/text_ and the content is string representation of the configuration path name.

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous is not allowed to access the requested configuration.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get path name of configuration with id _1_:
{code}curl -u admin:admin http://localhost:8810/rest/configuration/path?id=1{code}

h1. Access configuration status by id

h2. Syntax
Configuration status can be accessed by id using http GET method through below url:
{code}http://localhost:8810/rest/configuration/status?id=<configuration id>{code}
Here _<configuration id>_ stands for id of the configuration. The response is of mime type _plain/text_ and the content is string representation of the configuration status.

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous is not allowed to access the requested configuration.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get status of configuration with id _1_:
{code}curl -u admin:admin http://localhost:8810/rest/configuration/status?id=1{code}

h1. Get all configurations in the system

h2. Syntax
A list of all configurations can be retrieved using http GET method through below url:
{code}http://localhost:8810/rest/configurations{code}
The response is of mime type _application/xml_ and the content is xml representation of list of all configurations in the system.

h2. Security
You will need to use http BASIC authentication to login as an authorized QuickBuild user if the anonymous does not have _ACCESS_SETTINGS_ permission of any of the configuration in the system.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to get all configurations in the system:
{code}curl -u admin:admin http://localhost:8810/rest/configurations{code}

h1. Update configuration

h2. Syntax
Configuration can be updated by posting xml representation of the configuration to below url:
{code}http://localhost:8810/rest/configuration{code}
Please note that the _parent_ element denotes id of the parent configuration.
Normally you do not need to create the xml from scratch: you may retrieve xml representation of the configuration using various configuration access methods, modify certain parts of the xml and post back to above url.
The response is of mime type _text/plain_ and the content is string representation of the configuration id being updated.

h2. Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.

h2. Demo
We will use [curl|http://curl.haxx.se/] to demonstrate how to modify next build version of configuration _root/test_:
# Retrieve xml representation of configuration _root/test_ into a temp file using below command:
{code}curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test > tempfile.xml{code}
# Edit _tempfile.xml_ and change the _nextBuildVersion_ property to desired value.
# Post back modified content using below command:
{code}curl -X POST -u admin:admin -d @tempfile.xml http://localhost:8810/rest/configuration{code}

h1. Create configuration

h2. Syntax
Configuration can be created by posting xml representation of the configuration to below url:
{code}http://localhost:8810/rest/configuration{code}
Please note that:
# The posted xml should NOT contain the _id_ element; otherwise, QuickBuild will treat the post as an updating to the configuration with that id.
# The _parent_ element denotes id of the parent configuration.
Normally you do not need to create the xml from scratch: you may retrieve xml representation of a templating configuration using various configuration access methods, remove the _id_ element, modify certain parts and post back to above url.
The response is of mime type _text/plain_ and the content is string representation of id of the newly created configuration.

h2. Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.

h2. Demo
We will use [curl|http://curl.haxx.se/] to demonstrate how to create a new configuration _root/test-copy_ by copying the configuration _root/test_.
# Retrieve xml representation of configuration _root/test_ into a temp file using below command:
{code}curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test > tempfile.xml{code}
# Edit _tempfile.xml_, remove the _id_ element, and change the _name_ element to be _test-copy_
# Post back modified content using below command:
{code}curl -X POST -u admin:admin -d @tempfile.xml -u admin:admin http://localhost:8810/rest/configuration{code}

h1. Delete configuration

h2. Syntax
Configuration can be deleted using http DELETE method through below url:
{code}http://localhost:8810/rest/configuration?id=<configuration id>{code}
Here _<configuration id}_ stands for id of the configuration to be deleted.

h2. Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.

h2. Demo
Below [curl|http://curl.haxx.se/] command demonstrates how to delete the configuration with id _2_:
{code}curl -X DELETE -u admin:admin http://localhost:8810/rest/configuration?id=2{code}