changes.
| | {info}Group share is the object used to control dashboard sharing with groups{info} |
| {info}Group share with no group defined means sharing with everyone{info} |
| |
| h1. Get all group shares in the system |
| |
| h2. Syntax |
| | Memberships in the system can be accessed using http GET method through below url: |
| {code}http://localhost:8810/rest/memberships{code} |
| The response is of mime type _application/xml_ and the content is XML representation of all memberships in the system. |
| | Group shares in the system can be accessed using http GET method through below url: |
| {code}http://localhost:8810/rest/group_shares{code} |
| The response is of mime type _application/xml_ and the content is XML representation of all group shares in the system. |
| |
| h2. Security |
| | You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. |
| | You will need to use http BASIC authentication to login as administrator. |
| |
| h2. Demo |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to get all memberships: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships{code} |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to get all group shares: |
| {code}curl -u admin:admin http://localhost:8810/rest/group_shares{code} |
| |
| | h1. Access membership by id |
| | h1. Access group share by id |
| |
| h2. Syntax |
| | Membership can be accessed by id using http GET method through below url: |
| {code}http://localhost:8810/rest/memberships/<membership id>{code} |
| The response is of mime type _application/xml_ and the content is XML representation of the membership. |
| | Group share can be accessed by id using http GET method through below url: |
| {code}http://localhost:8810/rest/group_shares/<group_share id>{code} |
| The response is of mime type _application/xml_ and the content is XML representation of the group share. |
| |
| h2. Security |
| | You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. |
| | You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share. |
| |
| h2. Demo |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to get membership of id _1_: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships/1{code} |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to get group share of id _1_: |
| {code}curl -u admin:admin http://localhost:8810/rest/group_shares/1{code} |
| |
| | h1. Access memberships of a particular user |
| | h1. Update group share |
| |
| h2. Syntax |
| | Memberships of particular user can be accessed using http GET method through below url: |
| {code}http://localhost:8810/rest/memberships?user_id=<user id>{code} |
| The response is of mime type _application/xml_ and the content is XML representation of all memberships of specified user. |
| | Group share can be updated by posting xml representation of the group share to below url: |
| {code}http://localhost:8810/rest/group_shares{code} |
| Normally you do not need to create the XML from scratch: you may retrieve XML representation of the group share 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 share id being updated. |
| |
| h2. Security |
| | You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. |
| | You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share. |
| |
| | h2. Demo |
| Below [curl|http://curl.haxx.se/] command demonstrates how to get memberships of user with id _2_: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships?user_id=2{code} |
| | h1. Create group share |
| |
| | h1. Access memberships of a particular group |
| |
| h2. Syntax |
| | Memberships of particular group can be accessed using http GET method through below url: |
| {code}http://localhost:8810/rest/memberships?group_id=<group id>{code} |
| The response is of mime type _application/xml_ and the content is XML representation of all memberships of specified group. |
| |
| h2. Security |
| You will need to use http BASIC authentication to login as authorized QuickBuild user if the anonymous does not have adminstrative right. |
| |
| h2. Demo |
| Below [curl|http://curl.haxx.se/] command demonstrates how to get memberships of group with id _1_: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships?group_id=1{code} |
| |
| h1. Update membership |
| |
| h2. Syntax |
| Membership can be updated by posting xml representation of the membership to below url: |
| {code}http://localhost:8810/rest/memberships{code} |
| 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. |
| The response is of mime type _text/plain_ and the content is string representation of the membership id being updated. |
| |
| h2. Security |
| You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. |
| |
| h2. Demo |
| We will use [curl|http://curl.haxx.se/] to demonstrate how to move user _robin_ from _developer_ group to _tester_ group: |
| # Assume id of user _robin_ is _2_, id of group _developer_ is _1_, and id of group _tester_ is _2_. Ids of these entities can be accessed using [id service|retrieve object identifier]. |
| # Run below command to get memberships of user _robin_: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships?user_id=2{code} |
| # Analyze response of above command to find out the membership with group id _1_. Save xml snippet of found membership to a temp file, say _tempfile.xml_. |
| # Modify _tempfile.xml_ and change the _group_ element to use value of _2_. |
| # Post content of _tempfile.xml_ back to QuickBuild using below command: |
| {code}curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/memberships{code} |
| |
| h1. Create membership |
| |
| h2. Syntax |
| Membership can be created by posting XML representation of the membership to below url: |
| {code}http://localhost:8810/rest/memberships{code} |
| A sample membership XML representation is like below: |
| | Group share can be created by posting XML representation of the group share to below url: |
| {code}http://localhost:8810/rest/group_shares{code} |
| A sample group share XML representation is like below: |
| {code} |
| | <com.pmease.quickbuild.model.Membership> |
| <!-- id of associated user of this membership. --> |
| <user>2</user> |
| | <com.pmease.quickbuild.model.GroupShare> |
| <!-- id of associated group of this group share. If group element does not exist, QuickBuild will share the dashboard with everyone --> |
| <group>2</group> |
| |
| | <!-- id of associated group of this membership. --> |
| <group>1</group> |
| </com.pmease.quickbuild.model.Membership> |
| | <!-- id of associated group of this group share. --> |
| <dashboard>1</dashboard> |
| </com.pmease.quickbuild.model.GroupShare> |
| {code} |
| | The response is of mime type _text/plain_ and the content is string representation of the newly created membership id. |
| | The response is of mime type _text/plain_ and the content is string representation of the newly created group share id. |
| |
| h2. Security |
| | You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. |
| | You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share. |
| |
| h2. Demo |
| | We will use [curl|http://curl.haxx.se/] to demonstrate how to add user _robin_ (assume id is _2_) to group _tester_ (assume the id is _3_). |
| | We will use [curl|http://curl.haxx.se/] to demonstrate how to share dashboard _project1_ (assume id is _2_) with group _group1_ (assume the id is _3_). |
| # Save below content into file _tempfile.xml_: |
| {code} |
| | <com.pmease.quickbuild.model.Membership> |
| <user>2</user> |
| | <com.pmease.quickbuild.model.GroupShare> |
| <dashboard>2</dashboard> |
| <group>3</group> |
| | </com.pmease.quickbuild.model.Membership> |
| | </com.pmease.quickbuild.model.GroupShare> |
| {code} |
| # Post content of _tempfile.xml_ to QuickBuild using below command: |
| | {code}curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/memberships{code} |
| | {code}curl -X POST -u admin:admin -d@tempfile.xml http://localhost:8810/rest/group_shares{code} |
| |
| | h1. Delete membership |
| | h1. Delete group share |
| |
| h2. Syntax |
| | Membership can be deleted using http DELETE method through below url: |
| {code}http://localhost:8810/rest/memberships/<membership id>{code} |
| Here _<membership id>_ stands for id of the membership to be deleted. |
| | Group share can be deleted using http DELETE method through below url: |
| {code}http://localhost:8810/rest/group_shares/<group share id>{code} |
| Here _<group share id>_ stands for id of the group share to be deleted. |
| |
| h2. Security |
| | You will need to use http BASIC authentication to login as administrator if the anonymous does not have administrative right. |
| | You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share. |
| |
| h2. Demo |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to remove user _robin_ (assume id is _2_) from group _tester_ (assume the id is _3_). |
| # Get memberships of user _robin_ with below command: |
| {code}curl -u admin:admin http://localhost:8810/rest/memberships?user_id=2{code} |
| # Analyze response of above command to find out id of the membership associated with group id _3_, assume id of the found membership is _100_. |
| | Below [curl|http://curl.haxx.se/] command demonstrates how to remove group _group1_ (assume id is _3_) from share list of dashboard _project1_ (assume the id is _2_). |
| # Get group shares of dashboard _project1_ with below command: |
| {code}curl -u admin:admin http://localhost:8810/rest/group_shares?dashboard_id=2{code} |
| # Analyze response of above command to find out id of the group share associated with group id _3_, assume id of the found group share is _100_. |
| # Delete the found membership with below command: |
| | {code}curl -X DELETE -u admin:admin http://localhost:8810/rest/memberships/100{code} |
| | {code}curl -X DELETE -u admin:admin http://localhost:8810/rest/group_shares/100{code} |