Tailer Documentation
  • What is Tailer Platform?
  • Getting Started
    • Prepare your local environment for Tailer
    • Install Tailer SDK
    • Set up Google Cloud Platform
    • Encrypt your credentials
  • [Tutorial] Create a first data pipeline
    • Introduction
    • Prepare the demonstration environment
    • Copy files from one bucket to another
    • Load files into BigQuery tables
    • Prepare data
    • Build predictions
    • Export data
    • Congratulations!
    • [Video] Automatic Script
      • SQL script file
      • DDL script file
      • Tables to Tables script file
      • Launch configuration and furthermore
  • Data Pipeline Operations
    • Overview
    • Set constants with Context
      • Context configuration file
    • Move files with Storage to Storage
      • Storage to Storage configuration file
    • Load data with Storage to Tables
      • Storage to Tables configuration file
      • Storage to Tables DDL files
    • Stream incoming data with API To Storage
      • API To Storage configuration file
      • API To Storage usage examples
    • Transform data with Tables to Tables
      • Tables to Tables configuration file
      • Table to Table SQL and DDL files
    • Export data with Tables to Storage
      • [V3] Table to Storage configuration file
      • Table to Storage SQL file
      • [V1-V2: deprecated] Table to Storage configuration file
    • Orchestrate processings with Workflow
      • [V2] Workflow configuration file
      • [V1: deprecated] Workflow configuration file
    • Convert XML to CSV
      • Convert XML to CSV configuration file
    • Use advanced features with VM Launcher
      • Process code with VM Launcher
        • VM Launcher configuration file for code processing
      • Encrypt/Decrypt data with VM Launcher
        • VM Launcher configuration file for data encryption
        • VM Launcher configuration file for data decryption
    • Monitoring and Alerting
      • Monitoring and alerting parameters
    • Asserting Data quality with Expectations
      • List of Expectations
    • Modify files with File Utilities
      • Encrypt/Decrypt data with File Utilities
        • Configuration file for data encryption
        • Configuration file for data decryption
    • Transfer data with GBQ to Firestore
      • Table to Storage: configuration file
      • Table to Storage: SQL file
      • VM Launcher: configuration file
      • File-to-firestore python file
  • Tailer Studio
    • Overview
    • Check data operations' details
    • Monitor data operations' status
    • Execute data operations
    • Reset Workflow data operations
    • Archive data operations
    • Add notes to data operations and runs
    • View your data catalog
    • Time your data with freshness
  • Tailer API
    • Overview
    • Getting started
    • API features
  • Release Notes
    • Tailer SDK Stable Releases
    • Tailer Beta Releases
      • Beta features
      • Beta configuration
      • Tailer SDK API
    • Tailer Status
Powered by GitBook
On this page
  • 🔑 Get a JWT token
  • Launching a job's execution
  • Checking a run's status
  • Getting the last status of a job/data operation
  • Getting job/data operations by status
  • ⚙️ Setting a run's status
  • Resetting a workflow
  • Disabling a data operation
  • Enabling a data operation
  • Archive a data operation

Was this helpful?

Edit on GitHub
  1. Tailer API

API features

This page describes the different actions that can be performed with the Tailer API.

PreviousGetting startedNextTailer Beta Releases

Last updated 8 months ago

Was this helpful?

For the table-to-table configurations, don't forget to add at the end of the configuration_id the environnement (DEV, PROD, etc.) before querying it throw the APIs. __Example : the table-to-table configuration_id "000099_iowa_liquor_prepare_pda" in your json file in DEV environnement is referenced as the "000099_iowa_liquor_prepare_pda_DEV" in the payload below.

🔑 Get a JWT token

You will need to provide a JWT token for your API call. You can use different methods to get a JWT token based on your credentials.

You can use thetailer auth get-token function to get a few tokens, including a JWT token associated with the credentials you use with your tailer-sdk. You can get this token only using TAILER_API_JWT=tailer auth get-token | sed '7q;d' | sed 's/User token : //g'

