API v1 - Versions

Overview

Matillion's versioning system creates a copy of all of the jobs in your current project at that point in time. You must always have a default version and thus you will always have at least 1 Version in a Project. It is possible to create a Version from your default Version, or any other Version.

Here we look at how users can interact with their Project's Versions via the Matillion v1 API. The below examples use cURL for the sake of an example and generally require the user to fill in details based on their own resource names such as in <GroupName>, <ProjectName> and <VersionName>.


Exploring Versions

Listing Versions

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/"


Exploring using Version Names

Listing Versions will retrieve the names of all Versions in a Project. These names can then be used to a specify a particular Version in the API.

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>"

e.g.

curl -X GET -u api-user:password "https://12.34.5.67:8910/rest/v1/group/name/Test/project/name/MyProj/version/name/default"

Listing Jobs in Versions

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>/job"


Orchestration Jobs Only

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>/orchestration"


Transformation Jobs Only

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>/transformation"



Exporting Versions

curl -X GET -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>/Export"



Deleting Versions

curl -X POST -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>/delete"

 

Creating New Versions

curl -X POST -u api-user:password "https://<InstanceAddress>/rest/v1/group/name/<GroupName>/project/name/<ProjectName>/version/name/<VersionName>" -H "Content-Type: application/json" --data-binary @versiondetails.json
Where versiondetails.json is a JSON format input describing the new version to be made:
{
  "newVersionName" : "name",
  "newVersionDescription" : "arbitrarydescription",
  "newVersionIsLocked" : true/false
}

Note that newVersionName and newVersionDescription properties are strings and newVersionIsLocked is a boolean value.

Below is an example of this but including the JSON data into the cURL command itself.

curl -X POST -H 'Content-Type:application/json' --data '{"newVersionName":"stringnew","newVersionDescription":"newver","newVersionIsLocked":false}' http://12.34.5.67:8910/rest/v1/group/name/Test/project/name/Demo/version/name/default/create/