Skip to content

Commit 745a627

Browse files
committed
Add function to abort sync job
1 parent fb7f375 commit 745a627

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

jupiterone/client.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def bulk_delete_entities(
951951
return response
952952

953953
def finalize_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]:
954-
"""Start a synchronization job.
954+
"""Finalize a synchronization job.
955955
956956
args:
957957
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,
964964

965965
return response
966966

967+
def abort_sync_job(self, instance_job_id: Optional[str] = None) -> Dict[str, Any]:
968+
"""Abort a synchronization job.
969+
970+
args:
971+
instance_job_id (str): The "Job ID" for the Custom Integration job to abort
972+
"""
973+
endpoint = f"/persister/synchronization/jobs/{instance_job_id}/abort"
974+
975+
data = {}
976+
977+
response = self._execute_syncapi_request(endpoint=endpoint, payload=data)
978+
979+
return response
980+
967981
def fetch_integration_jobs(self, instance_id: Optional[str] = None) -> List[Dict[str, Any]]:
968982
"""Fetch Integration Job details from defined integration instance.
969983

0 commit comments

Comments
 (0)