Skip to main content
Version: QB10

Interact with Groups

Get all groups in the system

Syntax

Groups in the system can be accessed using http GET method through below url:

http://localhost:8810/rest/groups

The response is of mime type application/xml and the content is XML representation of all groups in the system.

Security

You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right.

Demo

Below curl command demonstrates how to get all groups:

curl -u admin:admin http://localhost:8810/rest/groups

Access group by id

Syntax

Group can be accessed by id using http GET method through below url:

http://localhost:8810/rest/groups/<group id>

The response is of mime type application/xml and the content is XML representation of the group.

Security

You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right.

Demo

Below curl command demonstrates how to get group of id 1:

curl -u admin:admin http://localhost:8810/rest/groups/1

Update group

Syntax

Group can be updated by posting xml representation of the group to below url:

http://localhost:8810/rest/groups

Normally you do not need to create the XML from scratch: you may retrieve XML representation of the group using http GET method, 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 group id being updated.

Security

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

Demo

We will use curl to demonstrate how to modify description of group developer:

  1. Get id of group developer with id service

    curl http://localhost/rest/ids?group_name=developer

    Assume returned id is 1.

  2. Retrieve xml representation of group developer into a temp file using below command:

    curl -u admin:admin http://localhost:8810/rest/groups/1 > tempfile.xml
  3. Edit tempfile.xml and change description element to desired value (or add the description element if it does not already exist).

  4. Post back modified content using below command:

    curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/groups

Create group

Syntax

Group can be created by posting XML representation of the group to below url:

http://localhost:8810/rest/groups

Please note that the posted XML should NOT contain the id element; otherwise, QuickBuild will treat the post as an updating to the group with that id.

Normally you do not need to create the XML from scratch: you may retrieve XML representation of a templating group using http GET method, 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 the newly created group id.

Security

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

Demo

We will use curl to demonstrate how to create a new group tester by copying the existing group developer.

  1. Get id of group developer with id service

    curl http://localhost/rest/ids?group_name=developer

    Assume returned id is 1.

  2. Retrieve xml representation of group developer into a temp file using below command:

    curl -u admin:admin http://localhost:8810/rest/groups/1 > tempfile.xml
  3. Edit tempfile.xml , remove the id element, and change the name element to be tester

  4. Post back modified content using below command:

    curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/groups

Delete group

Syntax

Group can be deleted using http DELETE method through below url:

http://localhost:8810/rest/groups/<group id>

Here <group id> stands for id of the group to be deleted.

Security

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

Demo

Below curl command demonstrates how to delete the group with id 2:

curl -X DELETE -u admin:admin http://localhost:8810/rest/groups/2