Skip to content

Status

status-related endpoints

StatusMixin

Bases: BasePFSenseAPIClient

status calls

Source code in pfsense_api_client/status.py
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
class StatusMixin(BasePFSenseAPIClient):
    """ status calls """
    def get_carp_status(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-carp-status"""
        url = "/api/v1/status/carp"
        return self.call(url, payload=filterargs)


    @pydantic.validate_arguments()
    def update_carp_status(
        self, enable: Optional[bool], maintenance_mode: Optional[bool]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-update-carp-status"""
        url = "/api/v1/status/carp"
        method = "PUT"
        payload = {}
        if enable is not None:
            payload["enable"] = enable
        if maintenance_mode is not None:
            payload["maintenance_mode"] = maintenance_mode
        return self.call(url=url, method=method, payload=payload)


    def get_gateway_status(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-gateway-status"""
        url = "/api/v1/status/gateway"
        return self.call(url, payload=filterargs)


    def get_interface_status(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-interface-status"""
        url = "/api/v1/status/interface"
        return self.call(url, payload=filterargs)


    def get_configuration_history_status_log(
        self,
        **filterargs: Dict[str, Any],
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-configuration-history-status-log"""
        url = "/api/v1/status/log/config_history"
        return self.call(url, payload=filterargs)


    def get_dhcp_status_log(
        self, **filterargs: Dict[str, Any]
    ) -> APIResponse:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-read-dhcp-status-log"""
        url = "/api/v1/status/log/dhcp"
        return self.call_api(url, payload=filterargs)


    def get_firewall_status_log(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#3-read-firewall-status-log"""
        url = "/api/v1/status/log/firewall"
        return self.call(url, payload=filterargs)


    def get_system_status_log(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#4-read-system-status-log"""
        url = "/api/v1/status/log/system"
        return self.call(url, payload=filterargs)


    def get_openvpn_status(
        self, **filterargs: Dict[str, Any]
    ) -> requests.Response:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-openvpn-status"""
        url = "/api/v1/status/openvpn"
        return self.call(url, payload=filterargs)


    def get_system_status(
        self, **filterargs: Dict[str, Any]
    ) -> APIResponseDict:
        """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-system-status"""
        url = "/api/v1/status/system"
        result = APIResponseDict.parse_obj(self.call_json(url, payload=filterargs))
        return result

get_carp_status(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-carp-status

Source code in pfsense_api_client/status.py
17
18
19
20
21
22
def get_carp_status(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-carp-status"""
    url = "/api/v1/status/carp"
    return self.call(url, payload=filterargs)

get_configuration_history_status_log(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-configuration-history-status-log

Source code in pfsense_api_client/status.py
56
57
58
59
60
61
62
def get_configuration_history_status_log(
    self,
    **filterargs: Dict[str, Any],
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-configuration-history-status-log"""
    url = "/api/v1/status/log/config_history"
    return self.call(url, payload=filterargs)

get_dhcp_status_log(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-read-dhcp-status-log

Source code in pfsense_api_client/status.py
65
66
67
68
69
70
def get_dhcp_status_log(
    self, **filterargs: Dict[str, Any]
) -> APIResponse:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-read-dhcp-status-log"""
    url = "/api/v1/status/log/dhcp"
    return self.call_api(url, payload=filterargs)

get_firewall_status_log(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#3-read-firewall-status-log

Source code in pfsense_api_client/status.py
73
74
75
76
77
78
def get_firewall_status_log(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#3-read-firewall-status-log"""
    url = "/api/v1/status/log/firewall"
    return self.call(url, payload=filterargs)

get_gateway_status(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-gateway-status

Source code in pfsense_api_client/status.py
40
41
42
43
44
45
def get_gateway_status(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-gateway-status"""
    url = "/api/v1/status/gateway"
    return self.call(url, payload=filterargs)

get_interface_status(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-interface-status

Source code in pfsense_api_client/status.py
48
49
50
51
52
53
def get_interface_status(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-interface-status"""
    url = "/api/v1/status/interface"
    return self.call(url, payload=filterargs)

get_openvpn_status(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-openvpn-status

Source code in pfsense_api_client/status.py
89
90
91
92
93
94
def get_openvpn_status(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-openvpn-status"""
    url = "/api/v1/status/openvpn"
    return self.call(url, payload=filterargs)

get_system_status(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-system-status

Source code in pfsense_api_client/status.py
 97
 98
 99
100
101
102
103
def get_system_status(
    self, **filterargs: Dict[str, Any]
) -> APIResponseDict:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#1-read-system-status"""
    url = "/api/v1/status/system"
    result = APIResponseDict.parse_obj(self.call_json(url, payload=filterargs))
    return result

get_system_status_log(**filterargs)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#4-read-system-status-log

Source code in pfsense_api_client/status.py
81
82
83
84
85
86
def get_system_status_log(
    self, **filterargs: Dict[str, Any]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#4-read-system-status-log"""
    url = "/api/v1/status/log/system"
    return self.call(url, payload=filterargs)

update_carp_status(enable, maintenance_mode)

https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-update-carp-status

Source code in pfsense_api_client/status.py
25
26
27
28
29
30
31
32
33
34
35
36
37
@pydantic.validate_arguments()
def update_carp_status(
    self, enable: Optional[bool], maintenance_mode: Optional[bool]
) -> requests.Response:
    """https://github.com/jaredhendrickson13/pfsense-api/blob/master/README.md#2-update-carp-status"""
    url = "/api/v1/status/carp"
    method = "PUT"
    payload = {}
    if enable is not None:
        payload["enable"] = enable
    if maintenance_mode is not None:
        payload["maintenance_mode"] = maintenance_mode
    return self.call(url=url, method=method, payload=payload)