Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. IDMC REST API
  3. REST API resource quick references
  4. Platform REST API version 2 resources
  5. Platform REST API version 3 resources
  6. Data Integration REST API
  7. Cloud Data Integration for PowerCenter (CDI-PC) REST API
  8. Data Ingestion and Replication REST API
  9. Customer Managed REST API
  10. RunAJob utility
  11. ParamSetCli utility
  12. REST API codes

REST API Reference

REST API Reference

Running a task

Running a task

Use this resource to start a task in a Customer Managed runtime environment.
Before you run a task, ensure that you synchronize the task to the Customer Managed runtime environment, and then activate the synced assets.

POST request

To run a task, use the following API call:
POST https://<agent-host>:9443/rm/mftsaas/api/v1/offline/job/<taskId>/run RM-USER-TOKEN: <rm-token> Content-Type: application/json
The taskId is the FRS ID of the deployed task.
The request body is optional. Use it to override the values of user-defined variables in the task. You can also set the thread count and the log level. If you omit the body, the task runs with its deployed settings. Add Content-Type only when you send parameters in a request body.
You can use the following attributes in the request body:
{ "variables": { "sourceDir": "/data/inbound" }, "threadCount": 4, "logLevel": "NORMAL" }
To run a task with curl, use the following command:
curl -k -X POST \ https://<agent-host>:9443/rm/mftsaas/api/v1/offline/job/<taskId>/run \ -H "RM-USER-TOKEN: <rm-token>" \ -H "Content-Type: application/json" \ -d '{"variables":{"sourceDir":"/data/inbound"},"threadCount":4,"logLevel":"NORMAL"}'
The following table describes the optional attributes in the request body:
Field
Type
Required
Description
variables
Object
No
Values for user-defined ${variable} parameters in the task. Each key is a variable name, such as ParentFolder, and each value is a string.
threadCount
Integer
No
Number of threads for this run.
logLevel
String
No
Session log level for this run. Valid values are SILENT, NORMAL, VERBOSE, and DEBUG. The value is not case sensitive.
To skip duplicate files for your task, set the agent-dedup-repository property to true in the Mass Ingestion agent service properties for your Customer Managed runtime environment in Administrator. By default, the property is false.

Post response

Returns the job number and status if the request is successful. Returns an error if errors occur.
A 200 OK response does not mean the job succeeded. Call the job status resource until the job finishes.
A successful request returns the following response:
{ "agentId": "0a1B2c3D4e5F6g7H8i9J0k", "status": "SUBMITTED", "failMessage": null, "jobNumber": 1728712345678, "jobFilePath": null }
The following table describes the attributes:
Field
Type
Description
agentId
String
ID of the agent that accepted the job.
status
String
The status of the job.
Options are:
  • SUBMITTED. The agent accepted the job and the job waits to start.
  • RUNNING. The job started.
  • FAILED. The job could not start.
failMessage
String
Reason for the failure when the status is FAILED. For example, a missing variable.
jobNumber
Number
Job number. Save this value. The status, log, and abort resources need it.
The following table describes the errors:
HTTP status
Response
Description
400
{"error":"taskId is required"}
The path has no task ID.
400
{"error":"Invalid run parameters"}
The request body is not valid JSON.
404
{"error":"No ACTIVE MI_TASK deployed for frsId=<id>"}
No task with this ID is deployed to this agent.
404
{"error":"No active deployment for frsId=<id> found"}
The task is deployed, but the deployment is not live yet. A newer deployment might also have replaced it.
409
{"error":"<detail>"}
The integrity check of the deployed task definition failed. Deploy the task again.
500
{"error":"Database error: ..."} or {"error":"Rehydrate error: ..."}
Internal error. A log level value that is not valid also returns this error.

0 COMMENTS

We’d like to hear from you!