Flows Export/Import API
Etlworks flows can be exported and imported for archival purposes or for migration between tenants/instances.
Export API endpoint parameters
- PATH:
/rest/v1/flows/export?Authorization=Bearer%20{jwt_auth_token}&flows={list_of_flow_ids}
. - METHOD:
GET
. - QUERY PARAMETERS:
- Authorization: in
Bearer%20{jwt_auth_token}
format. Where{jwt_auth_token}
should be replaced with actual JWT token issued through Authentication API.Which tenant you are exporting from depends on the authorization token
{jwt_auth_token}
. - flows: can either be set to all, to export all flows, or a comma separate list of flow ids, for example 1,2,3.
- Authorization: in
Response
The response is a raw encrypted flow dump.
Response Codes
- 200 for success
- 401 and 403 for not authorized
- 500 for an internal error
Preview flows export dump file API endpoint parameters
- PATH:
/rest/v1/flows/import/preview
- METHOD:
POST
- HEADER:
- Authorization:
Bearer {jwt_auth_token}
format. Where should be replaced with actual JWT token issued through Authentication API.
- Authorization:
- REQUEST BODY: JSON object in the following Format:
-
{
"dump": "{contents_of_the_dump_file}"
}
-
- dump: raw encrypted flow dump returned by the Export API endpoint.
- REQUEST CONTENT TYPE:
application/json
.
Response
The response is a JSON object that describes contents of the flows export dump file in the following Format:
{
"graph": {highly nested object that describes how included abjects referenced by the included flows},
"flows": {
{id}: {
"id": {id},
"name": "{object name}",
"type": "{object type}",
"icon": "{object icon URL}",
"listener": false
}
},
"connections": {
{id}: {
"id": {id},
"name": "{object name}",
"type": "{object type}",
"icon": "{object icon URL}",
"listener": false
}
},
"formats": {
{id}: {
"id": {id},
"name": "{object name}",
"type": "{object type}",
"icon": "{object icon URL}",
"listener": false
}
},
"schedules": {
{id}: {
"id": {id},
"name": "{object name}",
"type": "{object type}",
"icon": "{object icon URL}",
"listener": false
}
},
"macros": {
{id}: {
"id": {id},
"name": "{object name}",
"type": "{object type}",
"icon": "{object icon URL}",
"listener": false
}
}
}
Response Codes
- 200 for success
- 400 for the not valid request body
- 401 for not authorized
- 403 for forbidden
- 500 for an internal error
Import API endpoint parameters
- PATH:
/rest/v1/flows/import
- METHOD:
POST
- HEADER:
- Authorization:
Bearer {jwt_auth_token}
format. Where should be replaced with actual JWT token issued through Authentication API.Which tenant you are importing to depends on the authorization token
{jwt_auth_token}
.
- Authorization:
- REQUEST BODY: JSON object in the following Format:
-
{
"dump": "{contents_of_the_dump_file}",
"flowsToImport": [1,2,3],
"collisionPolicy": "Add",
"extraTags": ["Some optional extra tag 1", "Some optional extra tag N"],
"importSchedules": false,
"message": "Some optional Save message"
}
-
- dump: raw encrypted flow dump returned by the Export API endpoint.
- flowsToImport: an array of flow ID to import from the provided dump file.
- collisionPolicy: collision policy determines import behavior in case import destination already has object with the same name:
Add
: will create new Flows, Formats, Connections, Macros, and Listeners. The following rules are used when creating the Flow's artifacts:- When you import a Flow, Etlworks creates new Flows, Connections, and Formats with the same parameters as the original Flows, Connections, and Formats but adds the suffix (timestamp). For example: Create new FW xml file [05-17-2017_14-52-41]. It makes sense to change all generated names to something else — for example, removing the (timestamp) suffix and modifying the name. Ensure that the new name is unique; otherwise, Etlworks will not allow you to change it.
- If a Flow uses the HTTP Listener as a source (FROM) or destination (TO), the original endpoint will be updated as well (since there can't be two endpoints with the same path). Make sure that you change the URL Pattern before scheduling the new Flow. Once again, the URL Pattern must be globally unique across all the Listeners.
Replace
: will replace existing Flows, Connections, Formats, Macros, and Listeners if the name and the type are the same as in the Flow to import.Keep
: will keep existing Flows, Connections, Formats, Macros, and Listeners if the name and the type are the same as in the Flow to import.Keep All, Replace Flows and Macros
: will replace existing Flows, and Macros and keep existing Connections, Formats, and Listeners. Use this collision policy if you are migrating flows from one environment to another and prefer to keep existing connections and formats in the destination environment.
- extraTags: an array of optional tags that will be added to all object imported as a result of this API call.
- importSchedules: boolean flag true or false that specifies whether or not schedules for imported flows should be imported as well.
- message: optional save message that will be added to all object imported as a result of this API call.
- REQUEST CONTENT TYPE:
application/json
.
Response
The response is a JSON object that describes import results in the following Format:
{
"formats": [{
"id": {id},
"name": "{imported name}",
"icon": "{icon URL}",
"status": "{import status}",
"exception": "{possible exception message}"
}],
"connections": [{
"id": {id},
"name": "{imported name}",
"icon": "{icon URL}",
"status": "{import status}",
"exception": "{possible exception message}"
}],
"flows": [{
"id": {id},
"name": "{imported name}",
"icon": "{icon URL}",
"status": "{import status}",
"exception": "{possible exception message}"
}],
"schedules": [{
"id": {id},
"name": "{imported name}",
"icon": "{icon URL}",
"status": "{import status}",
"exception": "{possible exception message}"
}],
"macros": [{
"id": {id},
"name": "{imported name}",
"icon": "{icon URL}",
"status": "{import status}",
"exception": "{possible exception message}"
}],
"failed": false,
"rolledBack": false
}
Response Codes
- 200 for success
- 400 for the not valid request body
- 401 for not authorized
- 403 for forbidden
- 500 for an internal error
Comments
0 comments
Please sign in to leave a comment.