Link Search Menu Expand Document

Jobs

A job is an arbitrary task with some stored state, pertaining to the governing workspace. Typically, jobs are orchestrated by pipeline operations, but can also represent tasks for the user to complete.


Objects

Job

Path Type Format Description
id String Version 4 UUID The job ID
created String ISO 8601 timestamp The instant at which the job was created
type String Job Type The descriptor for the process undertaken by the job
exitCode Integer Process exit status The job exit code
status String Job Status The job status
startTime String ISO 8601 timestamp The instant at which the job run started
endTime String ISO 8601 timestamp The instant at which the job run ended
{
  "id" : "9a346943-d351-434f-9fed-c612ba5d2f7a",
  "created" : "2022-01-21T09:29:26.277198",
  "type" : "PIPELINE_RUN",
  "exitCode" : 0,
  "status" : "COMPLETE",
  "startTime" : "2022-01-21T09:29:40.94",
  "endTime" : "2022-01-21T09:30:28.425",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0",
      "type" : "GET"
    }
  }
}

Formats

Job Status

String

Value Description
QUEUED The job is queued
RUNNING The job is running
COMPLETE The job finished with no errors
ERROR The job finished with errors
STOPPED The job timed out or was manually stopped

Job Type

String

Value Description
WORKSPACE_INIT A system task to create a Meltano project in a workspace repository - automatically run when a workspace is created
PIPELINE_CONFIG A system task to configure the Meltano project and publish datasets with reference to a pipeline - automatically run when a pipeline is created, or a pipeline with a status of FAILED is updated
PIPELINE_VERFIY A system task to isplay and test the configuration of a pipeline
PIPELINE_RUN A system task to run a pipeline to load data into the workspace default datastore, or some other destination external to the platform - manually run by the user or automatically run on the defined schedule
PROFILE_COLLABORATE A user task to send an invitation
PROFILE_IMPORT A user task to create a pipeline

Requests


View all running or completed jobs for a workspace

GET

/api/workspaces/{workspace-id}/jobs

Returns all running or completed jobs for the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/workspaces/a49115d3-9970-42b2-8db2-3fff9ff724a0/jobs' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/workspaces/a49115d3-9970-42b2-8db2-3fff9ff724a0/jobs"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Job collection with HAL links.

{
  "_embedded" : {
    "jobs" : [ {
      "id" : "890c4674-b861-466f-8730-3c8a7bec612a",
      "created" : "2022-01-21T09:26:00.615273",
      "type" : "PROFILE_IMPORT",
      "status" : "QUEUED",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/890c4674-b861-466f-8730-3c8a7bec612a"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/890c4674-b861-466f-8730-3c8a7bec612a",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/890c4674-b861-466f-8730-3c8a7bec612a/logs?sequence=0",
          "type" : "GET"
        },
        "withdraw job" : {
          "href" : "https://catalog.matatika.com/api/jobs/890c4674-b861-466f-8730-3c8a7bec612a/stopped",
          "type" : "PUT"
        }
      }
    }, {
      "id" : "836c2097-5250-48ec-ae08-456f9a833ee6",
      "created" : "2022-01-21T09:26:00.615281",
      "type" : "PROFILE_COLLABORATE",
      "status" : "QUEUED",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/836c2097-5250-48ec-ae08-456f9a833ee6"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/836c2097-5250-48ec-ae08-456f9a833ee6",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/836c2097-5250-48ec-ae08-456f9a833ee6/logs?sequence=0",
          "type" : "GET"
        },
        "withdraw job" : {
          "href" : "https://catalog.matatika.com/api/jobs/836c2097-5250-48ec-ae08-456f9a833ee6/stopped",
          "type" : "PUT"
        }
      }
    }, {
      "id" : "43436a2a-44c4-4e83-9324-44e43d909f8f",
      "created" : "2022-01-21T09:26:02.604696",
      "type" : "WORKSPACE_INIT",
      "exitCode" : 0,
      "status" : "COMPLETE",
      "startTime" : "2022-01-21T09:26:54.317",
      "endTime" : "2022-01-21T09:26:57.73",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/43436a2a-44c4-4e83-9324-44e43d909f8f"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/43436a2a-44c4-4e83-9324-44e43d909f8f",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/43436a2a-44c4-4e83-9324-44e43d909f8f/logs?sequence=0",
          "type" : "GET"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/a49115d3-9970-42b2-8db2-3fff9ff724a0/jobs?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 3,
    "totalPages" : 1,
    "number" : 0
  }
}

View all running or completed jobs for a pipeline

GET

/api/pipelines/{pipeline-id}/jobs

Returns all running or completed jobs for the pipeline {pipeline-id}.

Prerequisites

  • Pipeline {pipeline-id} must exist

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/pipelines/fcc06fcf-0b53-439d-8e7b-6a3c1be6f431/jobs' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/pipelines/fcc06fcf-0b53-439d-8e7b-6a3c1be6f431/jobs"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Job collection with HAL links.