Launching a job's execution

Tables to Tables or Tables to Storage data operations can be launched through the Tailer API.

You need to provide the full identity of the job as input (the execution_date parameter is optional):

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "launch_job",
          "account": "000099",
          "environment": "DEV",
          "configuration_type": "table-to-table",
          "configuration_id": "000099_iowa_liquor_prepare_pda_DEV"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/launch"

As a result, the job is launched and you get a unique run ID in the following format:

{"run_id":"20201230-113940-1fb692b0-3531-4578-9919-acf6fdb0a5b1"}

Once you have a run ID, you can check its current status to see how the processing is going.

You need to provide the full identity of the job and the run ID as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{"action": "check_run_status",
         "account": "000099",
         "environment": "DEV",
         "configuration_type": "table-to-table",
         "configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
         "job_id": "gbq-to-gbq|000099_iowa_liquor_prepare_pda_DEV",
         "run_id": "20201230-112837-0a795c70-2557-4a60-ba16-788aa2bea179"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

As a result, you get a json payload with information about the run in the following format:

{
	"results": [
		{
			"account": "000099",
			"configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
			"configuration_type": "table-to-table",
			"duration": "0:01:24.002519",
			"environment": "DEV",
			"job_id": "gbq-to-gbq|000099_iowa_liquor_prepare_pda_DEV",
			"last_update_date": "2020-12-30T11:30:07.960767+00:00",
			"run_id": "20201230-112837-0a795c70-2557-4a60-ba16-788aa2bea179",
			"start_execution_date": "2020-12-30T11:28:43.861340+00:00",
			"status": "SUCCESS"
		}
	]
}

You can check the current status for the latest run of a job/data operation.

You need to provide the full identity of the job/data operation as input. If needed, you can specify some parameters for the job/data operation in order to target a specific one:

Example with a job

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "get_last_status",
          "account": "000099",
          "environment": "DEV",
          "configuration_type": "table-to-table",
          "configuration_id": "000099_iowa_liquor_prepare_pda_DEV"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

As a result, you get a json payload with information about the last runs of this job in the following format:

{
	"results": [
		{
			"account": "000099",
			"configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
			"configuration_type": "gbq-to-gbq",
			"duration": "0:01:24.002519",
			"environment": "DEV",
			"job_id": "gbq-to-gbq|000099_iowa_liquor_prepare_pda_DEV",
			"last_update_date": "2020-12-30T11:30:07.960767+00:00",
			"run_id": "20201230-112837-0a795c70-2557-4a60-ba16-788aa2bea179",
			"start_execution_date": "2020-12-30T11:28:43.861340+00:00",
			"status": "SUCCESS"
		},
		{
			"account": "000099",
			"configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
			"configuration_type": "gbq-to-gbq",
			"duration": "0:01:35.345232",
			"environment": "DEV",
			"job_id": "gbq-to-gbq|000099_iowa_liquor_prepare_pda_DEV",
			"last_update_date": "2020-12-30T11:10:49.097747+00:00",
			"run_id": "20201230-110907-47b31b2d-a54a-4a95-a3a6-b4fbc2168333",
			"start_execution_date": "2020-12-30T11:09:13.665798+00:00",
			"status": "SUCCESS"
		},
		{
			"account": "000099",
			"configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
			"configuration_type": "gbq-to-gbq",
			"duration": "0:01:39.201091",
			"environment": "DEV",
			"job_id": "gbq-to-gbq|000099_iowa_liquor_prepare_pda_DEV",
			"last_update_date": "2020-12-10T14:07:56.739284+00:00",
			"run_id": "20201210-140612-19e547a1-de6a-47f0-b563-b8a3d5754118",
			"start_execution_date": "2020-12-10T14:06:17.415294+00:00",
			"status": "SUCCESS"
		}
	]
}

Example with a data operation (configuration level)

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "get_last_status",
          "account": "000099",
          "environment": "DEV",
          "configuration_type": "storage-to-storage",
          "configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

As a result, you get a json payload with information about the last runs of this configuration in the following format:

{
	"results": [
		{
			"account": "000099",
			"configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
			"configuration_type": "storage-to-storage",
			"duration": "0:00:03.885654",
			"environment": "DEV",
			"job_id": "storage-to-storage|000099|000099-jarvis-demo-iowa-liquor-storage-to-storage|DEV|stores-{{FD_DATE}}-{{FD_TIME}}.csv",
			"run_id": "20201209-cf026ae9-c79c-4cf9-8ffb-0bb63ad39469",
			"start_execution_date": "2020-12-09T17:17:23+00:00",
			"status": "SUCCESS"
		},
		{
			"account": "000099",
			"configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
			"configuration_type": "storage-to-storage",
			"duration": "0:00:04.373931",
			"environment": "DEV",
			"job_id": "storage-to-storage|000099|000099-jarvis-demo-iowa-liquor-storage-to-storage|DEV|stores-{{FD_DATE}}-{{FD_TIME}}.csv",
			"run_id": "20201209-7b7b7a66-1cc0-4f09-a893-ce4a35adf09b",
			"start_execution_date": "2020-12-09T17:17:18+00:00",
			"status": "SUCCESS"
		},
		{
			"account": "000099",
			"configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
			"configuration_type": "storage-to-storage",
			"duration": "0:00:04.295537",
			"environment": "DEV",
			"job_id": "storage-to-storage|000099|000099-jarvis-demo-iowa-liquor-storage-to-storage|DEV|stores-{{FD_DATE}}-{{FD_TIME}}.csv",
			"run_id": "20201209-4d76a90a-b092-4c69-a87f-b0cd79305428",
			"start_execution_date": "2020-12-09T17:17:18+00:00",
			"status": "SUCCESS"
		}
	]
}

Example with a data operation (configuration) with specific parameters

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "get_last_status",
          "account": "000099",
          "environment": "DEV",
          "configuration_type": "storage-to-storage",
          "configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
          "execution_date": "2020-12-09",
          "status": "SUCCESS",
          "limit": 2}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

