Skip to main content
Version: QB12

Interact with Group Share

info

Group share is the object used to control dashboard sharing with groups

Get all group shares in the system

Syntax

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

http://localhost:8810/rest/group_shares

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

Security

You will need to use http BASIC authentication to login as administrator.

Demo

Below curl command demonstrates how to get all group shares:

curl -u admin:admin http://localhost:8810/rest/group_shares
info

group share with no group information means to share with everyone

Access group share by id

Syntax

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

http://localhost:8810/rest/group_shares/<group_share id>

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

Security

You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share.

Demo

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

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

Access group shares of a particular dashboard

Syntax

Group shares of particular dashboard can be accessed using http GET method through below url:

http://localhost:8810/rest/group_shares?dashboard_id=<dashboard id>

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

Security

You will need to use http BASIC authentication to login as administrator or the user owning queried dashboard.

Demo

Below curl command demonstrates how to get group shares of dashboard with id 2:

curl -u admin:admin http://localhost:8810/rest/group_shares?dashboard_id=2

Access group shares of a particular group

Syntax

Group shares of particular group can be accessed using http GET method through below url:

http://localhost:8810/rest/group_shares?group_id=<group id>

Here <group id> represents id of the group to query group share information for. Particularly, use id 0 to query group

shares targeting everyone.

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

Security

You will need to use http BASIC authentication to login as administrator.

Demo

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

curl -u admin:admin http://localhost:8810/rest/group_shares?group_id=1

Update group share

Syntax

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

http://localhost:8810/rest/group_shares

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.

Security

You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share.

Demo

We will use curl to demonstrate how to share dashboard project1 with group1 instead of group2:

  1. Assume id of dashboard project1 is 2 , id of group group1 is 1 , and id of group group2 is 2 . Ids of these entities can be accessed using id service.

  2. Run below command to get group shares of dashboard project1 :

    curl -u admin:admin http://localhost:8810/rest/group_shares?dashboard_id=2
  3. Analyze response of above command to find out the group share with group id 1 . Save xml snippet of found group share to a temp file, say tempfile.xml.

  4. Modify tempfile.xml and change the group element to use value of 2.

  5. Post content of tempfile.xml back to QuickBuild using below command:

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

Create group share

Syntax

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

http://localhost:8810/rest/group_shares

A sample group share XML representation is like below:

<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 dashboard of this group share. -->
<dashboard>1</dashboard>
</com.pmease.quickbuild.model.GroupShare>

The response is of mime type text/plain and the content is string representation of the newly created group share id.

Security

You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share.

Demo

We will use curl to demonstrate how to share dashboard project1 (assume id is 2 ) with group group1 (assume the id is 3).

  1. Save below content into file tempfile.xml :

    <com.pmease.quickbuild.model.GroupShare>
    <dashboard>2</dashboard>
    <group>3</group>
    </com.pmease.quickbuild.model.GroupShare>
  2. Post content of tempfile.xml to QuickBuild using below command:

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

Delete group share

Syntax

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

http://localhost:8810/rest/group_shares/<group share id>

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

Security

You will need to use http BASIC authentication to login as administrator or user owning dashboard of the group share.

Demo

Below curl command demonstrates how to remove group group1 (assume id is 3 ) from share list of dashboard project1 (assume the id is 2).

  1. Get group shares of dashboard project1 with below command:

    curl -u admin:admin http://localhost:8810/rest/group_shares?dashboard_id=2
  2. 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.

  3. Delete the found group share with below command:

    curl -X DELETE -u admin:admin http://localhost:8810/rest/group_shares/100