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
9 changes: 5 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
irflow-sdk-python changelog

* v1.0.5 - Initial Release
* v1.0.6 - Add option to pass in config_args in addition to specifiying a path to api.conf
* v1.0.6 - Add option to pass in config_args in addition to specifiying a path to api.conf
* v1.0.7 - Parenthesis and helper text fix
* v1.1.1 - Added support for IR-Flow 4.1 (api changes), Python 3 compatibility
* v1.1.2 - Fixed module import to work better dynamically
Expand All @@ -13,8 +13,8 @@ irflow-sdk-python changelog
* v1.1.10 - Fix MANIFEST.in
* v1.1.12 - Fix method attach_alert_to_incident (was the inverse)
* v1.2.0
* Add docstrings to irflow_client for RTD build
* Bump version to align with IR-Flow Version.
* Add docstrings to irflow_client for RTD build
* Bump version to align with IR-Flow Version.
* Added get_version endpoint
* added requirements.txt freeze,
* created readthedocs site
Expand All @@ -30,7 +30,7 @@ irflow-sdk-python changelog
* v1.5.4 remove sys.exit()
* Fix CI workflow
* detect http 503 (IR-Flow Offline)
* fix debug logging
* fix debug logging
* Fix update_incident function to added owner and group IDs
* Converted to Apache 2.0 license
* v1.5.5 Test build
Expand All @@ -46,3 +46,4 @@ irflow-sdk-python changelog
* Bump certifi to 2019.6.16
* Bump urllib3>=1.24.3 (CVE-2019-9740)
* v1.6.1 Bump bleach version to patch moderate severity XSS issues: https://github.com/Syncurity/irflow-sdk-python/pull/84
* v1.6.2 Added priority_id and owner_id parameters to create_incident and update_incident calls
5 changes: 2 additions & 3 deletions irflow_client/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
__title__ = 'irflow_client'
__description__ = 'A python client for Syncurity IR-Flow'
__url__ = 'https://syncurity.net'
__version__ = '1.6.1'
__version__ = '1.6.2'
__build__ = ''
__author__ = 'Syncurity'
__author_email__ = '[email protected]'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2019 Syncurity'
__copyright__ = 'Copyright 2020 Syncurity'
__cake__ = u''

13 changes: 11 additions & 2 deletions irflow_client/irflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ def create_alert(self, alert_fields, description=None, incoming_field_group_name
return response.json()

def create_incident(self, incident_type_name, incident_fields=None,
incident_subtype_name=None, description=None):
incident_subtype_name=None, description=None,
priority_id=None, owner_id=None):
"""Create an incident of the desired type and subtype with the specified fields
and description

Expand All @@ -530,6 +531,8 @@ def create_incident(self, incident_type_name, incident_fields=None,
incident_fields (dict): Key, Value pairs of fields configured in IR-Flow and
their values (optional)
description (str): An optional string description for the incident
priority_id (str): ID of the priority to set
owner_id (str): ID of the user to set incident owner to
"""
url = '%s://%s/%s' % (self.protocol, self.address, self.end_points['create_incident'])
params = {
Expand All @@ -545,6 +548,10 @@ def create_incident(self, incident_type_name, incident_fields=None,
params['incident_subtype_name'] = incident_subtype_name
if description is not None:
params['description'] = description
if priority_id is not None:
params['priority_id'] = priority_id
if owner_id is not None:
params['owner_id'] = owner_id

if self.debug:
self.dump_request_debug_info('Create Incident', url, headers=headers, params=params)
Expand Down Expand Up @@ -582,7 +589,7 @@ def get_incident(self, incident_num):
return response.json()

def update_incident(self, incident_num, incident_fields, incident_type_name,
owner_id, group_ids, incident_subtype_name=None, description=None):
owner_id, group_ids, incident_subtype_name=None, description=None, priority_id=None):
"""Update the incident of the provided number, type, and subtype with the provided
fields and description

Expand Down Expand Up @@ -617,6 +624,8 @@ def update_incident(self, incident_num, incident_fields, incident_type_name,
params['incident_subtype_name'] = incident_subtype_name
if description is not None:
params['description'] = description
if priority_id is not None:
params['priority_id'] = priority_id

if self.debug:
self.dump_request_debug_info('Update Incident', url, headers=headers, params=params)
Expand Down