As a result, you get a json payload with information about the last 2 runs ins success, with a start date the 2020/12/09 of this configuration in the following format:

{
	"results": [
		{
			"account": "000099",
			"configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
			"configuration_type": "storage-to-storage",
			"duration": "0:00:03.885654",
			"environment": "DEV",
			"job_id": "storage-to-storage|000099|000099-jarvis-demo-iowa-liquor-storage-to-storage|DEV|stores-{{FD_DATE}}-{{FD_TIME}}.csv",
			"run_id": "20201209-cf026ae9-c79c-4cf9-8ffb-0bb63ad39469",
			"start_execution_date": "2020-12-09T17:17:23+00:00",
			"status": "SUCCESS"
		},
		{
			"account": "000099",
			"configuration_id": "000099-jarvis-demo-iowa-liquor-storage-to-storage",
			"configuration_type": "storage-to-storage",
			"duration": "0:00:04.373931",
			"environment": "DEV",
			"job_id": "storage-to-storage|000099|000099-jarvis-demo-iowa-liquor-storage-to-storage|DEV|stores-{{FD_DATE}}-{{FD_TIME}}.csv",
			"run_id": "20201209-7b7b7a66-1cc0-4f09-a893-ce4a35adf09b",
			"start_execution_date": "2020-12-09T17:17:18+00:00",
			"status": "SUCCESS"
		}
	]
}

Getting job/data operations by status

You can list job/data operations using a specific status.

You need to provide at least the account, the environment and the configuration type:

Example with TTT

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{"action": "get_by_status",
         "account": "000099",
         "configuration_type": "table-to-table",
         "limit": 100}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

You can filter using a specific status:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{"action": "get_by_status",
         "account": "000099",
         "configuration_type": "table-to-table",
         "status": "RUNNING",
         "limit": 15}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

