stop_datasource_sync_job

DatasourcesApi.stop_datasource_sync_job(role_id, datasource_id, job_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Stop a running datasource sync job

Stops an in-flight catalog Glue sync job. Caller needs editor access (else AUTH-1012). Supported types: amorphic, or jdbc with IngestionType metadataonly. Job must be RUNNING or STARTING in DynamoDB (else IPV-1078). If Glue is still RUNNING, stop is requested and JobStatus becomes STOPPING; if Glue already terminal, DynamoDB is synced to that status. Intended for catalog Glue runs (GlueJobRunId “n/a” on the external path can fail with GE-1034). Not idempotent for an already-stopped job.

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)

  • job_id (str) – Sync job run UUID to stop. Rejected with IPV-1045 if not found. (required)

  • _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:

StopDatasourceSyncJobResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /datasources/{datasource_id}/sync-jobs/{job_id}

Success (HTTP 200)

Stop accepted or status synced. Message is either “Triggered stop of datasource sync job {job_id}” (STOPPING) or “Sync job {job_id} already reached status {state} before it could be stopped.”

Glue stop requested

{
  "Message": "Triggered stop of datasource sync job b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
  "JobId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}

Glue already finished

{
  "Message": "Sync job b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f already reached status SUCCEEDED before it could be stopped.",
  "JobId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}

Errors

Documented error codes: AUTH-1012, IPV-1045, IPV-1078, GE-1034.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1012 (no editor access), IPV-1045 (unknown datasource or JobId), IPV-1078 (job not RUNNING/STARTING).

Job not stoppable

{
  "Message": "IPV-1078 - Cannot stop sync job b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f as it is not running. Current status: SUCCEEDED."
}

JobId not found

{
  "Message": "IPV-1045 - Invalid parameter - JobId(b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f), value either missing or is invalid."
}

HTTP 500

Backend failure (GE-1034 if Glue get/stop fails), or unsupported datasource type Message “Only Amorphic and Jdbc metadataonly type of datasources are allowed for this /sync-jobs/JobId operation”.

Failed to stop Glue run

{
  "Message": "GE-1034 - Failed to stop the sync job b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f."
}