From 745a6272d39abdd44fccb9aeabd609620c491c86 Mon Sep 17 00:00:00 2001 From: hmcguire443 Date: Wed, 5 Nov 2025 13:38:13 -0600 Subject: [PATCH 1/5] Add function to abort sync job --- jupiterone/client.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/jupiterone/client.py b/jupiterone/client.py index e5f9ae9..a0dff9f 100644 --- a/jupiterone/client.py +++ b/jupiterone/client.py @@ -951,7 +951,7 @@ def bulk_delete_entities( return response def finalize_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]: - """Start a synchronization job. + """Finalize a synchronization job. args: instance_job_id (str): The "Job ID" for the Custom Integration job @@ -964,6 +964,20 @@ def finalize_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, return response + def abort_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]: + """Abort a synchronization job. + + args: + instance_job_id (str): The "Job ID" for the Custom Integration job to abort + """ + endpoint = f"/persister/synchronization/jobs/{instance_job_id}/abort" + + data = {} + + response = self._execute_syncapi_request(endpoint=endpoint, payload=data) + + return response + def fetch_integration_jobs(self, instance_id: Optional[str] = None) -> List[Dict[str, Any]]: """Fetch Integration Job details from defined integration instance. From bd6ea77eacc9574a52da87079893a5effa4a3d2c Mon Sep 17 00:00:00 2001 From: hmcguire443 Date: Thu, 6 Nov 2025 10:31:22 -0600 Subject: [PATCH 2/5] change param name --- jupiterone/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jupiterone/client.py b/jupiterone/client.py index a0dff9f..4f6b0b9 100644 --- a/jupiterone/client.py +++ b/jupiterone/client.py @@ -964,13 +964,13 @@ def finalize_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, return response - def abort_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]: + def abort_sync_job(self, sync_job_id: Optional[str] = None) -> Dict[str, Any]: """Abort a synchronization job. args: - instance_job_id (str): The "Job ID" for the Custom Integration job to abort + sync_job_id (str): The "Job ID" for the Custom Integration job to abort """ - endpoint = f"/persister/synchronization/jobs/{instance_job_id}/abort" + endpoint = f"/persister/synchronization/jobs/{sync_job_id}/abort" data = {} From 117c4cb65280692abd37a495b483bf0fc22c6974 Mon Sep 17 00:00:00 2001 From: hmcguire443 Date: Thu, 6 Nov 2025 10:37:45 -0600 Subject: [PATCH 3/5] change param --- jupiterone/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jupiterone/client.py b/jupiterone/client.py index 4f6b0b9..a0dff9f 100644 --- a/jupiterone/client.py +++ b/jupiterone/client.py @@ -964,13 +964,13 @@ def finalize_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, return response - def abort_sync_job(self, sync_job_id: Optional[str] = None) -> Dict[str, Any]: + def abort_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]: """Abort a synchronization job. args: - sync_job_id (str): The "Job ID" for the Custom Integration job to abort + instance_job_id (str): The "Job ID" for the Custom Integration job to abort """ - endpoint = f"/persister/synchronization/jobs/{sync_job_id}/abort" + endpoint = f"/persister/synchronization/jobs/{instance_job_id}/abort" data = {} From 8dc06841fedcf4a4bddeea6193c48b508f7bc544 Mon Sep 17 00:00:00 2001 From: hmcguire443 Date: Thu, 6 Nov 2025 13:12:25 -0600 Subject: [PATCH 4/5] Bump Version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 318fe06..ed34102 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="jupiterone", - version="2.0.1", + version="2.1.0", description="A Python client for the JupiterOne API", license="MIT License", author="JupiterOne", From c2f74059f06827dfb07901cd056587ba1183cabc Mon Sep 17 00:00:00 2001 From: hmcguire443 Date: Thu, 6 Nov 2025 13:33:38 -0600 Subject: [PATCH 5/5] add abort example to README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 2e87557..92e2d3c 100644 --- a/README.md +++ b/README.md @@ -531,6 +531,17 @@ result = j1.upload_combined_batch_json( print(f"Uploaded {len(combined_payload['entities'])} entities and {len(combined_payload['relationships'])} relationships") ``` +##### Abort Synchronization Job +```python +# Abort the sync job +result = j1.abort_sync_job(instance_job_id='') +print(f"Abort sync job: {result['status'].get('id')}") + +# Check job status +if result['job']['status'] == 'ABORTED': + print("Sync job Abort successfully") +``` + ##### Finalize Synchronization Job ```python