You can filter further using a specific date

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{"action": "get_by_status",
         "account": "000099",
         "configuration_type": "table-to-table",
         "status": "RUNNING",
         "execution_date": "2024-09-18",
         "limit": 15}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

⚙️ Setting a run's status

Once you have a run ID, you can modify the status of any run.

You need to provide the full identity and run ID as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{"action": "set_run_status",
         "account": "000099",
         "configuration_type": "table-to-table",
         "configuration_id": "000099_iowa_liquor_prepare_pda_DEV",
         "run_id": "20201230-112837-0a795c70-2557-4a60-ba16-788aa2bea179"
         "status": "CHECKED"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/dag/status"

Note that only the following statuses are supported: SUCCESS, FAILED, RUNNING, NO_MATCH, CHECKED

Example of a case requiring a workflow reset

We have three jobs, named JA, JB, and JC which trigger a job named JT when they are all successfully executed.

If a situation happens where JA and JB are OK, but JC is not, JT is not triggered. You fix and relaunch JC, which becomes OK, and JT is triggered. The next morning, you launch JC again to make sure it works: you get JA(0), JB(0) and JC(1). When JA and JB are automatically started a few hours later, JC is already considered as OK, which creates an unbalanced situation. A reset is necessary.

You need to provide the full identity of the Workflow data operation as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "reset_workflow_status", 
          "account": "000099", 
          "environment": "DEV", 
          "configuration_type": "workflow",
          "configuration_id": "000099-iowa-liquor-load-pda"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/workflow/status"

As a result, you get a response (OK, or KO) in the following format:

{"code":200,"data":{},"message":"ok"}

You need to provide the full identity of the data operation as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "set_configuration_status",
          "activated" : false,
          "archived" : false,
          "account": "000099", 
          "environment": "DEV", 
          "configuration_type": "table-to-table",
          "configuration_id": "000099_Load_PDA_f_traffic_ma_DEV"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/configuration/status"

As a result, you get a response (OK, or KO) in the following format:

{"message":"ok"}

You need to provide the full identity of the data operation as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "set_configuration_status",
          "activated" : true,
          "archived" : false,
          "account": "000099", 
          "environment": "DEV", 
          "configuration_type": "table-to-table",
          "configuration_id": "000099_Load_PDA_f_traffic_ma_DEV"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/configuration/status"

As a result, you get a response (OK, or KO) in the following format:

{"message":"ok"}

You need to provide the full identity of the data operation as input:

TAILER_API_JWT=`tailer auth get-token | awk '/User token :/ {print $4}'` \
&& curl --request POST \
--http2 \
--header "content-type:application/json" \
--header "Authorization: Bearer ${TAILER_API_JWT}" \
--data '{ "action": "set_configuration_status",
          "activated" : false,
          "archived" : true,
          "account": "000099", 
          "environment": "DEV", 
          "configuration_type": "table-to-table",
          "configuration_id": "000099_Load_PDA_f_traffic_ma_DEV"}' \
"https://tailer-api-nqonovswsq-ew.a.run.app/v1/configuration/status"

As a result, you get a response (OK, or KO) in the following format:

{"message":"ok"}

Checking a run's status

Getting the last status of a job/data operation

Resetting a workflow

The Tailer API allows you to reset a Workflow data operation. The reset feature deletes all the triggered jobs so the workflow can start from scratch, as when the it was just deployed. (This feature is also available in .)

Disabling a data operation

You can disable a data operation (configuration) using the API. (This feature is also available in .)

Enabling a data operation

You can enable a data operation that had been disabled using the API. (This feature is also available in .)

Archive a data operation

You can archive a data operation using the API. (This feature is also available in .)

🚀
🏃‍♂️
⌛
0️⃣
⏹️
▶️
▶️
Tailer Studio
Tailer Studio
Tailer Studio
Tailer Studio