Flow Pipeline API

The Flow Pipeline API allows you to retrieve and update Flow pipelines. Flow pipelines are created and managed in the Admin - Flow Pipelines section.

List flow pipelines

Method Syntax
GET URL_BASE/api/v1/flow/pipeline

Description

Lists Flow pipelines a user has access to.

Response schema

All keys are returned in the response by default unless marked as optional.

Key Description Value
status Status of the api response “OK” or “ERROR”
pipelines list of pipeline details [{ “name”: “my_pipeline”, “id”: “uuid”, “permissions”: [“perms”], is_manager: true }]
pipelines/name Name of the pipeline string
pipelines/id Unique id of the pipeline uuid
pipelines/permissions List of pipeline permissions the current user has “flow_pipeline:read”, “flow_pipeline:execute”, “flow_pipeline:delete”, “flow_pipeline:manage_pipelines”, “flow_pipeline:write”
pipelines/is_manager Is the current user a manager of the pipeline true or false

Examples

Request

Retrieve all pipelines a user has access to

import requests

url = url_base + '/api/v1/jobs/pipelines`

payload={}
headers = {
  'Authorization': 'Bearer token'
}

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

Response

{
  "status": "OK",
  "pipelines": [
      {
          "name": "pipeline_name",
          "id": "8c400d55-15d4-41f9-b306-ec2836898d83",
          "permissions": [
              "flow_pipeline:read",
              "flow_pipeline:execute",
              "flow_pipeline:delete",
              "flow_pipeline:manage_pipelines",
              "flow_pipeline:write"
          ],
          "is_manager": true
      },
  ]
}

Update the pipelines for a job

Method Syntax
POST URL_BASE/api/v1/jobs/pipelines

Description

Update the pipelines of a job.

Request body

The body of the request must be a JSON object, which can contain the following parameters. Parameters are required unless marked as optional.

Parameter Type Description Values
job_id string The ID of the job you want to update pipelines for. A valid job ID
pipeline_ids string The new ids to apply to the job. If this parameter is an empty list, all the pipelines for the job_id provided are deleted. A list of pipeline IDs

To find the associated pipeline ID of a pipeline or to create a new pipeline, go to ‘Flow pipelines’ in the Admin app.

Response schema

All keys are returned in the response by default unless marked as optional.

Key Type Description Value
status string Whether the API call succeeded. OK or ERROR
updated_pipelines list A list of dictionaries with the new associated pipeline id and pipeline name in each dictionary. An empty or nonempty list of the new pipelines information for the job.
msg string Optional. Error message. Present only if status is ERROR A string describing the error encountered.

Examples

Request

Example (Python):

import json, requests

url = url_base + '/api/v1/jobs/pipelines`

args = {
  "job_id": "f403399d-7ac7-4285-bb06-f7ad82ddbea2",
  "pipeline_ids": ["e05cc5f7-b199-49a6-b1bc-f17dc5247e0c", "03f4dc97-1245-452d-9d7b-17f8b86473b8"],
}
json_data = json.dumps(args)

headers = {
  'Authorization': 'Bearer {0}'.format(token)
}

r = requests.post(url, data=json_data, headers=headers)
resp_data = json.loads(r.content)

Response

The response body is a JSON object.

If successful:

HTTP STATUS CODE 200

# body
{
    "status": "OK",
    "updated_pipelines": [
        {
            "flowPipelineName": "udit-test",
            "flowPipelineId": "e05cc5f7-b199-49a6-b1bc-f17dc5247e0c"
        },
        {
            "flowPipelineName": "jag-test",
            "flowPipelineId": "03f4dc97-1245-452d-9d7b-17f8b86473b8"
        }
    ]
}