trigger_datasource_sync_job¶
- DatasourcesApi.trigger_datasource_sync_job(role_id, datasource_id, content_type=None, force_sync=None, max_runtime_hours=None, resume_from_job_id=None, enable_orphan_cleanup=None, trigger_datasource_sync_job_request=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Trigger or resume a datasource sync job
Starts a sync job for a datasource. The caller must have editor access. Supported datasource types are amorphic and jdbc with IngestionType set to metadataonly. Only one RUNNING or STARTING job can exist for a datasource at a time. External Amorphic and metadata-only ingestions use the external-assets Step Functions flow; other supported syncs either resume an eligible STOPPED/FAILED Glue job or start a new catalog Glue sync. Each request creates a new JobId.
- Parameters:
role_id (str) – Amorphic role ID. Must grant editor access on the datasource. (required)
datasource_id (str) – UUID of the datasource. Rejected with IPV-1045 if missing or unknown. (required)
content_type (str) – Must be application/json when sending a body.
force_sync (str) – Catalog Glue sync only (ignored for external-amorphic / metadataonly). Passed through to the Glue job. Default “False”. When true, syncs resources regardless of LastSyncTime.
max_runtime_hours (str) – Catalog Glue sync only. App-level auto-stop hours. Default 10. Range 0–12 (IPV-1002 if invalid). 0 means use the Glue timeout (12) as the app-level limit.
resume_from_job_id (str) – Catalog Glue sync only (ignored for external-amorphic / metadataonly). JobId of a STOPPED or FAILED run to resume from saved manifest cursors. Unknown job or wrong status returns IPV-1078.
enable_orphan_cleanup (str) – Catalog Glue sync only. Passed through to the Glue job. Default “False”. When true, deletes catalog assets whose underlying resource no longer exists.
trigger_datasource_sync_job_request (TriggerDatasourceSyncJobRequest)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: POST /datasources/{datasource_id}/sync-jobs
Request¶
The request body is optional.
Request / response example
{
"Resources": [
"datasets",
"glossaries",
"domains"
]
}
Success (HTTP 200)¶
Job accepted. Message is “Datasource sync job triggered successfully” for fresh/external runs, or “Datasource sync job resumed successfully” for resume. JobId is the new run UUID.
Fresh sync started
{
"Message": "Datasource sync job triggered successfully",
"JobId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}
Resume from STOPPED/FAILED job
{
"Message": "Datasource sync job resumed successfully",
"JobId": "a2f7d3b1-8e5c-4a6f-9d1e-2b3c4d5e6f7a"
}
Errors¶
Documented error codes: AUTH-1012, IPV-1045, IPV-1002, IPV-1078.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1012 (no editor access), IPV-1045 (unknown datasource), IPV-1002 (invalid Resources or max_runtime_hours), IPV-1078 (job already running, or resume target missing/not STOPPED/FAILED).
Sync already RUNNING/STARTING
{
"Message": "IPV-1078 - A sync job is already running for this datasource. Please wait for it to complete before starting a new one."
}
Unsupported resource type in body
{
"Message": "IPV-1002 - Invalid resource type(s) provided: tags. Supported values are: code-repositories, dashboards, data-pipelines, datalabs, datalabs-lifecycle-configurations, datasets, datasources, domains, files, glossaries, jobs, jobslibs, tenants"
}
Resume from non-STOPPED/FAILED job
{
"Message": "IPV-1078 - Only STOPPED or FAILED sync jobs can be resumed; job b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f is RUNNING."
}
HTTP 500
Backend failure (for example Glue/Step Functions start), or unsupported datasource type Message “Only Amorphic and Jdbc metadataonly type of datasources are allowed for this /sync-jobs operation”.
Unsupported datasource type for POST
{
"Message": "Only Amorphic and Jdbc metadataonly type of datasources are allowed for this /sync-jobs operation"
}