Skip to content

Commit

Permalink
Merge pull request #6 from splunk-soar-connectors/next
Browse files Browse the repository at this point in the history
Merging next to main for release 2.1.0
  • Loading branch information
mpan-splunk authored Mar 4, 2022
2 parents aeb993b + 710939b commit 534bcd9
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/start-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Start Release
on: workflow_dispatch
on:
workflow_dispatch:
push:
tags:
- '*-beta*'
jobs:
start-release:
runs-on: ubuntu-latest
Expand Down
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.8
rev: v1.9
hooks:
- id: org-hook
- id: package-app-dependencies
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# F5 BIG\-IP LTM

Publisher: Splunk
Connector Version: 2\.0\.8
Connector Version: 2\.1\.0
Product Vendor: F5
Product Name: Local Traffic Manager
Product Version Supported (regex): "\.\*"
Minimum Product Version: 4\.6\.19142
Minimum Product Version: 5\.1\.0

This app implements investigate and generic actions to integrate with an F5 BIG\-IP LTM instance to manage pools and nodes

Expand All @@ -26,6 +26,7 @@ VARIABLE | REQUIRED | TYPE | DESCRIPTION
[delete node](#action-delete-node) - Delete a node
[remove node](#action-remove-node) - Remove a node from a pool
[create pool](#action-create-pool) - Create a new pool
[delete pool](#action-delete-pool) - Delete an existing pool
[add node](#action-add-node) - Add an existing node to a pool
[disable node](#action-disable-node) - Disable a node
[enable node](#action-enable-node) - Enable a node
Expand Down Expand Up @@ -195,6 +196,28 @@ action\_result\.message | string |
summary\.total\_objects | numeric |
summary\.total\_objects\_successful | numeric |

## action: 'delete pool'
Delete an existing pool

Type: **generic**
Read only: **False**

#### Action Parameters
PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
--------- | -------- | ----------- | ---- | --------
**pool\_name** | required | Name of the pool to delete | string | `f5 pool name`

#### Action Output
DATA PATH | TYPE | CONTAINS
--------- | ---- | --------
action\_result\.status | string |
action\_result\.parameter\.pool\_name | string | `f5 pool name`
action\_result\.data | string |
action\_result\.summary\.pool\_name | string | `f5 pool name`
action\_result\.message | string |
summary\.total\_objects | numeric |
summary\.total\_objects\_successful | numeric |

## action: 'add node'
Add an existing node to a pool

Expand Down
88 changes: 85 additions & 3 deletions f5bigipltm.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"product_version_regex": ".*",
"publisher": "Splunk",
"license": "Copyright (c) 2019-2022 Splunk Inc.",
"app_version": "2.0.8",
"app_version": "2.1.0",
"python_version": "3",
"fips_compliant": true,
"utctime_updated": "2022-01-19T00:53:17.000000Z",
"package_name": "phantom_f5bigipltm",
"main_module": "f5bigipltm_connector.py",
"min_phantom_version": "4.6.19142",
"min_phantom_version": "5.1.0",
"app_wizard_version": "1.0.0",
"latest_tested_versions": [
"BIG-IP 15.0.0 Build 0.0.39 Final"
Expand Down Expand Up @@ -884,6 +884,88 @@
},
"versions": "EQ(*)"
},
{
"action": "delete pool",
"identifier": "delete_pool",
"description": "Delete an existing pool",
"type": "generic",
"read_only": false,
"parameters": {
"pool_name": {
"description": "Name of the pool to delete",
"data_type": "string",
"required": true,
"primary": true,
"contains": [
"f5 pool name"
],
"order": 0
}
},
"output": [
{
"data_path": "action_result.status",
"data_type": "string",
"column_name": "Status",
"column_order": 1,
"example_values": [
"success",
"failed"
]
},
{
"data_path": "action_result.parameter.pool_name",
"data_type": "string",
"column_name": "Node Name",
"column_order": 0,
"example_values": [
"gonna-delete-this"
],
"contains": [
"f5 pool name"
]
},
{
"data_path": "action_result.data",
"data_type": "string"
},
{
"data_path": "action_result.summary.pool_name",
"data_type": "string",
"example_values": [
"gonna-delete-this"
],
"contains": [
"f5 pool name"
]
},
{
"data_path": "action_result.message",
"data_type": "string",
"example_values": [
"Successfully deleted pool"
]
},
{
"data_path": "summary.total_objects",
"data_type": "numeric",
"example_values": [
1
]
},
{
"data_path": "summary.total_objects_successful",
"data_type": "numeric",
"example_values": [
1
]
}
],
"render": {
"type": "table"
},
"versions": "EQ(*)"
},
{
"action": "add node",
"identifier": "add_node",
Expand Down Expand Up @@ -3198,4 +3280,4 @@
}
]
}
}
}
24 changes: 24 additions & 0 deletions f5bigipltm_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,27 @@ def _handle_create_pool(self, param):

return action_result.set_status(phantom.APP_SUCCESS, "Successfully created pool")

def _handle_delete_pool(self, param):

self.save_progress("In action handler for: {0}".format(self.get_action_identifier()))

action_result = self.add_action_result(ActionResult(dict(param)))

pool_name = self._handle_py_ver_compat_for_input_str(self._python_version, param['pool_name'])

# make rest call
ret_val, response = self._make_rest_call('/mgmt/tm/ltm/pool/{0}'.format(pool_name), action_result, method="delete")

if phantom.is_fail(ret_val):
return action_result.get_status()

action_result.add_data({})

summary = action_result.update_summary({})
summary['pool_name'] = pool_name

return action_result.set_status(phantom.APP_SUCCESS, "Successfully deleted pool")

def _handle_list_members(self, param):

self.save_progress("In action handler for: {0}".format(self.get_action_identifier()))
Expand Down Expand Up @@ -652,6 +673,9 @@ def handle_action(self, param):
elif action_id == 'create_pool':
ret_val = self._handle_create_pool(param)

elif action_id == 'delete_pool':
ret_val = self._handle_delete_pool(param)

elif action_id == 'create_node':
ret_val = self._handle_create_node(param)

Expand Down

0 comments on commit 534bcd9

Please sign in to comment.