QuickBuild2 Documentation
|
Get all memberships in the systemSyntaxMemberships in the system can be accessed using http GET method through below url: http://localhost:8810/rest/memberships
The response is of mime type application/xml and the content is XML representation of all memberships in the system. SecurityYou will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. DemoBelow curl command demonstrates how to get all memberships: curl -u admin:admin http://localhost:8810/rest/memberships
Access membership by idSyntaxMembership can be accessed by id using http GET method through below url: http://localhost:8810/rest/memberships/<membership id>
The response is of mime type application/xml and the content is XML representation of the membership. SecurityYou will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. DemoBelow curl command demonstrates how to get membership of id 1: curl -u admin:admin http://localhost:8810/rest/memberships/1
Access memberships of a particular userSyntaxMemberships of particular user can be accessed using http GET method through below url: http://localhost:8810/rest/memberships?user_id=<user id>
The response is of mime type application/xml and the content is XML representation of all memberships of specified user. SecurityYou will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. DemoBelow curl command demonstrates how to get memberships of user with id 2: curl -u admin:admin http://localhost:8810/rest/memberships?user_id=2
Access memberships of a particular groupSyntaxMemberships of particular group can be accessed using http GET method through below url: http://localhost:8810/rest/memberships?group_id=<group id>
The response is of mime type application/xml and the content is XML representation of all memberships of specified group. SecurityYou will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. DemoBelow curl command demonstrates how to get memberships of group with id 1: curl -u admin:admin http://localhost:8810/rest/memberships?group_id=1
Update membershipSyntaxMembership can be updated by posting xml representation of the membership to below url: http://localhost:8810/rest/memberships
Normally you do not need to create the XML from scratch: you may retrieve XML representation of the membership using http GET method, modify certain parts of the XML and post back to above url. SecurityYou will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. DemoWe will use curl to demonstrate how to move user robin from developer group to tester group:
Create membershipSyntaxMembership can be created by posting XML representation of the membership to below url: http://localhost:8810/rest/memberships
A sample membership XML representation is like below: <com.pmease.quickbuild.model.Membership> <!-- id of associated user of this membership. --> <user>2</user> <!-- id of associated group of this membership. --> <group>1</group> </com.pmease.quickbuild.model.Membership> The response is of mime type text/plain and the content is string representation of the newly created membership id. SecurityYou will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. DemoWe will use curl to demonstrate how to add user robin (assume id is 2) to group tester (assume the id is 3).
Delete membershipSyntaxMembership can be deleted using http DELETE method through below url: http://localhost:8810/rest/memberships/<membership id>
Here <membership id> stands for id of the membership to be deleted. SecurityYou will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. DemoBelow curl command demonstrates how to remove user robin (assume id is 2) from group tester (assume the id is 3).
|