Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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='<id-of-integration-sync-job>')
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
Expand Down
16 changes: 15 additions & 1 deletion jupiterone/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading