diff --git a/fmcapi/api_objects/__init__.py b/fmcapi/api_objects/__init__.py index c78db7b..f1013de 100644 --- a/fmcapi/api_objects/__init__.py +++ b/fmcapi/api_objects/__init__.py @@ -110,6 +110,9 @@ from .policy_services import ConnectionProfiles from .policy_services import DynamicAccessPolicies from .object_services import TimeRanges +from .health import TunnelStatuses +from .health import TunnelDetails +from .health import TunnelSummaries logging.debug("In the api_objects __init__.py file.") @@ -218,4 +221,7 @@ "ConnectionProfiles", "DynamicAccessPolicies", "TimeRanges", + "TunnelStatuses", + "TunnelDetails", + "TunnelSummaries", ] diff --git a/fmcapi/api_objects/health/__init__.py b/fmcapi/api_objects/health/__init__.py index b3b1193..8814a9b 100644 --- a/fmcapi/api_objects/health/__init__.py +++ b/fmcapi/api_objects/health/__init__.py @@ -2,6 +2,9 @@ import logging from .terminateravpnsessions import TerminateRAVPNSessions +from .tunnelstatuses import TunnelStatuses +from .tunneldetails import TunnelDetails +from .tunnelsummaries import TunnelSummaries logging.debug("In the health __init__.py file.") diff --git a/fmcapi/api_objects/health/tunneldetails.py b/fmcapi/api_objects/health/tunneldetails.py new file mode 100644 index 0000000..5ed5f04 --- /dev/null +++ b/fmcapi/api_objects/health/tunneldetails.py @@ -0,0 +1,47 @@ +from fmcapi.api_objects.apiclasstemplate import APIClassTemplate +import logging + + +class TunnelDetails(APIClassTemplate): + """The TunnelDetails Object in the FMC.""" + + FIRST_SUPPORTED_FMC_VERSION = "7.3" + REQUIRED_FOR_GET = ["container_uuid"] + VALID_JSON_DATA = [ + "type", + "peerA", + "peerB", + ] + + VALID_FOR_KWARGS = VALID_JSON_DATA + ["container_uuid"] + + URL_SUFFIX = f"/health/tunnelstatuses" + + def __init__(self, fmc, **kwargs): + """ + Initialize TunnelDetails object. + + :param fmc (object): FMC object + :param **kwargs: Any other values passed during instantiation. + :return: requests response + """ + super().__init__(fmc, **kwargs) + logging.debug("In __init__() for TunnelDetails class.") + self.parse_kwargs(**kwargs) + URL_CONTAINER_SUFFIX = f"/{self.container_uuid}/tunneldetails" + self.URL = self.URL + URL_CONTAINER_SUFFIX + + def delete(self, **kwargs): + """DELETE method for API for TunnelDetails not supported.""" + logging.info("DELETE method for API for TunnelDetails not supported.") + pass + + def put(self): + """PUT method for API for TunnelDetails not supported.""" + logging.info("PUT method for API for TunnelDetails not supported.") + pass + + def post(self, **kwargs): + """POST method for API for TunnelDetails not supported.""" + logging.info("POST method for API for TunnelDetails not supported.") + pass \ No newline at end of file diff --git a/fmcapi/api_objects/health/tunnelstatuses.py b/fmcapi/api_objects/health/tunnelstatuses.py new file mode 100644 index 0000000..adcd3b3 --- /dev/null +++ b/fmcapi/api_objects/health/tunnelstatuses.py @@ -0,0 +1,54 @@ +from fmcapi.api_objects.apiclasstemplate import APIClassTemplate +import logging + + +class TunnelStatuses(APIClassTemplate): + """The TunnelStatuses Object in the FMC.""" + + FIRST_SUPPORTED_FMC_VERSION = "7.3" + VALID_JSON_DATA = [ + "id", + "type", + "state", + "lastChange", + "vpnTopology", + "peerA", + "peerB", + ] + VALID_GET_FILTERS = [ + "vpnTopologyId", # vpnTopologyId: uuid of vpn topo + "deviceId", # deviceId: uuid of device + "status", # status: TUNNEL_UP|TUNNEL_DOWN|UNKNOWN + "deployedStatus", # deployedStatus: Deployed|Configured|Both + "sortBy", # sortBy: :|<|> Topology|Device|Status|LastChange (sortBy