Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service Group feature #66

Merged
merged 3 commits into from
May 14, 2024
Merged

Service Group feature #66

merged 3 commits into from
May 14, 2024

Conversation

mamullen13316
Copy link
Collaborator

@mamullen13316 mamullen13316 commented May 14, 2024

Added ability to get/create/update Service Groups.

  • get_service_group()
  • create_service_group()
  • update_service_group()

Also made description an optional argument across all methods.

>>> fw.create_service(name="test_svc1", service_type="TCPorUDP", service_list=[{"dst_port": "1111", "protocol": "tcp"}])
Out[5]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'Services': {'@transactionid': '',
   'Status': {'@code': '200',
    '#text': 'Configuration applied successfully.'}}}}

>>> fw.create_service(name="test_svc2", service_type="TCPorUDP", service_list=[{"dst_port": "2222", "protocol": "tcp"}])
Out[6]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'Services': {'@transactionid': '',
   'Status': {'@code': '200',
    '#text': 'Configuration applied successfully.'}}}}

>>> fw.create_service_group(name="test_sg1", service_list=["test_svc1"])
Out[7]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'ServiceGroup': {'@transactionid': '',
   'Status': {'@code': '200',
    '#text': 'Configuration applied successfully.'}}}}

>>> fw.get_service_group(name="test_sg1")
Out[8]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'ServiceGroup': {'@transactionid': '',
   'Name': 'test_sg1',
   'Description': None,
   'ServiceList': {'Service': 'test_svc1'}}}}

>>> fw.update_service_group(name="test_sg1", service_list=["test_svc2"])
Out[9]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'ServiceGroup': {'@transactionid': '',
   'Status': {'@code': '200',
    '#text': 'Configuration applied successfully.'}}}}

>>> fw.get_service_group(name="test_sg1")
Out[10]: 
{'Response': {'@APIVersion': '2000.2',
  '@IPS_CAT_VER': '1',
  '@IS_WIFI6': '0',
  'Login': {'status': 'Authentication Successful'},
  'ServiceGroup': {'@transactionid': '',
   'Name': 'test_sg1',
   'Description': None,
   'ServiceList': {'Service': ['test_svc1', 'test_svc2']}}}}

@mamullen13316 mamullen13316 merged commit fd3e7a1 into main May 14, 2024
6 checks passed
@mamullen13316 mamullen13316 deleted the service_group branch May 14, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant