Use a service account to run tasks in the following endpoint:
https://api.<env>.cloud.talend.com/processing/executions
Before you begin
- Ensure that the service account to be used to issue API calls has appropriate
permissions. These permissions could be:
- The Engines - Use permission. The ID of this
permission is
TMC_ENGINE_USE
. In this example, the service account was granted this permission as previously described in Creating a service account with account/service-accounts. - The Operations - Manage permission. The ID of
this permission is
TMC_OPERATOR
.
- The Engines - Use permission. The ID of this
permission is
-
Once generated, a service account token expires after 30 minutes. If it expires, generate a new token using the POST method at the endpoint
https://api.<env>.cloud.talend.com/security/oauth/token
. For more information about generating a token, see Generating a service account token.
About this task
In this section, the following API call is
issued:
method: POST
endpoint: https://api.<env>.cloud.talend.com/processing/executions
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <service_account_token>"
}
payload: {
"executable": "id_of_the_task_to_be_run",
"logLevel": "WARN"
}
It
is implemented in Talend API Tester
for demonstration purposes. In Talend API Tester,
you can use an expression builder to dynamically retrieve the service account token
from its related API request.Procedure
Results
{
"executionId": "16fefb53-035a-4249-af9d-f80a3b47b132"
}
What to do next
/executions/{runId}/logs
to monitor this
task run. For further information, see Monitoring task runs.Note: Note that
runId
and executionId
both refer to the ID of a
task run in this documentation.