Getting tasks for which you need update the artifact version - Cloud

Updating artifact version in tasks via API

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 > Updating Tasks
Use the executables/tasks endpoint with the workspaceId and the artifactId query parameters to obtain a list of the tasks that are using the artifact to be updated.

Before you begin

Ensure that the account to be used to issue API calls has the Operations - Manage (ID: TMC_OPERATOR) permission.

About this task

In this section, Talend API Tester is used to demonstrate how to issue API calls to get the list of tasks.

Procedure

  1. On the Users page, generate a personal access token for your account.
  2. Open Talend API Tester in your browser and select GET from the Method list.
  3. In the field next to the Method drop-down list, enter the endpoint to be used: https://api.<your_environment>.cloud.talend.com/v2.6/executables/tasks
  4. In the HEADERS area, click Add header and in the name field that is displayed, enter Authorization and in the value field, enter Bearer and your personal access token. Enter a whitespace to separate Bearer and your personal access.

    Example

  5. Click Add query parameter twice to add two empty parameters and define them as workspaceId and artifactId, respectively.
    The artifactId parameter identifies the artifact to be updated and the workspaceId parameter indicates the workspace from which you get the tasks. You can obtain them through API requests or find them in Talend Cloud Management Console.
    • APIs:
      • use GET at the https://api.<your_environment>.cloud.talend.com/v2.6/artifacts endpoint for artifacts
      • use GET at the https://api.<your_environment>.cloud.talend.com/v2.6/workspaces for workspaces
    • In Talend Cloud Management Console, open the artifact list from the workspace and then open the artifact to be updated to see its ID. The ID of the workspace appears in the URL of the Edit workspace page.
  6. Click Send to issue your call to obtain all the tasks using this artifact.

Results

The status code 200 is returned with a list of tasks in the body of the response. The following example shows how a task could look like in the response. All of these tasks are using the artifact to be updated to a new version.
{
  "id": "your_task_id",
  "name": "Hello world task",
  "description": "task detail description",
  "workspace": {
    "id": "your_workspace_id",
    "name": "Personal",
    "description": "workspace detail description",
    "owner": "admin",
    "type": "custom",
    "environment": {
      "id": "your_environment_id",
      "name": "Development",
      "description": "environment detail description",
      "default": true
    }
  },
  "version": "0.1",
  "artifact": {
    "createDate": "2021-11-22T13:13:27.602Z",
    "updateDate": "2021-11-22T13:13:27.602Z",
    "id": "id_of_the_artifact_to_be_updated",
    "name": "Hello world artifact",
    "version": "0.1.0" (The artifact version to be updated)
  },
  "tags": [
    "tag1",
    "tag2"
  ],
  "connections": {
    "aws": "5d405e381f40e07fbab6757c",
    "googledrive": "5d405e831f40e07fbab6757d"
  },
  "parameters": {
    "parameter_p1": "1111",
    "custom_parameter": "custom"
  },
  "resources": {
    "resource_file_f1": "5d567ad48f68ae1a1e16e4a4"
  },
  "autoUpgradeInfo": {
    "autoUpgradable": false,
    "overrideWithDefaultParameters": false
  }
}