firewall: Get service ports details

Add interface to get port types and numbers for a service.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2019-04-28 20:59:15 -07:00
1 parent 51fc87f1bc
commit e5081018a3
2 files changed
+23 -2

No files matched your search

+7
View File
@@ -95,6 +95,13 @@ def get_enabled_services(zone):
return output.split()
def get_port_details(service_port):
"""Return the port types and numbers for a service port"""
output = _run(
['get-service-ports', '--service', service_port], superuser=True)
return output.split()
def get_interfaces(zone):
"""Return the list of interfaces in a zone."""
output = _run(['get-interfaces', '--zone', zone], superuser=True)