Data Import
Import your Environments with the Golive Rest API using Postman

Introduction

With a tool like Postman, you can easily import data from a CSV file into Golive using the Rest API. Here is an example where we import a list of Environments into Golive Cloud.

Prerequisites

  • You have installed Postman (free version)
  • You have a working instance of Golive Cloud with admin rights
  • Applications, categories, attributes configuration is already done in Golive Cloud

Prepare your dataset

Let's assume we have existing configurations such as:
  • A list of Applications: eCommerce, Payment, ERP
  • A list of Categories: Dev1, Dev2, Integration1, Integration2
  • A set of Environment Attributes: OS, Database, Location
The first step is to prepare our CSV dataset containing the list of Environments with headers. Headers are important because they will be used by Postman as variable in our requests:
1
applicationName,categoryName,envUrl,os,database,location
2
eCommerce,Dev1,http://dev1.ecom.apwide.com,windows,mysql,Germany
3
eCommerce,Dev2,http://dev2.ecom.apwide.com,windows,postgres,Switzerland
4
Payment,Integration1,http://int1.pay.apwide.com,linux,oracle,Germany
5
ERP,Integration2,http://int2.erp.apwide.com,windows,postgres,France
Copied!
Small trick here, don't use "url" as header name for the environment URL attribute, otherwise Postman will use it as the URL to call during the import.

Prepare a "Create Environment" HTTP request in Postman

In Postman, create a new collection named "Golive Cloud Import".
Inside the new collection, create a POST request named "Create Environments" and define the following URL: https://golive.apwide.net/api/environment
Use the following payload in the "Body" tab:
1
{
2
"application": {
3
"name": "{{applicationName}}"
4
},
5
"category": {
6
"name":"{{categoryName}}"
7
},
8
"environmentPermissionScheme": {
9
"id": 2
10
},
11
"url": "{{envUrl}}",
12
"attributes": {
13
"OS": {"value":"{{os}}"},
14
"Database": {"value":"{{database}}"},
15
"Location": {"value":"{{location}}"}
16
}
17
}
Copied!
You can find the CSV headers used as placeholders where we want to fill values of our environment payload: {{applicationName}}, {{categoryName}}, etc.
If you have static information, such as environmentPermissionScheme in our example, you don't need to get values from CSV, just hardcode the value in your payload.
Your Postman configuration should look like this:
Postman POST Request Configuration

Authorize your HTTP request

To talk to the Golive Rest API, you need to be authorized. Generate an API token in Golive Cloud and copy-paste it as an api-key header on the Auth tab of your Collection, so that all your requests can inherit it:
Postman Collection Authentication

Run your data import

The last step to do is running our HTTP request using the CSV file as input. Click on "File > New Runner Tab" in Postman, drag-and-drop your "Create Environments" request and select your CSV file.
Postman Runner Configuration
When you're ready, click on Run Golive Cloud Import and if everything went fine, you should see your "Create environment" requests executed with a 200 HTTP status:
Postman Runner Execution Logs
The approach is the same to import Applications, Categories, Attributes, etc. Pick the endpoint you want to use from our Rest API , prepare your CSV, run your execution.

Questions?

We are happy to assist you with your data import. Don't hesitate to contact us if you have any questions.