view page history | view next version >>
Access configuration by path
Syntax
Configuration can be accessed by path using http GET method through below url:
http://qb-server:8810/rest/configuration?path=<configuration path>
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.
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.
Demo
Below curl command demonstrates how to get xml representation of configuration root/test:
curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test
Access configuration by id
Syntax
Configuration can be accessed by id using http GET method through below url:
http://qb-server:8810/rest/configuration?id=<configuration id>
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.
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.
Demo
Below curl command demonstrates how to get xml representation of configuration with identifier 1 (the root configuration):
curl -u admin:admin http://localhost:8810/rest/configuration?id=1
Access configuration id by path
Syntax
Configuration id can be accessed by path using http GET method through below url:
http://localhost:8810/rest/configuration/id?path=<configuration path>
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.
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.
Demo
Below curl command demonstrates how to get id of configuration with path root/test:
curl -u admin:admin http://localhost:8810/rest/configuration/id?path=root/test
Access configuration path by id
Syntax
Configuration path can be accessed by id using http GET method through below url:
http://localhost:8810/rest/configuration/path?id=<configuration id>
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.
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.
Demo
Below curl command demonstrates how to get path name of configuration with id 1:
curl -u admin:admin http://localhost:8810/rest/configuration/path?id=1
Access configuration status by id
Syntax
Configuration status can be accessed by id using http GET method through below url:
http://localhost:8810/rest/configuration/status?id=<configuration id>
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.
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.
Demo
Below curl command demonstrates how to get status of configuration with id 1:
curl -u admin:admin http://localhost:8810/rest/configuration/status?id=1
Get all configurations in the system
Syntax
A list of all configurations can be retrieved using http GET method through below url:
http://localhost:8810/rest/configurations
The response is of mime type application/xml and the content is xml representation of list of all configurations in the system.
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.
Demo
Below curl command demonstrates how to get all configurations in the system:
curl -u admin:admin http://localhost:8810/rest/configurations
Get direct child configurations of specified configuration
Syntax
A list of direct child configurations can be accessed by parent configuration id using http GET method through below url:
http://localhost:8810/rest/configurations?id=<parent configuration id>
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 direct child configurations.
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 direct child configurations.
Demo
Below curl command demonstrates how to get child configurations under the configuration with id of 1:
curl -u admin:admin http://localhost:8810/rest/configurations?id=1
Get all descendent configurations of specified configuration
Syntax
All descendent configurations can be accessed by parent configuration id using http GET method through below url:
http://localhost:8810/rest/configurations?id=<parent configuration id>&recursive=true
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.
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.
Demo
Below curl command demonstrates how to get descendent configurations under the configuration with id of 1:
curl -u admin:admin "http://localhost:8810/rest/configurations?id=1&recursive=true"
Update configuration
Syntax
Configuration can be updated by posting xml representation of the configuration to below url:
http://localhost:8810/rest/configuration
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.
Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.
Demo
We will use curl 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:
curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test > tempfile.xml
- Edit tempfile.xml and change the nextBuildVersion property to desired value.
- Post back modified content using below command:
curl -X POST -u admin:admin -d @tempfile.xml -u admin:admin http://localhost:8810/rest/configuration
Create configuration
Syntax
Configuration can be created by posting xml representation of the configuration to below url:
http://localhost:8810/rest/configuration
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.
Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.
Demo
We will use curl 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:
curl -u admin:admin http://localhost:8810/rest/configuration?path=root/test > tempfile.xml
- Edit tempfile.xml, remove the id element, and change the name element to be test-copy
- Post back modified content using below command:
curl -X POST -u admin:admin -d @tempfile.xml -u admin:admin http://localhost:8810/rest/configuration
Delete configuration
Syntax
Configuration can be deleted using http DELETE method through below url:
http://localhost:8810/rest/configuration?id=<configuration id>
Here <configuration id} stands for id of the configuration to be deleted.
Security
You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative rights.
Demo
Below curl command demonstrates how to delete the configuration with id 2:
curl -X DELETE -u admin:admin http://localhost:8810/rest/configuration?id=2