This article will try to explain DevOps “branching” & “merging” using dashboard API calls.

(blue star) Before we begin we need…

  1. A dashboard that has some content targeted as needing “development” or changed in some way

  2. Postman - a free utility for running API calls.

(blue star) Dashboard

Currently, we need to “enable” Organisations in the dashboard repository. This article assumes this has been done.

(blue star) We also need some existing content that we are going to branch to a new Organisation

In my example dashboard I have some Artist categories that are all built against a single data source that are in need of a revamp. I need to find the ID of the data connection.

(blue star) In dashboard configuration → Data Connections, hover over that data connection that you want to export and make a note of the Data Source ID (blue star)

Alternatively, simply double click on a data source, the Data Source ID is shown in the top right…

image-20241031-124826.png

We have noted the Data Connection ID of the content we want to edit.

Appreciate that if we wanted to do the next steps manually we could but we want to create a repeatable process via the API.

Postman

Postman is a free utility that works with API calls. You can download & install or use the online version. Register and you’re away.

Our dashboard contains an API which we will utilise.

We will be creating a structure in Postman that will end up looking like this:

Postman Devops.png

(blue star) Start Postman

We have a successfully created a collection and set it’s authentication and added some variables. Now we need to create some Postman Requests.

Create Postman Requests

Create Branch

We will need to create 4 postman requests within the folder “Create Branch”.

Postman Create Branch Requests.png

  1. Authenicate-GetToken

Test by clicking the Send button (Top-Right) - this needs to respond with a status code of 200 and show the returned token.

  1. Export Main Data Connection

  2. Create Branch-Org

  3. Import Exported DC to Branch

Execute each one of the Create Branch requests in turn.

Then check you dashboard has a NEW_BRANCH with the exported content.

You may need to re-apply the password to the imported Data Connection.


At this point you would now go to the newly imported branch content and make some changes, like editing charts, create new categories and charts etc. Keep the changes simple and make a note of what you did.

Once done we are ready to “Merge” the changes back into the Main “parent“


Merge Branch

We will need to create 3 postman requests within the folder “Merge Branch”.

image-20241031-165053.png

  1. Get Branch DC ID

  2. Export Branch DC

  3. Export Branch DC

Execute each one of the Merge Branch requests in turn.

Now, check you dashboard has the “updated” content in the “main” or top level organisation.

Delete Branch

At this point it would be typical to describe the steps to remove or delete the branch we created BUT…..

There is an ENHANCEMENT on the horizon to Delete an Organisation. It employs the use of “cascading deletes” which will ensure that all dependant objects “downstream” are deleted first, making the steps below obsolete.

Deletion of an organisation requires the use of recursion.

  1. Delete all charts - Get all chart id’s and recursively delete.

  2. Delete all Category Objects

  3. Delete all Categories

  4. Delete all Data Connection Objects (Columns)

  5. Delete All Data Connections

  6. Delete the branch

(blue star) Below is an export of all the folders and requests from above. Simply download and Import into Postman, set the variables and give it a whirl.

(blue star) Related articles

Check out the article on creating N number of users in a dashboard using just 2 postman requests that are employed as part of a Postman Flow

Adding Users to a Dashboard with Postman Flows - pi Documentation - Confluence