メイン コンテンツをスキップする 補完的コンテンツへスキップ

タスクをアーティファクトの新しいバージョンでアップデート

orchestration/executables/tasks/<task_id>エンドポイントを使い、アーティファクトの新しいバージョンでタスクをアップデートします。

手順

次のリクエストを発行し、指定された環境でスケジュールされたタスク実行を取得します。

method: PUT
endpoint: https://api.<env>.cloud.talend.com/orchestration/executables/tasks/<task_id>
headers: {
          "Content-Type": "application/json",
          "Authorization": "Bearer <your_personal_access_token_or_service_account_token>"
          }
payload: {
  "name": "task_name",
  "description": "",
  "workspaceId": "workspace_id",

  "artifact": {
    "id": "id_of_the_artifact_that_the_task_uses",    
    "version": "target_version_of_this_artifact (for example, 0.1.22.20212710014123)"
  }
}
この例に含まれているタスクのパラメーター数は最小限のものです。タスクをアップデートする場合は、ペイロードにタスクのエンティティ全体(つまりアップデートされるタスクの既存の全フィールド)を含めるようにしてください。そうしない場合は、タスクにあるものの含まれていないフィールド値はすべてNULLに置き換えられます。

タスクの結果

レスポンスのボディ内に、ステータスコード200がタスク詳細と共に返されます。新しいアーティファクトが使用されていることがわかります。以下の例では、レスポンス内にタスクがどのように表示されるはずかを示します。
{
  "id": "5c1111d7a4186a4eafed0587",
  "name": "Hello world task",
  "description": "task detail description",
  "workspace": {
    "id": "57f64991e4b0b689a64feed2",
    "name": "Personal",
    "description": "workspace detail description",
    "owner": "admin",
    "type": "custom",
    "environment": {
      "id": "57f64991e4b0b689a64feed3",
      "name": "Development",
      "description": "environment detail description",
      "default": true
    }
  },
  "version": "0.1",
  "artifact": {
    "createDate": "2021-11-22T13:13:27.608Z",
    "updateDate": "2021-11-22T13:13:27.608Z",
    "id": "id_of_the_artifact_to_be_updated",
    "name": "my_artifact",
    "version": "0.1.22.20212710014123" (The new  artifact version)
  },
  "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
  }
}

実際の運用では、自分のスクリプトを開発し、前のセクション(アーティファクトのバージョンをアップデートする必要があるタスクを取得)で取得した各タスクでこのリクエストを自動的に発行できます。

左側にある[Downloads] (ダウンロード)タブで、この種のスクリプトの例をダウンロードし、スクリプトの先頭にリスト表示される必要なパラメーターに適切な値を追加し、それを使ってタスクのアップデートを自動化できます。このスクリプトは、デモンストレーション目的のためのみデザインされています。Talendはこのスクリプトのサポートサービスを提供しません。

このページは役に立ちましたか?

このページまたはコンテンツに、タイポ、ステップの省略、技術的エラーなどの問題が見つかった場合は、お知らせください。改善に役立たせていただきます。