Syncplicity Support

Search our knowledgebase to get the help you need, today

Follow

Create a job report

DataHub Reports provide several options to combine many jobs into a single report for review. Reports are generated by category, individually selected jobs or by convention job parent (user account mapping, network home drive mapping or folder mapping job types).

Reports are separated by two tabs so you can clearly distinguish between jobs that are actively transferring content and simulation jobs that imitate transfer. 

If no category is defined during job creation, it will be assigned to the default job category. 

Generate Report

Select Report Type

Define what the report will contain

Create 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. 

Category Name:

  • User-defined string
  • Any unique string will be recognized as a new category and job_category_id will be generated

Category is defined outside of the transfer block

},
"schedule": {
"mode": "manual"
},
"stop_policy": {
"on_success": 2
},
"category": {
"name": "Test Category"
}

Example Job 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"
    }
}

Add 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
  • Capture the category ID from this report

List All Existing Reports

GET {{url}}v1/reports

Example: List All Existing Reports Response

....
"type": "reports",
    "reports": [
        {
            "id": "4d804a381c414ad39e816245196414f4",
            "name": "Job Reports - Migration Group 1",
            "description": "This is my report",
            "parameters": {
                "job_category_id": 2
            },
....

Example Job JSON to add Job to Existing Report

{
    "name":"Create New Job, Add to existing Report",
    "kind": "transfer",
    "transfer": {
        "transfer_type": "copy",
        "batch_mode": "always",
        "timestamps": "true",
        "permissions": "add",
        "segment_transform": true,
        "duplicate_names": "rename",
        "empty_containers": "create",
        "versioning": {
            "preserve": "native",
            "select": "all"
        },
        "source": {
            "connection": { "id": "{{cloud_connection_source}}" },
            "target": {
                "path": "/SourcePath"
            }
        },
        "destination": {
            "connection": { "id": "{{cloud_connection_destination}}" },
            "target": {
                "path": "/DestinationPath"
            }
        }
    },
    "schedule": {
        "mode": "manual"
    },
    "stop_policy": {
        "on_success": 2
    },
    "category": {
        "id": 2
   }
}

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

....
"type": "reports",
    "reports": [
        {
            "id": "4d804a381c414ad39e816245196414f4",
            "name": "Job Reports - Migration Group 1",
            "description": "This is my report",
            "parameters": {
                "simulation_mode": 0,
                "jobs": [
                    "ade0a8c33e71409bad17ecd92678a458",
                    "b7648a5d23a941a3bce5d018113d6243"
                ]
            },
....

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

{
    "id": "4d804a381c414ad39e816245196414f4",
    "parameters": {
        "simulation_mode": 0,
        "jobs": [
            "ade0a8c33e71409bad17ecd92678a458",
            "b7648a5d23a941a3bce5d018113d6243",
            "87c53b88142940cf88a35a7e78b8db60"
        ]
    }
}

Get Job Category ID

In order to create a new report, you will need to get the job category ID. 

Reports | Get current job's category ID

GET {{url}}v1/jobs/{{job}}?fields=category

Reports | List all job category ID's

GET {{url}}v1/jobs?fields=category

Jobs that were created without a category fall into the Default category

Default category ID = -1

Create 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

{
 "name": "Report 1",
 "created_by": "Joe Smith",
 "description": "This is my report",
   "parameters": {
     "job_category_id": 2
  }
}

Create a New Report for Simulation / Analyzer 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

{
 "name": "Simulation Jobs",
 "created_by": "Joe Smith",
 "description": "This is my Analyzer Job report",
   "parameters": {
     "job_category_id": 2,
     "simulation_mode": true
  }
}

List Reports

Reports | List All Reports

GET {{url}}v1/reports

Report | List Report by ID

GET {{url}}v1/reports/{{report_id}}?include=all

Report Stats and Transfer Items

Reports | Get Transfer Items for Report by ID

GET {{url}}v1/reports/{{report_id}}/items

Reports | Get transfer stats for Report by ID

GET {{url}}v1/reports/{{report_id}}/stats

 

Powered by Zendesk