Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Matillion REST API Returns all Jobs

We are attempting to get the our job scheduler working with the REST API. We fire the following curl command to start the job:

curl -u ec2-user:<pwd> -X POST "<server ip address>/rest/v0/tasks?groupName=Data%20Product&projectName=Forecasting%20Hub&versionName=default&environmentName=QA&jobName=o_fhub_Batch_Load"

which works and returns json containing the job id. When we run the following curl command to get the status of the running job, we get a list of all jobs that have been run:

curl -u ec2-user:<password> "<ip address>/rest/v0/tasks/<job id>"

Is this normal as I would expect only the json for the running job to be returned. We are using the following version of Matillion.

Version: 1.35.7 (build 200)AMI Version: 1.35.7

Also should we be using V1 API? It gives an error when we run the same command with V1.

Thanks

2 Community Answers

Matillion Agent  

Kalyan Arangam —

Hi Stephen,

I’ve tested it and am unable to reproduce your issue. You are right in that you should only receive the JSON for the requested job.

The following URL will return a list of tasks that have already run -

http://10.12.2.93/rest/v0/tasks/?running=false

As you can see, we return that detail only when you explicitly send running=false as parameter.

Coming to API V1 vs V0, we do not have any plans to deprecate v0 in the near future. However below is the command to launch a task in V1 API.
V1 API examples below -

+ Run job +
curl -X POST -u user:password http://10.12.12.12/rest/v1/group/name/<groupname>/project/name/<projname>/version/name/<versionname>/job/name/<jobname>/run?environmentName=<envname>

+ List Running tasks +
curl -X GET user:password “http://10.12.12.12/rest/v1/group/name/<groupname>/project/name/<projname>/task/running”

+ Cancel task +
curl -X POST user:password “http://10.12.12.12/rest/v1/group/name/<groupname>/project/name/<projname>/task/id/123456/cancel”

Hope that helps.

Best
Kalyan


stephen miller —

Thanks for the reply. You are correct about the job list. I took another look and the json has an id column for the orchestration job id and sub ids for the transformation jobs in the orchestration job so that is fine. Since this is new development, I will try the V1 API just to be using the latest. Thanks again!

Post Your Community Answer

To add an answer please login