Invoking Pipelines Programmatically

This guide covers using Terrene's API to invoke a pipeline

First acquire a token to Terrene's API:

post
Obtain Token

https://<tenant-id>.api.terrene.co/users/actions/login/obtain-token/
Obtain JWT to access Terrene's API
Request
Response
Body Parameters
email
required
string
Your email address
password
required
string
Your Password
200: OK
{
"user":{
// user attributes
},
"token":"<returned-JWT>"
}
curl 'https://<tenant-id>.api.terrene.co/users/actions/login/obtain-token/' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Referer: https://demo.app.terrene.co/users/actions/login' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-binary '{"email":"<email>","password":"<password>"}' --compressed

Replace <email>, <password>, and <tenant-id> with the appropriate values

Then make the following request with your token:

post
Invoke Pipeline

https://<tenant-id>.api.terrene.co/pipelines/:object_id/run/
Invokes a pipeline
Request
Response
Path Parameters
object_id
optional
string
The object_id of the pipeline
Headers
Authorization
optional
string
authorization header in the format "JWT <token>"
200: OK
{
"object_id": "8982a98b-7d4b-40b8-9d70-89747ce37b54",
"created_at": "2019-04-30T15:40:16.119588",
"updated_at": "2019-04-30T15:40:16.144890",
"name": "Running Untitled Pipeline",
"progress": 0,
"results": null,
"resources": [
{
"object_id": "62ff4a3d-01f8-4c10-b34c-b9ec96233677",
"created_at": "2019-04-26T15:41:32.038750",
"updated_at": "2019-04-30T15:38:58.062874",
"name": "Titanic Demo",
"description": "You can add a new description by clicking the \"Edit\" button",
"tags": null,
"permissions": [
{
"object_id": "2272f9a9-34d2-4bd2-970b-b62256525072",
"created_at": "2019-04-26T15:41:32.045855",
"updated_at": "2019-04-26T15:41:32.062140",
"resource": "62ff4a3d-01f8-4c10-b34c-b9ec96233677",
"user": "[email protected]",
"read": true,
"write": true,
"execute": true,
"allow": true,
"deny": false,
"write_access": {
}
}
],
"public": false,
"access_level": "Private",
"read_access": {
},
"write_access": {
},
"execute_access": {
},
"metadata": {
}
},
{
"object_id": "238674dc-be47-4437-904a-9514789e744f",
"created_at": "2019-03-22T16:41:07.389269",
"updated_at": "2019-04-30T15:38:56.196456",
"name": "Untitled Pipeline",
"description": "You can add a new description by clicking the \"Edit\" button",
"tags": null,
"permissions": [
{
"object_id": "675d1c46-59fe-4d4d-994c-db4a7216f386",
"created_at": "2019-03-22T16:41:07.395473",
"updated_at": "2019-03-22T16:41:07.409093",
"resource": "238674dc-be47-4437-904a-9514789e744f",
"user": "[email protected]",
"read": true,
"write": true,
"execute": true,
"allow": true,
"deny": false,
"write_access": {
}
}
],
"public": false,
"access_level": "Private",
"read_access": {
},
"write_access": {
},
"execute_access": {
},
"metadata": {
}
}
],
"initiator": "[email protected]",
"failed": false,
"running_time": 0
}
curl 'https://<tenant-id>.api.terrene.co/pipelines/<object_id>/run/' \
-X POST -H 'Accept: application/json, text/plain, */*' \
-H 'Authorization: JWT <token>' \
--compressed

Replace <token>, <object_id>, and <tenant-id> with the appropriate values