Skip to content

Commit

Permalink
Merge pull request #10 from splunk-soar-connectors/next
Browse files Browse the repository at this point in the history
Merging next to main for release 3.0.0
  • Loading branch information
ishans-crest authored Oct 30, 2024
2 parents aa51f71 + 8d8f04e commit 40ef837
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.22
rev: v1.23
hooks:
- id: org-hook
- id: package-app-dependencies
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[comment]: # "Auto-generated SOAR connector documentation"
# PagerDuty

Publisher: Splunk
Connector Version: 2.0.7
Publisher: Splunk Community
Connector Version: 3.0.0
Product Vendor: PagerDuty
Product Name: PagerDuty
Product Version Supported (regex): ".\*"
Minimum Product Version: 6.2.1
Minimum Product Version: 6.2.2

This app integrates with PagerDuty to implement investigative and ticketing actions

Expand Down
6 changes: 3 additions & 3 deletions pagerduty.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"appid": "932c09b3-e09d-40ff-a2b7-b090f7468c54",
"name": "PagerDuty",
"description": "This app integrates with PagerDuty to implement investigative and ticketing actions",
"publisher": "Splunk",
"publisher": "Splunk Community",
"package_name": "phantom_pagerduty",
"type": "ticketing",
"license": "Copyright (c) 2016-2024 Splunk Inc.",
"main_module": "pagerduty_connector.py",
"app_version": "2.0.7",
"app_version": "3.0.0",
"utctime_updated": "2024-10-01T07:26:12.000000Z",
"product_vendor": "PagerDuty",
"product_name": "PagerDuty",
"product_version_regex": ".*",
"min_phantom_version": "6.2.1",
"min_phantom_version": "6.2.2",
"fips_compliant": true,
"logo": "logo_pagerduty.svg",
"logo_dark": "logo_pagerduty_dark.svg",
Expand Down
16 changes: 16 additions & 0 deletions pagerduty_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ def _paginator(self, endpoint, action_result):
def _handle_list_oncalls(self, param):

# Add an action result to the App Run
self.debug_print("Running action - list oncalls")
action_result = self.add_action_result(ActionResult(dict(param)))

result_list = self._paginator("/oncalls?", action_result)

if phantom.is_fail(result_list):
self.debug_print("Action 'list oncalls' failed")
return action_result.get_status()

for oncall in result_list:
Expand All @@ -276,11 +278,13 @@ def _handle_list_oncalls(self, param):
def _handle_list_teams(self, param):

# Add an action result to the App Run
self.debug_print("Running action - list teams")
action_result = self.add_action_result(ActionResult(dict(param)))

result_list = self._paginator("/teams?", action_result)

if phantom.is_fail(result_list):
self.debug_print("Action 'list teams' failed")
return action_result.get_status()

for team in result_list:
Expand All @@ -293,6 +297,7 @@ def _handle_list_teams(self, param):
def _handle_list_services(self, param):

# Add an action result to the App Run
self.debug_print("Running action - list services")
action_result = self.add_action_result(ActionResult(dict(param)))

str_endpoint = ""
Expand All @@ -311,6 +316,7 @@ def _handle_list_services(self, param):
result_list = self._paginator(endpoint, action_result)

if phantom.is_fail(result_list):
self.debug_print("Action 'list services' failed")
return action_result.get_status()

for service in result_list:
Expand All @@ -323,6 +329,7 @@ def _handle_list_services(self, param):
def _handle_list_users(self, param):

# Add an action result to the App Run
self.debug_print("Running action - list users")
action_result = self.add_action_result(ActionResult(dict(param)))

str_endpoint = ""
Expand All @@ -341,6 +348,7 @@ def _handle_list_users(self, param):
result_list = self._paginator(endpoint, action_result)

if phantom.is_fail(result_list):
self.debug_print("Action 'list users' failed")
return action_result.get_status()

for user in result_list:
Expand All @@ -354,6 +362,7 @@ def _handle_list_escalations(self, param):

# Add an action result to the App Run
action_result = self.add_action_result(ActionResult(dict(param)))
self.debug_print("Running action - list escalations")

str_endpoint = ""
if param.get("team_ids"):
Expand Down Expand Up @@ -382,6 +391,7 @@ def _handle_list_escalations(self, param):
result_list = self._paginator(endpoint, action_result)

if phantom.is_fail(result_list):
self.debug_print("Action 'list escalations' failed")
return action_result.get_status()

if result_list is None:
Expand All @@ -397,6 +407,7 @@ def _handle_list_escalations(self, param):
def _handle_create_incident(self, param):

# Add an action result to the App Run
self.debug_print("Running action - create incident")
action_result = self.add_action_result(ActionResult(dict(param)))

body = {
Expand All @@ -420,6 +431,7 @@ def _handle_create_incident(self, param):
ret_val, resp_data = self._make_rest_call("/incidents", action_result, data=body, headers=headers, method="post")

if phantom.is_fail(ret_val):
self.debug_print("Action 'create incident' failed")
return action_result.get_status()

action_result.add_data(resp_data)
Expand All @@ -432,6 +444,7 @@ def _handle_get_oncall_user(self, param):

# Add an action result to the App Run
action_result = self.add_action_result(ActionResult(dict(param)))
self.debug_print("Running action - get oncall user")

# Setup params
params = {"escalation_policy_ids[]": param["escalation_id"]}
Expand All @@ -455,6 +468,7 @@ def _handle_get_oncall_user(self, param):
ret_val, resp_data_user = self._make_rest_call("/users/{0}".format(user_id), action_result, params={})

if phantom.is_fail(ret_val):
self.debug_print("Action 'get oncall users' failed")
return action_result.get_status()

user["user"] = resp_data_user.get("user")
Expand All @@ -464,6 +478,7 @@ def _handle_get_oncall_user(self, param):

def _handle_get_user_info(self, param):

self.debug_print("Running action - get user info")
# Add an action result to the App Run
action_result = self.add_action_result(ActionResult(dict(param)))

Expand All @@ -472,6 +487,7 @@ def _handle_get_user_info(self, param):
ret_val, resp_data = self._make_rest_call("/users/{0}".format(user_id), action_result, params={})

if phantom.is_fail(ret_val):
self.debug_print("Action 'get user info' failed")
return action_result.get_status()

try:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ verbose = true

[tool.isort]
line_length = 145
profile = "black"
1 change: 1 addition & 0 deletions release_notes/3.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* De-certify and release as Splunk Community App[PAPP-34998]
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[flake8]
max-line-length = 145
max-complexity = 28
extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D

[isort]
line_length = 145
extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D,W503

0 comments on commit 40ef837

Please sign in to comment.