Import Configuration Files into Alumio with API

Table of Contents

  • Introduction
  • Export and Import Files to Alumio
  • Troubleshooting
  • Error message: No route found for …
  • Error message: A configuration with this identifier already exists. \n Please enter a unique value for the identifier

Purpose

This article explains how you can synchronize configurations between Alumio environments. You can export the connections files in JSON format from one environment and import them to another Alumio environment.

Introduction

By exporting the Alumio configurations in JSON format, you can move those configurations to other Alumio environments using the Alumio API. For example, moving configurations from the sandbox environment to the production environment.

Export and Import Files to Alumio

To import the file back to Alumio you need to:

  1. Export the connection from Alumio.

  2. Open the environment you want to import the file to.

  3. Go Settings → Info, and copy the API URL Ex: “api.sandbox.demo.alumio.com”.

  4. Next, paste it into Postman: New request → post → paste the link api.sandbox.demo.alumio.com followed by the endpoint api/v1/di/configurations, so it looks like api.sandbox.demo.alumio.com/api/v1/di/configurations.

  5. Choose body → raw → and in “text” section select JSON → paste the data from the .ndjson file that you exported earlier from Alumio into the “body” field.

  6. The next step is to generate API keys in Alumio and use them for authorization in Postman.

Please refer to this guide to generate API keys.

  1. Finally, hit “Send”. It should import the file to Alumio.

Note: It is also possible to update existing configurations using a ‘PUT’ request.

Troubleshooting

Error message: No route found for …

{
"status": 500,
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"detail": "No route found for \"POST /vi/di/configurations\" (from \"http://api.sandbox.demo.alumio.com/vi/di/configurations\")"
}

This indicates that there is something incorrect with the payload. In some cases, the ‘description’ field has a NULL value. However, this API endpoint does not accept this value. Solve this by changing the value from NULL to an empty string (“”).

Error message: A configuration with this identifier already exists. \n Please enter a unique value for the identifier

{
"status": 500,
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Internal Server Error",
"detail": "A configuration with this identifier already exists. \n Please enter a unique value for the identifier"
}

It obviously means that you have already imported this file and it already exists.