Monitoring task runs by accessing only relevant logs - Cloud

Talend Cloud APIs User Guide

Version
Cloud
Language
English (United States)
Product
Talend Cloud
Module
Talend API Designer
Talend API Tester
Talend Data Preparation
Talend Data Stewardship
Talend Management Console
Content
Design and Development > Designing APIs
Design and Development > Testing APIs
Obtain task runs of a given period in a specific environment for monitoring purposes.

Before you begin

  • Generate a personal access token by following Generating a Personal Access Token.

  • The user or the service account to be used must have the Author, the Viewer and the Executor permissions for the workspace to which the task to be monitored belongs.

About this task

In this section, the following API call is firstly issued:
method: GET
endpoint: https://api.<env>.cloud.talend.com/processing/executables/tasks/executions
headers: {
 "Content-Type": "application/json",
 "Authorization": "Bearer <your_personal_access_token>"
}
query parameters: {
  "lastDays": "7",
  "status": "execution_failed",
  "environmentId": "id_of_the_environment_to_be_monitored"
}
It is implemented in Talend API Tester for demonstration purposes.

Procedure

  1. Open Talend API Tester in your browser and select GET from the Method list.
  2. In the field next to the Method drop-down list, enter the endpoint to be used:

    Example

    In this example, the status, the lastDays, the environmentId and the tags parameters are used to retrieve all the failed critical runs of last 7 days in the given environment.

    The environmentId parameter identifies the environment from which you get the task runs. You can obtain it through API requests or find it in Talend Cloud Management Console.

    The tags parameter is used to select the failed runs that are tagged with CRITICAL.

    • In Talend Cloud Management Console, select the environment from the environment list on the Environment page. The ID of this environment appears in the URL of the current page.
  3. Issue this API request to get a list of the failed critical runs in this environment.
  4. Use each of these run IDs to issue the following API request to obtain their logs.
    method: GET
    endpoint: 
      https://api.<your_environment>.cloud.talend.com/monitoring/executions/<runId>/log
    headers: {
       "Authorization": "Bearer <personanl_access_token_or_service_account_token>"
                      }
    payload: N/A

Results

You get each of these logs in the response of the API call. If you want to generate log files to download, see this example: Fetching run logs periodically for analysis