{
  "_embedded" : {
    "jobs" : [ {
      "id" : "9a346943-d351-434f-9fed-c612ba5d2f7a",
      "created" : "2022-01-21T09:29:26.277198",
      "type" : "PIPELINE_RUN",
      "status" : "QUEUED",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0",
          "type" : "GET"
        },
        "withdraw job" : {
          "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/stopped",
          "type" : "PUT"
        }
      }
    }, {
      "id" : "f31a282d-e18e-4ce3-8f68-17688210a570",
      "created" : "2022-01-21T09:28:31.957998",
      "type" : "PIPELINE_VERIFY",
      "exitCode" : 0,
      "status" : "COMPLETE",
      "startTime" : "2022-01-21T09:28:47.248",
      "endTime" : "2022-01-21T09:29:19.37",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/f31a282d-e18e-4ce3-8f68-17688210a570"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/f31a282d-e18e-4ce3-8f68-17688210a570",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/f31a282d-e18e-4ce3-8f68-17688210a570/logs?sequence=0",
          "type" : "GET"
        }
      }
    }, {
      "id" : "eb79e135-a554-44e3-ac31-b52c77793ed4",
      "created" : "2022-01-21T09:27:06.031474",
      "type" : "PIPELINE_CONFIG",
      "exitCode" : 0,
      "status" : "COMPLETE",
      "startTime" : "2022-01-21T09:27:21.28",
      "endTime" : "2022-01-21T09:28:25.661",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/jobs/eb79e135-a554-44e3-ac31-b52c77793ed4"
        },
        "delete job" : {
          "href" : "https://catalog.matatika.com/api/jobs/eb79e135-a554-44e3-ac31-b52c77793ed4",
          "type" : "DELETE"
        },
        "logs" : {
          "href" : "https://catalog.matatika.com/api/jobs/eb79e135-a554-44e3-ac31-b52c77793ed4/logs?sequence=0",
          "type" : "GET"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/pipelines/fcc06fcf-0b53-439d-8e7b-6a3c1be6f431/jobs?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 3,
    "totalPages" : 1,
    "number" : 0
  }
}

View a job

GET

/api/jobs/{job-id}

Returns the job {job-id}.

Prerequisites

  • Job {job-id} must exist

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Job with HAL links.

{
  "id" : "9a346943-d351-434f-9fed-c612ba5d2f7a",
  "created" : "2022-01-21T09:29:26.277198",
  "type" : "PIPELINE_RUN",
  "exitCode" : 0,
  "status" : "COMPLETE",
  "startTime" : "2022-01-21T09:29:40.94",
  "endTime" : "2022-01-21T09:30:28.425",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0",
      "type" : "GET"
    }
  }
}

View the logs of a job

GET

/api/jobs/{job-id}/logs?sequence={sequence}

Returns the logs of the job {job-id}.

Prerequisites

  • Job {job-id} must exist

Request

Query Parameters

Query Parameter Format Default Value Description
sequence Unsigned integer 0 The line number in the logs to read from

Headers

Accept
Media Type(s) Description
text/plain */* Sets the response content type format to plain text
application/stream+json application/x-ndjson Sets the response content type format to NDJSON

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0' -i -X GET \
    -H 'Accept: application/x-ndjson' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

  • 200: The job logs in the format specified by associated request Accept header
{
  "jobId" : "9a346943-d351-434f-9fed-c612ba5d2f7a",
  "level" : "INFO",
  "message" : "Begin: 9a346943-d351-434f-9fed-c612ba5d2f7a",
  "sequence" : 1,
  "timestamp" : "2022-01-21T09:29:41.250Z"
}
  • 204: No response body provided.

Create a job from a pipeline

POST

/api/pipelines/{pipeline-id}/jobs

Creates a new job from the pipeline {pipeline-id}.

Prerequisites

  • Pipeline {pipeline-id} must exist and not already be running

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/pipelines/fcc06fcf-0b53-439d-8e7b-6a3c1be6f431/jobs' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/pipelines/fcc06fcf-0b53-439d-8e7b-6a3c1be6f431/jobs"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))

Response

201 Created

Job with HAL links.

{
  "id" : "9a346943-d351-434f-9fed-c612ba5d2f7a",
  "created" : "2022-01-21T09:29:26.277198",
  "type" : "PIPELINE_RUN",
  "status" : "QUEUED",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/logs?sequence=0",
      "type" : "GET"
    },
    "withdraw job" : {
      "href" : "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a/stopped",
      "type" : "PUT"
    }
  }
}

Stop a job

PUT

/api/jobs/{job-id}/stopped

Stops the execution of the job {job-id}.

Prerequisites

  • Job {job-id} must exist
  • Job {job-id} must have status RUNNING

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/jobs/a1953d81-4436-4d4c-b2ca-e6ebbccfa6b9/stopped' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/jobs/a1953d81-4436-4d4c-b2ca-e6ebbccfa6b9/stopped"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("PUT", url, headers=headers)

print(response.text.encode('utf8'))

Response

202 Accepted

Job stop acceptance message.

{
  "message" : "Job stop requested"
}

Delete a job

DELETE

/api/jobs/{job-id}

Deletes and stops the execution of the job {job-id}.

Prerequisites

  • Job {job-id} must exist

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a' -i -X DELETE \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com/api/jobs/9a346943-d351-434f-9fed-c612ba5d2f7a"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("DELETE", url, headers=headers)

print(response.text.encode('utf8'))

Response

204 No Content

No response body provided.