Creating a Job Report Using REST API
Creating a Job with Category
A category for your job is defined outside the transfer block in your JSON, in the section as schedule or job stop policy. The category name is a user-defined string. Any unique string will be recognized as a new category, and job_category_id will be generated.
},
"schedule": {
"mode": "manual"
},
"stop_policy": {
"on_success": 2
},
"category": {
"name": "Test Category"
}
Example JSON
{
"name":"Job Report | Migration Group 1",
"kind": "transfer",
"transfer": {
"transfer_type": "copy",
"tags": "add",
"source": {
"connection": { "id": "{{cloud_connection_source}}" },
"target": {
"path": "/Source Path"
}
},
"destination": {
"connection": { "id": "{{cloud_connection_destination}}" },
"target": {
"path": "/Destination Path"
}
}
},
"schedule": {
"mode": "manual"
},
"stop_policy": {
"on_success": 2
},
"category": {
"name": "Job Reports - Migration Group 1"
}
}
Â
Adding a Job to an Existing Report
To add a job to an existing report, modify your job JSON to include the job category ID rather than the name. Identify your job category ID by listing all existing reports. Find the report you want your job to be added to and note the the category ID from this report.
GET {{url}}v1/reports
List all Existing Reports Example JSON
Example Job JSON to add Job to Existing Report
Â
If the report was created with a manual list of jobs, it can be updated to include the new job or jobs to add to the report.Â
Example: List All Existing Reports Response with Manually Defined List of Jobs
Â
A job can be added to this report by submitting a PATCH request for this report ID. For example, the following request will add the job with IDÂ 87c53b88142940cf88a35a7e78b8db60
to the report above.
PATCH {{url}}v1/reports/4d804a381c414ad39e816245196414f4 |
Â
Getting a Job Category ID
In order to create a new report, you will need to get the job category ID.Â
Get current job's category ID
Reports | List all job category ID's
Jobs that were created without a category fall into the Default category. The default category ID is -1.
Â
Creating a New Report
To create a new report, you must use the job_category_id. The category string name will not be accepted.
Create New Report | POST {{url}}v1/reports |
Â
Creating a New Report for Simulation Jobs
To create a new report for simulation / analyzer jobs, you must use the corresponding job_category_id as well as simulation_mode:true parameter.Â
POST {{url}}v1/reports |
Listing Reports
List all Reports
List Report by ID
Â
Report Stats and Transfer Items
Get Transfer Items for Report by ID
Get transfer stats for Report by ID
Â