RESTAPI
Table of Contents
Classes
- BasicAuth
- Defines an Auth class that allows for Basic authentication against the pfSense local user database.
- JWTAuth
- Defines an Auth class that allows for JWT authentication against the pfSense REST API.
- KeyAuth
- Defines an Auth class that allows for API key authentication against the pfSense REST API. Key auth is better suited to distribute to systems as they are revocable and will only allow API authentication; not webConfigurator or SSH authentication (like the local database credentials).
- AvailablePackageCache
- Defines a Cache for available pfSense package information obtained from the pfSense package repos.
- PrivilegesCache
- Defines a Cache that is responsible for obtaining the privileges for REST API Endpoints and Forms and caching them to a centralized location where it can be read by /etc/inc/priv/restapi.priv.inc.
- RESTAPIVersionReleasesCache
- Defines a Cache that can be used to update the available pfSense-pkg-RESTAPI releases cache. This Cache runs on a schedule to periodically update the releases cache in the background.
- BinaryContentHandler
- Defines a ContentHandler for handling binary data. This is primarily used to handle file downloads.
- JSONContentHandler
- Defines a ContentHandler for JSON data. This handler is responsible for encoding and decoding JSON data for the REST API and corresponds with the 'application/json' MIME type.
- URLContentHandler
- Defines a ContentHandler for URL encoded data. This handler is responsible for decoding URL encoded data for the REST API and corresponds with the 'application/x-www-form-urlencoded' MIME type.
- Auth
- Defines object that performs authentication and authorization for REST API Endpoints and obtains details about the authenticating client. This class is intended to be extended by child classes that define specific authentication methods.
- Cache
- Defines a Cache object. Cache objects are a type of Dispatcher object that is intended to fetch data from an external source and store the output to a local cache file that periodically gets updated. This is helpful when handling data that may take a long time to populate, or data that may have upstream rate limits that need to be respected.
- Command
- Defines an object that executes shell commands and keeps track of the output and result codes.
- ContentHandler
- Defines a class that is responsible for decoding request content from remote clients, and encoding response content to be sent to the remote client. Children of this class must correspond with the valid HTTP MIME type this ContentHandler is designed to interact with.
- Dispatcher
- Defines a Dispatcher object which defines functions that are intended to run in the background. The Dispatcher objects allows us to dynamically create a private PHP script that can be called in the background, manages the process spawn queue, and enforces background process timeouts.
- Endpoint
- Defines an API Endpoint, encapsulating attributes essential for generating the PHP endpoint in the pfSense webroot, and facilitating API calls. Endpoints are also responsible for defining authentication requirements, request methods available, and allows customizing the generated OpenAPI documentation for the endpoint.
- Field
- Defines Model Fields and their attributes. Field's define how value should be obtained on pfSense internally, and converted into its representation form. Fields are also responsible for validation of this Field's value. This includes strict type validation, choice options, whether the value can be null or empty, etc. Field's can also be assigned custom Validator objects to add custom validation to the Field. Field's must be assigned as a properties Model objects.
- Form
- Defines a Form object that can be used to dynamically generate custom pfSense webConfigurator pages for a specified Model object.
- Model
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- ModelSet
- Defines a ModelSet object that acts as a container for multiple Model objects. This can be used to represent a set of Model objects at once. Additionally, ModelSets can be further filtered using queries.
- QueryFilter
- Defines a query filter that can be used to further filter a ModelSet's 'model_objects'.
- ResourceLink
- Defines a ResourceLink object that represents a HAL link object. These objects are primarily used by Endpoint classes to populate HAL links for objects that are related to the API call the Endpoint is serving.
- ResourceLinkSet
- Defines a class that allows the storage and processing of many ResourceLink objects at once.
- Response
- Defines the API response object. Response objects are throwable objects that contain response information such as HTTP status code, HTTP status message, API return code, error messages, and API response data. All API Error classes will originate as Response objects.
- Schema
- Defines a class that is used to represent a specific schema for this API. This class is intended to be extended by a child class to implement custom schema definitions using Endpoints, Models and Fields defined in this package.
- TestCase
- Defines a TestCase object that can be used to define child TestCase classes that test internal functionality of the API. This is needed because pfSense does not have PHPUnit readily available.
- Validator
- Defines a Validator object which Field objects can use to quickly validate its value.
- ACMEAccountKeyRegisterDispatcher
- Defines a Dispatcher for registering a given ACME account key with the ACME package.
- ACMECertificateIssueDispatcher
- Defines a Dispatcher for issuing a new ACME certificate.
- ACMECertificateRenewDispatcher
- Defines a Dispatcher for renewing/signing an ACME certificate.
- BINDApplyDispatcher
- Defines a Dispatcher for applying changes to the BIND settings.
- DHCPServerApplyDispatcher
- Defines a Dispatcher for applying changes to the DHCP server configuration.
- DNSForwarderApplyDispatcher
- Defines a Dispatcher object which defines functions that are intended to run in the background. The Dispatcher objects allows us to dynamically create a private PHP script that can be called in the background, manages the process spawn queue, and enforces background process timeouts.
- DNSResolverApplyDispatcher
- Defines a Dispatcher for applying changes to the DNS Resolver configuration.
- FirewallApplyDispatcher
- Defines a Dispatcher for applying changes to the firewall filter configuration.
- FirewallStateTableResetDispatcher
- Defines a Dispatcher for resetting the state table. This dispatcher allows the state table to be reset in the background and on a delay to prevent the API from hanging or timing out while the state table is being reset.
- HAProxyApplyDispatcher
- Defines a Dispatcher for applying changes to the HAProxy settings.
- InterfaceApplyDispatcher
- Defines a Dispatcher for applying changes to interface configurations.
- IPsecApplyDispatcher
- Defines a Dispatcher for applying changes to the IPsec configuration.
- RESTAPISettingsSyncDispatcher
- Defines a Dispatcher for syncing REST API settings to HA peers.
- RoutingApplyDispatcher
- Defines a Dispatcher for applying changes to the routing configuration.
- SystemHaltDispatcher
- Defines a Dispatcher for shutting down the system.
- SystemHostnameApplyDispatcher
- Defines a Dispatcher for applying changes to the system hostname configuration.
- SystemRebootDispatcher
- Defines a Dispatcher for rebooting the system.
- TrafficShaperApplyDispatcher
- Defines a Dispatcher that applies pending Traffic Shaper changes.
- VirtualIPApplyDispatcher
- Defines a Dispatcher for applying changes to the WireGuard configuration.
- WebGUIRestartDispatcher
- Defines a Dispatcher for restarting the web GUI.
- WireGuardApplyDispatcher
- Defines a Dispatcher for applying changes to the WireGuard configuration.
- AuthJWTEndpoint
- Defines an Endpoint for interacting with singular RESTAPIJWT Model objects at /api/v2/auth/jwt.
- AuthKeyEndpoint
- Defines an Endpoint for interacting with singular RESTAPIKey Model objects at /api/v2/auth/key.
- AuthKeysEndpoint
- Defines an Endpoint for interacting with many RESTAPIKey Model objects at /api/v2/auth/key.
- DiagnosticsARPTableEndpoint
- Defines an Endpoint for interacting with many ARPTable Model objects at /api/v2/diagnostics/arp_table.
- DiagnosticsARPTableEntryEndpoint
- Defines an Endpoint for interacting with singular ARPTable Model objects at /api/v2/diagnostics/arp_table/entry.
- DiagnosticsCommandPromptEndpoint
- Defines an Endpoint for interacting with singular CommandPrompt Model objects at /api/v2/diagnostics/command_prompt.
- DiagnosticsConfigHistoryRevisionEndpoint
- Defines an Endpoint for interacting with a single ConfigHistoryRevision Model at /api/v2/diagnostics/config_history/revision.
- DiagnosticsConfigHistoryRevisionsEndpoint
- Defines an Endpoint for interacting with many ConfigHistoryRevision Models at /api/v2/diagnostics/config_history/revisions.
- DiagnosticsHaltSystemEndpoint
- Defines an Endpoint for interacting with singular SystemHalt Model objects at /api/v2/diagnostics/halt_system.
- DiagnosticsRebootEndpoint
- Defines an Endpoint for interacting with singular SystemReboot Model objects at /api/v2/diagnostics/reboot.
- FirewallAdvancedSettingsEndpoint
- Defines an Endpoint for interacting with a singular FirewallAdvancedSettings Model object at /api/v2/firewall/advanced_settings.
- FirewallAliasEndpoint
- Defines an Endpoint for interacting with many FirewallAlias Model objects at /api/v2/firewall/aliases.
- FirewallAliasesEndpoint
- Defines an Endpoint for interacting with many FirewallAlias Model objects at /api/v2/firewall/aliases.
- FirewallApplyEndpoint
- Defines an Endpoint for interacting with singular FirewallApply Model objects at /api/v2/firewall/apply.
- FirewallNATOneToOneMappingEndpoint
- Defines an Endpoint for interacting with many OneToOneNATMapping Model objects at /api/v2/firewall/nat/one_to_one/mapping.
- FirewallNATOneToOneMappingsEndpoint
- Defines an Endpoint for interacting with many OneToOneNATMapping Model objects at /api/v2/firewall/nat/one_to_one/mappings.
- FirewallNATOutboundMappingEndpoint
- Defines an Endpoint for interacting with a singular OutboundNATMapping Model objects at /api/v2/firewall/nat/outbound/mapping.
- FirewallNATOutboundMappingsEndpoint
- Defines an Endpoint for interacting with many OutboundNATMapping Model objects at /api/v2/firewall/nat/outbound/mappings.
- FirewallNATOutboundModeEndpoint
- Defines an Endpoint for interacting with the OutboundNATMode Model object at /api/v2/firewall/nat/outbound/mode.
- FirewallNATPortForwardEndpoint
- Defines an Endpoint for interacting with a singular PortForward Model objects at /api/v2/firewall/nat/port_forward.
- FirewallNATPortForwardsEndpoint
- Defines an Endpoint for interacting with many PortForward Model objects at /api/v2/firewall/nat/port_forwards.
- FirewallRuleEndpoint
- Defines an Endpoint for interacting with a singular FirewallRule Model objects at /api/v2/firewall/rules.
- FirewallRulesEndpoint
- Defines an Endpoint for interacting with many FirewallRule Model objects at /api/v2/firewall/rules.
- FirewallScheduleEndpoint
- Defines an Endpoint for interacting with a singular FirewallSchedule Model objects at /api/v2/firewall/schedule.
- FirewallSchedulesEndpoint
- Defines an Endpoint for interacting with many FirewallSchedule Model objects at /api/v2/firewall/schedules.
- FirewallScheduleTimeRangeEndpoint
- Defines an Endpoint for interacting with a singular FirewallScheduleTimeRange Model objects at /api/v2/firewall/schedule/time_range.
- FirewallStateEndpoint
- Defines an Endpoint for interacting with a singular FirewallState Model object at /api/v2/firewall/state.
- FirewallStatesEndpoint
- Defines an Endpoint for interacting with many FirewallState Model objects at /api/v2/firewall/states.
- FirewallStatesSizeEndpoint
- Defines an Endpoint for interacting with the FirewallStatesSize Model object at /api/v2/firewall/states/size.
- FirewallTrafficShaperEndpoint
- Defines an Endpoint for interacting with a singular TrafficShaper Model object at /api/v2/firewall/traffic_shaper.
- FirewallTrafficShaperLimiterBandwidthEndpoint
- Defines an Endpoint for interacting with a singular TrafficShaperLimiterBandwidth Model objects at /api/v2/firewall/traffic_shaper/limiter/bandwidth.
- FirewallTrafficShaperLimiterEndpoint
- Defines an Endpoint for interacting with a singular TrafficShaperLimiter Model object at /api/v2/firewall/traffic_shaper/limiter.
- FirewallTrafficShaperLimiterQueueEndpoint
- Defines an Endpoint for interacting with a singular TrafficShaperLimiterQueue Model objects at /api/v2/firewall/traffic_shaper/limiter/queue.
- FirewallTrafficShaperLimitersEndpoint
- Defines an Endpoint for interacting with many TrafficShaperLimiter Model objects at /api/v2/firewall/traffic_shaper/limiters.
- FirewallTrafficShaperQueueEndpoint
- Defines an Endpoint for interacting with a singular TrafficShaperQueue Model object at /api/v2/firewall/traffic_shaper/queue.
- FirewallTrafficShapersEndpoint
- Defines an Endpoint for interacting with multiple TrafficShaper Model objects at /api/v2/firewall/traffic_shapers.
- FirewallVirtualIPApplyEndpoint
- Defines an Endpoint for interacting with the VirtualIPApply Model object at /api/v2/firewall/virtual_ip/apply.
- FirewallVirtualIPEndpoint
- Defines an Endpoint for interacting with a singular VirtualIP Model object at /api/v2/firewall/virtual_ip.
- FirewallVirtualIPsEndpoint
- Defines an Endpoint for interacting with multiple VirtualIP Model objects at /api/v2/firewall/virtual_ips.
- GraphQLEndpoint
- Defines an Endpoint for the GraphQL API at /api/v2/graphql.
- InterfaceApplyEndpoint
- Defines an Endpoint for interacting with the InterfaceApply Model object at /api/v2/interface/apply.
- InterfaceAvailableInterfacesEndpoint
- Defines an Endpoint for interacting with many AvailableInterface Model objects at /api/v2/interface/available_interfaces
- InterfaceBridgeEndpoint
- Defines an Endpoint for interacting with a singular InterfaceBridge Model object at /api/v2/interface/bridge.
- InterfaceBridgesEndpoint
- Defines an Endpoint for interacting with multiple InterfaceBridge Model objects at /api/v2/interface/bridges.
- InterfaceGroupEndpoint
- Defines an Endpoint for interacting with a singular InterfaceGroup Model object at /api/v2/interface/group.
- InterfaceGroupsEndpoint
- Defines an Endpoint for interacting with multiple InterfaceGroup Model objects at /api/v2/interface/groups.
- InterfaceVLANEndpoint
- Defines an Endpoint for interacting with a singular InterfaceVLAN Model object at /api/v2/interface/vlan.
- InterfaceVLANsEndpoint
- Defines an Endpoint for interacting with multiple InterfaceVLAN Model objects at /api/v2/interface/vlans.
- NetworkInterfaceEndpoint
- Defines an Endpoint for interacting with a singular NetworkInterface Model object at /api/v2/interface.
- NetworkInterfacesEndpoint
- Defines an Endpoint for interacting with multiple NetworkInterface Model objects at /api/v2/interfaces.
- RoutingApplyEndpoint
- Defines an Endpoint for interacting with the RoutingApply Model object at /api/v2/routing/apply.
- RoutingGatewayDefaultEndpoint
- Defines an Endpoint for interacting with the DefaultGateway Model object at /api/v2/routing/gateway/default.
- RoutingGatewayEndpoint
- Defines an Endpoint for interacting with a single RoutingGateway Model objects at /api/v2/routing/gateway.
- RoutingGatewayGroupEndpoint
- Defines an Endpoint for interacting with a single RoutingGatewayGroup Model object at /api/v2/routing/gateway/group.
- RoutingGatewayGroupPriorityEndpoint
- Defines an Endpoint for interacting with a single RoutingGatewayGroupPriority Model object at /api/v2/routing/gateway/group/priority.
- RoutingGatewayGroupsEndpoint
- Defines an Endpoint for interacting with multiple RoutingGatewayGroup Model objects at /api/v2/routing/gateway/groups.
- RoutingGatewaysEndpoint
- Defines an Endpoint for interacting with multiple RoutingGateway Model objects at /api/v2/routing/gateways.
- RoutingStaticRouteEndpoint
- Defines an Endpoint for interacting with a single StaticRoute Model object at /api/v2/routing/static_routes.
- RoutingStaticRoutesEndpoint
- Defines an Endpoint for interacting with multiple StaticRoute Model objects at /api/v2/routing/static_routes.
- ServicesACMEAccountKeyEndpoint
- Defines an Endpoint for interacting with a single ACMEAccountKey Model object at /api/v2/services/acme/account_key.
- ServicesACMEAccountKeyRegisterEndpoint
- Defines an Endpoint for interacting with the ACMEAccountKeyRegister Model at /api/v2/services/acme/account_key/register
- ServicesACMEAccountKeyRegistrationsEndpoint
- Defines an Endpoint for interacting with many ACMEAccountKeyRegister Models at /api/v2/services/acme/account_key/registrations
- ServicesACMEAccountKeysEndpoint
- Defines an Endpoint for interacting with a many ACMEAccountKey Model objects at /api/v2/services/acme/account_keys.
- ServicesACMECertificateActionEndpoint
- Defines an Endpoint for interacting with a single ACMECertificateAction Model object at /api/v2/services/acme/certificate/action.
- ServicesACMECertificateDomainEndpoint
- Defines an Endpoint for interacting with a single ACMECertificateDomain Model object at /api/v2/services/acme/certificate/domain.
- ServicesACMECertificateEndpoint
- Defines an Endpoint for interacting with a single ACMECertificate Model object at /api/v2/services/acme/certificate.
- ServicesACMECertificateIssuancesEndpoint
- Defines an Endpoint for interacting with many ACMECertificateIssue Model objects at /api/v2/services/acme/certificate/issuances.
- ServicesACMECertificateIssueEndpoint
- Defines an Endpoint for interacting with a single ACMECertificateIssue Model object at /api/v2/services/acme/certificate/issue.
- ServicesACMECertificateRenewalsEndpoint
- Defines an Endpoint for interacting with many ACMECertificateRenew Model objects at /api/v2/services/acme/certificate/renewals.
- ServicesACMECertificateRenewEndpoint
- Defines an Endpoint for interacting with a single ACMECertificateRenew Model object at /api/v2/services/acme/certificate/renew.
- ServicesACMECertificatesEndpoint
- Defines an Endpoint for interacting with a many ACMECertificate Model objects at /api/v2/services/acme/certificates.
- ServicesACMESettingsEndpoint
- Defines an Endpoint for interacting with a singular ACMESettings Model object at /api/v2/services/acme/settings.
- ServicesBINDAccessListEndpoint
- Defines an Endpoint for interacting with a singular BINDAccessList Model object at /api/v2/services/bind/access_list.
- ServicesBINDAccessListEntryEndpoint
- Defines an Endpoint for interacting with a singular BINDAccessListEntry Model object at /api/v2/services/bind/access_list/entry.
- ServicesBINDAccessListsEndpoint
- Defines an Endpoint for interacting with a multiple BINDAccessList Model objects at /api/v2/services/bind/access_lists.
- ServicesBINDSettingsEndpoint
- Defines an Endpoint for interacting with a singular BINDSettings Model object at /api/v2/services/bind/settings.
- ServicesBINDSyncRemoteHostEndpoint
- Defines an Endpoint for interacting with a singular BINDSyncRemoteHost Model object at /api/v2/services/bind/sync/remote_host.
- ServicesBINDSyncRemoteHostsEndpoint
- Defines an Endpoint for interacting with many BINDSyncRemoteHost Model objects at /api/v2/services/bind/sync/remote_hosts.
- ServicesBINDSyncSettingsEndpoint
- Defines an Endpoint for interacting with a singular BINDSyncSettings Model object at /api/v2/services/bind/sync/settings.
- ServicesBINDViewEndpoint
- Defines an Endpoint for interacting with a singular BINDView Model object at /api/v2/services/bind/view.
- ServicesBINDViewsEndpoint
- Defines an Endpoint for interacting with a multiple BINDView Model objects at /api/v2/services/bind/views.
- ServicesBINDZoneEndpoint
- Defines an Endpoint for interacting with a singular BINDZone Model object at /api/v2/services/bind/zone.
- ServicesBINDZoneRecordEndpoint
- Defines an Endpoint for interacting with a singular BINDZoneRecord Model object at /api/v2/services/bind/zone/record.
- ServicesBINDZonesEndpoint
- Defines an Endpoint for interacting with a multiple BINDZone Model objects at /api/v2/services/bind/zones.
- ServicesCronJobEndpoint
- Defines an Endpoint for interacting with a singular CronJob Model object at /api/v2/services/cron/job.
- ServicesCronJobsEndpoint
- Defines an Endpoint for interacting with multiple CronJob Model objects at /api/v2/services/cron/jobs.
- ServicesDHCPServerAddressPoolEndpoint
- Defines an Endpoint for interacting with a singular DHCPServerAddressPool Model object at /api/v2/services/dhcp_server/address_pool.
- ServicesDHCPServerApplyEndpoint
- Defines an Endpoint for interacting with singular DHCPServerApply Model objects at /api/v2/services/dhcp_server/apply.
- ServicesDHCPServerBackendEndpoint
- Defines an Endpoint for interacting with the DHCPServerBackend Model object at /api/v2/services/dhcp_server/backend.
- ServicesDHCPServerCustomOptionEndpoint
- Defines an Endpoint for interacting with a singular DHCPServerCustomOption Model object at /api/v2/services/dhcp_server/custom_option.
- ServicesDHCPServerEndpoint
- Defines an Endpoint for interacting with a singular DHCPServerBackend Model object at /api/v2/services/dhcp_server/backend.
- ServicesDHCPServersEndpoint
- Defines an Endpoint for interacting with multiple DHCPServer Model objects at /api/v2/services/dhcp_servers.
- ServicesDHCPServerStaticMappingEndpoint
- Defines an Endpoint for interacting with a singular DHCPServerStaticMapping Model object at /api/v2/services/dhcp_server/static_mapping.
- ServicesDNSForwarderApplyEndpoint
- Defines an Endpoint for interacting with the DNSForwarderApply Model object at /api/v2/services/dns_forwarder/apply.
- ServicesDNSForwarderHostOverrideAliasEndpoint
- Defines an Endpoint for interacting with a singular DNSForwarderHostOverrideAlias Model object at /api/v2/services/dns_forwarder/host_override/alias.
- ServicesDNSForwarderHostOverrideEndpoint
- Defines an Endpoint for interacting with a singular DNSForwarderHostOverride Model object at /api/v2/services/dns_forwarder/host_override.
- ServicesDNSForwarderHostOverridesEndpoint
- Defines an Endpoint for interacting with many DNSForwarderHostOverride Model objects at /api/v2/services/dns_forwarder/host_override.
- ServicesDNSResolverAccessListEndpoint
- Defines an Endpoint for interacting with a singular DNSResolverAccessList Model object at /api/v2/services/dns_resolver/access_list.
- ServicesDNSResolverAccessListNetworkEndpoint
- Defines an Endpoint for interacting with a singular DNSResolverAccessListNetwork Model object at /api/v2/services/dns_resolver/access_list/network.
- ServicesDNSResolverAccessListsEndpoint
- Defines an Endpoint for interacting with multiple DNSResolverAccessList Model objects at /api/v2/services/dns_resolver/access_lists.
- ServicesDNSResolverApplyEndpoint
- Defines an Endpoint for interacting with the DNSResolverApply Model object at /api/v2/services/dns_resolver/apply.
- ServicesDNSResolverDomainOverrideEndpoint
- Defines an Endpoint for interacting with a singular DNSResolverHostOverride Model object at /api/v2/services/dns_resolver/domain_override.
- ServicesDNSResolverDomainOverridesEndpoint
- Defines an Endpoint for interacting with many DNSResolverHostOverride Model objects at /api/v2/services/dns_resolver/domain_overrides.
- ServicesDNSResolverHostOverrideAliasEndpoint
- Defines an Endpoint for interacting with a singular DNSResolverHostOverrideAlias Model object at /api/v2/services/dns_resolver/host_override/alias.
- ServicesDNSResolverHostOverrideEndpoint
- Defines an Endpoint for interacting with a singular DNSResolverHostOverride Model object at /api/v2/services/dns_resolver/host_override.
- ServicesDNSResolverHostOverridesEndpoint
- Defines an Endpoint for interacting with many DNSResolverHostOverride Model objects at /api/v2/services/dns_resolver/host_override.
- ServicesDNSResolverSettingsEndpoint
- Defines an Endpoint for interacting with the DNSResolverSettings Model object at /api/v2/services/dns_resolver/settings.
- ServicesHAProxyApplyEndpoint
- Defines an Endpoint for interacting with the HAProxyApply Model object at /api/v2/services/haproxy/apply.
- ServicesHAProxyBackendACLEndpoint
- Defines an Endpoint for interacting with a singular HAProxyBackendACL Model object at /api/v2/services/haproxy/backend/acl.
- ServicesHAProxyBackendActionEndpoint
- Defines an Endpoint for interacting with a singular HAProxyBackendAction Model object at /api/v2/services/haproxy/backend/action.
- ServicesHAProxyBackendEndpoint
- Defines an Endpoint for interacting with a singular HAProxyBackend Model object at /api/v2/services/haproxy/backend.
- ServicesHAProxyBackendErrorFileEndpoint
- Defines an Endpoint for interacting with a singular HAProxyBackendErrorFile Model object at /api/v2/services/haproxy/backend/error_file.
- ServicesHAProxyBackendsEndpoint
- Defines an Endpoint for interacting with multiple HAProxyBackend Model objects at /api/v2/services/haproxy/backends.
- ServicesHAProxyBackendServerEndpoint
- Defines an Endpoint for interacting with a singular HAProxyBackendServer Model object at /api/v2/services/haproxy/backend/server.
- ServicesHAProxyFileEndpoint
- Defines an Endpoint for interacting with a singular HAProxyFile Model object at /api/v2/services/haproxy/file.
- ServicesHAProxyFiles
- Defines an Endpoint for interacting with multiple HAProxyFile Model objects at /api/v2/services/haproxy/file.
- ServicesHAProxyFrontendACLEndpoint
- Defines an Endpoint for interacting with a singular HAProxyFrontendACL Model object at /api/v2/services/haproxy/frontend/acl.
- ServicesHAProxyFrontendActionEndpoint
- Defines an Endpoint for interacting with a singular HAProxyFrontendAction Model object at /api/v2/services/haproxy/frontend/action.
- ServicesHAProxyFrontendAddressEndpoint
- Defines an Endpoint for interacting with a singular HAProxyFrontendAction Model object at /api/v2/services/haproxy/frontend/action.
- ServicesHAProxyFrontendEndpoint
- Defines an Endpoint for interacting with multiple HAProxyFrontend Model objects at /api/v2/services/haproxy/frontend.
- ServicesHAProxyFrontendErrorFileEndpoint
- Defines an Endpoint for interacting with a singular HAProxyFrontendErrorFile Model object at /api/v2/services/haproxy/frontend/error_file.
- ServicesHAProxyFrontendsEndpoint
- Defines an Endpoint for interacting with multiple HAProxyFrontend Model objects at /api/v2/services/haproxy/frontends.
- ServicesHAProxySettingsDNSResolverEndpoint
- Defines an Endpoint for interacting with a singular HAProxyDNSResolver Model object at /api/v2/services/haproxy/settings/dns_resolver.
- ServicesHAProxySettingsEmailMailerEndpoint
- Defines an Endpoint for interacting with a singular HAProxyEmailMailer Model object at /api/v2/services/haproxy/settings/email_mailer.
- ServicesHAProxySettingsEndpoint
- Defines an Endpoint for interacting with the HAProxySettings Model object at /api/v2/services/haproxy/settings.
- ServicesNTPSettingsEndpoint
- Defines an Endpoint for interacting with the NTPSettings Model object at /api/v2/services/ntp/settings.
- ServicesNTPTimeServerEndpoint
- Defines an Endpoint for interacting with a singular NTPTimeServer Model object at /api/v2/services/ntp/time_server.
- ServicesNTPTimeServersEndpoint
- Defines an Endpoint for interacting with multiple NTPTimeServer Model objects at /api/v2/services/ntp/time_servers.
- ServicesServiceWatchdogEndpoint
- Defines an Endpoint for interacting with a singular ServiceWatchdog Model objects at /api/v2/services/service_watchdog.
- ServicesServiceWatchdogsEndpoint
- Defines an Endpoint for interacting with multiple ServiceWatchdog Model objects at /api/v2/services/service_watchdogs.
- ServicesSSHEndpoint
- Defines an Endpoint for interacting with the SSH Model object at /api/v2/services/ssh.
- ServicesWakeOnLANSendEndpoint
- Defines an Endpoint for interacting with the WakeOnLANSend Model object at /api/v2/services/wake_on_lan/send.
- StatusCARPEndpoint
- Defines an Endpoint for interacting with the CARP Model object at /api/v2/status/carp.
- StatusDHCPServerLeasesEndpoint
- Defines an Endpoint for interacting with the DHCPServerLease Model objects at /api/v2/status/dhcp_server/leases.
- StatusGatewaysEndpoint
- Defines an Endpoint for interacting with the RoutingGatewayStatus Model object at /api/v2/status/gateways.
- StatusInterfacesEndpoint
- Defines an Endpoint for interacting with the InterfaceStats Model objects at /api/v2/status/interfaces.
- StatusIPsecChildSAEndpoint
- Defines an Endpoint for interacting with a single IPseChildcSAStatus Model object at /api/v2/status/ipsec/child_sa.
- StatusIPsecSAEndpoint
- Defines an Endpoint for interacting with a single IPsecSAStatus Model object at /api/v2/status/ipsec/sa.
- StatusIPsecSAsEndpoint
- Defines an Endpoint for interacting with multiple IPsecSAStatus Model objects at /api/v2/status/ipsec/sas.
- StatusLogsDHCPEndpoint
- Defines an Endpoint for interacting with many DHCP Models at /api/v2/status/logs/dhcp.
- StatusLogsFirewallEndpoint
- Defines an Endpoint for interacting with many FirewallLog Models at /api/v2/status/logs/firewall.
- StatusLogsSettingsEndpoint
- Defines an Endpoint for interacting with a singular LogSettings Model object at /api/v2/status/logs/settings.
- StatusLogsSystemEndpoint
- Defines an Endpoint for interacting with many SystemLog Models at /api/v2/status/logs/system.
- StatusOpenVPNClientsEndpoint
- Defines an Endpoint for interacting with multiple OpenVPNClientStatus Model objects at /api/v2/status/openvpn/clients.
- StatusOpenVPNServerConnectionEndpoint
- Defines an Endpoint for interacting with a single OpenVPNServerConnectionStatus Model objects at /api/v2/status/openvpn/server/connection.
- StatusOpenVPNServerRouteEndpoint
- Defines an Endpoint for interacting with a single OpenVPNServerRouteStatus Model objects at /api/v2/status/openvpn/server/route.
- StatusOpenVPNServersEndpoint
- Defines an Endpoint for interacting with multiple OpenVPNServerStatus Model objects at /api/v2/status/openvpn/servers.
- StatusServiceEndpoint
- Defines an Endpoint for interacting with a Service Model object at /api/v2/status/service.
- StatusServicesEndpoint
- Defines an Endpoint for interacting with multiple Service Model objects at /api/v2/status/services.
- StatusSystemEndpoint
- Defines an Endpoint for interacting with the SystemStatus Model object at /api/v2/status/system.
- SystemCertificateAuthoritiesEndpoint
- Defines an Endpoint for interacting with multiple CertificateAuthority Model objects at /api/v2/system/certificate_authorities.
- SystemCertificateAuthorityEndpoint
- Defines an Endpoint for interacting with a singular CertificateAuthority Model object at /api/v2/system/certificate_authority.
- SystemCertificateAuthorityGenerateEndpoint
- Defines an Endpoint for interacting with a singular CertificateAuthority CertificateAuthorityGenerate object at /api/v2/system/certificate_authority/generate.
- SystemCertificateAuthorityRenewEndpoint
- Defines an Endpoint for interacting with a singular CertificateAuthorityRenew object at /api/v2/system/certificate_authority/renew.
- SystemCertificateEndpoint
- Defines an Endpoint for interacting with a single Certificate Model object at /api/v2/system/certificate.
- SystemCertificateGenerateEndpoint
- Defines an Endpoint for interacting with a singular CertificateGenerate object at /api/v2/system/certificate/generate.
- SystemCertificatePKCS12ExportEndpoint
- Defines an Endpoint for interacting with a singular CertificatePKCS12Export object at /api/v2/system/certificate/pkcs12/export.
- SystemCertificateRenewEndpoint
- Defines an Endpoint for interacting with a singular CertificateRenew object at /api/v2/system/certificate/renew.
- SystemCertificatesEndpoint
- Defines an Endpoint for interacting with many Certificate Model objects at /api/v2/system/certificates.
- SystemCertificateSigningRequestEndpoint
- Defines an Endpoint for interacting with a singular CertificateSigningRequest object at /api/v2/system/certificate/signing_request.
- SystemCertificateSigningRequestSignEndpoint
- Defines an Endpoint for interacting with a singular CertificateSigningRequestSign object at /api/v2/system/certificate/signing_request/sign.
- SystemConsoleEndpoint
- Defines an Endpoint for interacting with the SystemConsole Model object at /api/v2/system/console.
- SystemCRLEndpoint
- Defines an Endpoint for interacting with a single CertificateRevocationList Model object at /api/v2/system/crl.
- SystemCRLRevokedCertificateEndpoint
- Defines an Endpoint for interacting with a single CertificateRevocationListRevokedCertificate Model object at /api/v2/system/crl/revoked_certificate.
- SystemCRLsEndpoint
- Defines an Endpoint for interacting with many CertificateRevocationList Model objects at /api/v2/system/crls.
- SystemDNSEndpoint
- Defines an Endpoint for interacting with the SystemDNS Model object at /api/v2/system/dns.
- SystemHostnameEndpoint
- Defines an Endpoint for interacting with the SystemHostname Model object at /api/v2/system/hostname.
- SystemNotificationsEmailSettingsEndpoint
- Defines an Endpoint for interacting with the EmailNotificationSettings Model at /api/v2/system/notifications/email_settings.
- SystemPackageAvailableEndpoint
- Defines an Endpoint for interacting with many AvailablePackage Model objects at /api/v2/system/package/available.
- SystemPackageEndpoint
- Defines an Endpoint for interacting with a single Package Model object at /api/v2/system/package.
- SystemPackagesEndpoint
- Defines an Endpoint for interacting with many Package Model objects at /api/v2/system/packages.
- SystemRESTAPIAccessListEndpoint
- Defines an Endpoint for interacting with many RESTAPIAccessListEntry objects at /api/v2/system/restapi/access_list.
- SystemRESTAPIAccessListEntryEndpoint
- Defines an Endpoint for interacting with a single RESTAPIAccessListEntry object at /api/v2/system/restapi/access_list/entry.
- SystemRESTAPISettingsEndpoint
- Defines an Endpoint for interacting with the RESTAPISettings Model object at /api/v2/system/restapi/settings.
- SystemRESTAPISettingsSyncEndpoint
- Defines an Endpoint for interacting with the RESTAPISettingsSync Model object at /api/v2/system/restapi/settings/sync.
- SystemRESTAPIVersionEndpoint
- Defines an Endpoint for interacting with the RESTAPIVersion Model object at /api/v2/system/restapi/version.
- SystemTunableEndpoint
- Defines an Endpoint for interacting with a single SystemTunable Model objects at /api/v2/system/tunable.
- SystemTunablesEndpoint
- Defines an Endpoint for interacting with many SystemTunable Model objects at /api/v2/system/tunables.
- SystemVersionEndpoint
- Defines an Endpoint for interacting with the SystemVersion Model object at /api/v2/system/version.
- SystemWebGUISettingsEndpoint
- Defines an Endpoint for interacting with the WebGUISettings Model object at /api/v2/system/webgui/settings.
- UserAuthServerEndpoint
- Defines an Endpoint for interacting with a single AuthServer Model object at /api/v2/user/auth_server.
- UserAuthServersEndpoint
- Defines an Endpoint for interacting with many AuthServer Model objects at /api/v2/user/auth_servers.
- UserEndpoint
- Defines an Endpoint for interacting with a single User Model object at /api/v2/user.
- UserGroupEndpoint
- Defines an Endpoint for interacting with a single UserGroup Model object at /api/v2/user/group.
- UserGroupsEndpoint
- Defines an Endpoint for interacting with many UserGroup Model objects at /api/v2/user/groups.
- UsersEndpoint
- Defines an Endpoint for interacting with many User Model objects at /api/v2/users.
- VPNIPsecApplyEndpoint
- Defines an Endpoint for interacting with singular IPsecApply Model objects at /api/v2/vpn/ipsec/apply.
- VPNIPsecPhase1EncryptionEndpoint
- Defines an Endpoint for interacting with a single IPsecPhase1Encryption Model objects at /api/v2/vpn/ipsec/phase1/encryption.
- VPNIPsecPhase1Endpoint
- Defines an Endpoint for interacting with a single IPsecPhase1 Model objects at /api/v2/vpn/ipsec/phase1.
- VPNIPsecPhase1sEndpoint
- Defines an Endpoint for interacting with many IPsecPhase1 Model objects at /api/v2/vpn/ipsec/phase1s.
- VPNIPsecPhase2EncryptionEndpoint
- Defines an Endpoint for interacting with a single IPsecPhase2Encryption Model objects at /api/v2/vpn/ipsec/phase2/encryption.
- VPNIPsecPhase2Endpoint
- Defines an Endpoint for interacting with a single IPsecPhase2 Model objects at /api/v2/vpn/ipsec/phase2.
- VPNIPsecPhase2sEndpoint
- Defines an Endpoint for interacting with many IPsecPhase2 Model objects at /api/v2/vpn/ipsec/phase2s.
- VPNOpenVPNClientEndpoint
- Defines an Endpoint for interacting with a single OpenVPNClient Model objects at /api/v2/vpn/openvpn/client.
- VPNOpenVPNClientsEndpoint
- Defines an Endpoint for interacting with many OpenVPNClient Model objects at /api/v2/vpn/openvpn/clients.
- VPNOpenVPNCSOEndpoint
- Defines an Endpoint for interacting with a single OpenVPNClientSpecificOverride Model object at /api/v2/vpn/openvpn/cso.
- VPNOpenVPNCSOsEndpoint
- Defines an Endpoint for interacting with many OpenVPNClientSpecificOverride Model objects at /api/v2/vpn/openvpn/csos.
- VPNOpenVPNServerEndpoint
- Defines an Endpoint for interacting with a single OpenVPNServer Model object at /api/v2/vpn/openvpn/server.
- VPNOpenVPNServersEndpoint
- Defines an Endpoint for interacting with many OpenVPNServer Model objects at /api/v2/vpn/openvpn/servers.
- VPNWireGuardApplyEndpoint
- Defines an Endpoint for interacting with the WireGuardApply Model object at /api/v2/vpn/wireguard/apply.
- VPNWireGuardPeerAllowedIPEndpoint
- Defines an Endpoint for interacting with a single WireGuardPeerAllowedIP Model object at /api/v2/vpn/wireguard/peer/allowed_ip.
- VPNWireGuardPeerEndpoint
- Defines an Endpoint for interacting with a single WireGuardPeer Model object at /api/v2/vpn/wireguard/peer.
- VPNWireGuardPeersEndpoint
- Defines an Endpoint for interacting with many WireGuardPeer Model objects at /api/v2/vpn/wireguard/peers.
- VPNWireGuardSettingsEndpoint
- Defines an Endpoint for interacting with the WireGuardSettings Model object at /api/v2/vpn/wireguard/settings.
- VPNWireGuardTunnelAddressEndpoint
- Defines an Endpoint for interacting with a single WireGuardTunnelAddress Model object at /api/v2/vpn/wireguard/tunnel/address.
- VPNWireGuardTunnelEndpoint
- Defines an Endpoint for interacting with a single WireGuardTunnelAddress Model object at /api/v2/vpn/wireguard/tunnel.
- VPNWireGuardTunnelsEndpoint
- Defines an Endpoint for interacting with many WireGuardTunnel Model objects at /api/v2/vpn/wireguard/tunnels.
- Base64Field
- Defines a Field for storing Base64 encoded strings in the pfSense configuration. This field will store string values internally as Base64 encoded strings, but represent them as plain text strings.
- BooleanField
- Defines a Field object for storing boolean values in the pfSense configuration.
- DateTimeField
- Defines a Field object for storing and validating DateTime values.
- FilterAddressField
- Defines a Field class that adds validation and representation for firewall filter addresses (e.g. firewall and NAT rule source and destination addresses).
- FloatField
- Defines a Field object for validating and storing a floating point number.
- ForeignModelField
- Defines a Field that adds validation and representation for Fields that relate to a different Model object field.
- IntegerField
- Defines a Field object for validating and storing integer values in the pfSense configuration.
- InterfaceField
- Defines an Field object for storing interface values in the pfSense configuration. This field will also be responsible for representing the interface according to the REST API `represent_interfaces_as` setting.
- NestedModelField
- Defines a Field object for storing nested Model objects in the pfSense configuration. This field allows certain Model objects to be stored as field values for another Model object.
- ObjectField
- Defines a Field object for validating and storing an associative array of key-value pairs. Note: It is highly recommended you DO NOT use this Field UNLESS the data you are working with is dynamic and cannot be easily predicted or defined by a static (Model) schema. If you can define this object's structure, please create a new Model object to define the schema and use the NestedModelField to represent it within another Model. This Field is not recommended for most use cases.
- PortField
- Defines a Field object for validating and storing TCP/UDP port values in the pfSense configuration. This includes options for port aliases and port ranges.
- SpecialNetworkField
- Defines a Field that adds validation and representation for address and network Fields that support special networks like interfaces, aliases, etc. This is similar to FilterAddressField except the values do not get nested into arrays internally.
- StringField
- Defines a Field object for validating and storing string values.
- UIDField
- Defines a Field that contains a unique ID. This field will automatically populate a unique ID that is immutable.
- UnixTimeField
- Defines a Field object for validating and storing Unix timestamp values.
- SystemRESTAPIAccessListEntryForm
- Defines the Form for creating and editing REST API Access List entries.
- SystemRESTAPIAccessListForm
- Defines the Form for creating, editing, and deleting REST API Access List entries.
- SystemRESTAPIKeyForm
- Defines the Form for creating and editing REST API keys in the pfSense webConfigurator at /system_restapi_key_edit.php.
- SystemRESTAPIKeysForm
- Defines the Form for viewing and deleting REST API keys in the pfSense webConfigurator at /system_restapi_key.php.
- SystemRESTAPISettingsForm
- Defines the Form for configuring REST API settings in the pfSense webConfigurator at /system_restapi_settings.php.
- SystemRESTAPIUpdatesForm
- Defines the Form for viewing or applying REST API updates in the pfSense webConfigurator at /system_restapi_updates.php.
- QueryParamsScalarType
- Defines a custom scalar type for handling JSON objects in GraphQL queries. This is primarily intended to allow arbitrary objects to be passed as arguments to GraphQL queries and mutations. This scalar type should only be used if the schema of the objects is dynamic and cannot be easily represented by a GraphQL input object type.
- Resolver
- Defines a class that maps/resolves GraphQL queries and mutations to the appropriate Model methods.
- ACMEAccountKey
- Defines a Model for interacting with ACME account keys.
- ACMEAccountKeyRegister
- Defines a Model used to register a given ACME account key with the ACME package.
- ACMECertificate
- Defines a Model for interacting with ACME certificate configurations.
- ACMECertificateAction
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- ACMECertificateDomain
- Defines a Model for interacting with ACME certificate configurations.
- ACMECertificateIssue
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- ACMECertificateRenew
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- ACMESettings
- Defines a Model for interacting with the ACME general settings
- ARPTable
- Defines a Model for interacting with the system's ARP table.
- AuthServer
- Defines a Model for interacting with remote authentication servers.
- AvailableInterface
- Defines a Model for interfaces that are available to be assigned on this system.
- AvailablePackage
- Defines a Model for packages that are available to install on this system.
- BINDAccessList
- Defines a model that interacts with BIND access lists.
- BINDAccessListEntry
- Defines a model that interacts with BIND access list entries.
- BINDSettings
- Defines a model that interacts the general BIND settings.
- BINDSyncRemoteHost
- Defines a model for interacting with the BIND sync remote servers (peers)
- BINDSyncSettings
- Defines a model for interacting with the BIND sync settings.
- BINDView
- Defines a model that interacts with BIND views.
- BINDZone
- Defines a model that interacts with BIND zones.
- BINDZoneRecord
- Defines a model that interacts with BIND zone records.
- CARP
- Defines a Model for interacting with the system's CARP settings.
- Certificate
- Defines a Model for interacting with the system's certificates.
- CertificateAuthority
- Defines a Model for interacting with the system's certificate authorities.
- CertificateAuthorityGenerate
- Defines a Model for generating internal and intermediate certificate authorities.
- CertificateAuthorityRenew
- Defines a Model for renewing an existing Certificate Authority.
- CertificateGenerate
- Defines a Model for generating new Certificates.
- CertificatePKCS12Export
- Defines a Model for handling the export of an existing Certificate as a PKCS12 file.
- CertificateRenew
- Defines a Model for renewing an existing Certificate.
- CertificateRevocationList
- Defines a Model for interacting with the system's certificate revocation lists.
- CertificateRevocationListRevokedCertificate
- Defines a Model for interacting with certificates revoked by a certificate revocation list.
- CertificateSigningRequest
- Defines a Model for generating new CSRs.
- CertificateSigningRequestSign
- Defines a Model for signing existing CSRs.
- CommandPrompt
- Defines a Model object that can be used to run shell commands and retrieve the output and result code.
- ConfigHistoryRevision
- Defines a Model that interacts with the pfSense configuration history.
- CronJob
- Defines a Model for interacting with the system's cron jobs.
- DefaultGateway
- Defines a Model for interacting with the system's default gateways.
- DHCPLog
- Defines a Model for interacting with the DHCP log at /var/log/dhcpd.log.
- DHCPServer
- Defines a Model that interacts with the DHCP server for a given interface.
- DHCPServerAddressPool
- Defines a Model that configures additional address pools for a parent DHCPServer.
- DHCPServerApply
- Defines a Model for applying changes to the DHCP server configuration.
- DHCPServerBackend
- Defines a Model for assigning the backend DHCP server service.
- DHCPServerCustomOption
- Defines a model that configures custom DHCP options.
- DHCPServerLease
- Defines a model that represents a DHCP lease.
- DHCPServerStaticMapping
- Defines a Model that interacts with static DHCP mappings for the DHCP server.
- DNSForwarderApply
- Defines a Model that provides details on pending DNS Forwarder changes and allows DNS Forwarder changes to be applied.
- DNSForwarderHostOverride
- Defines a Model that interacts with DNS Forwarder host overrides.
- DNSForwarderHostOverrideAlias
- Defines a Model that interacts with DNS Forwarder host override aliases.
- DNSResolverAccessList
- Defines a Model that interacts with access list entries for the DNS Resolver (Unbound) service.
- DNSResolverAccessListNetwork
- Defines a Model that interacts with access list network entries for the DNS Resolver (Unbound) service.
- DNSResolverApply
- Defines a Model that provides details on pending DNS Resolver changes and allows DNS Resolver routing changes to be applied.
- DNSResolverDomainOverride
- Defines a Model that interacts with DNS Resolver domain overrides.
- DNSResolverHostOverride
- Defines a Model that interacts with DNS Resolver host overrides.
- DNSResolverHostOverrideAlias
- Defines a Model that interacts with DNS Resolver host override aliases.
- DNSResolverSettings
- Defines a Model that interacts with the DNS Resolver settings.
- EmailNotificationSettings
- Defines a model that interacts with email notification settings.
- FirewallAdvancedSettings
- Defines a Model for interacting with the advanced firewall settings.
- FirewallAlias
- Defines a Model that interacts with firewall aliases.
- FirewallApply
- Defiens a Model object that gathers details on pending firewall changes as well as tools to apply pending firewall changes.
- FirewallLog
- Defines a Model for interacting with the firewall log at /var/log/filter.log.
- FirewallRule
- Defines a Model that interacts with firewall rules.
- FirewallSchedule
- Defines a Model that interacts with firewall schedules.
- FirewallScheduleTimeRange
- Defines a model that interacts with firewall schedule time ranges.
- FirewallState
- Defines a Model for interacting with the firewall states.
- FirewallStatesSize
- Defines a Model for interacting with the firewall states size.
- GraphQL
- Defines a model that accept GraphQL queries and mutations and executes them against the GraphQL schema.
- HAProxyApply
- Defines a Model for applying the HAProxy configuration.
- HAProxyBackend
- Defines a Model for interacting with HAProxy backends.
- HAProxyBackendACL
- Defines a Model for HAProxy Backend Access Control Lists.
- HAProxyBackendAction
- Defines a Model for interacting with HAProxy backend actions.
- HAProxyBackendErrorFile
- Defines a Model that interacts with HAProxy backend error files.
- HAProxyBackendServer
- Defines a Model for HAProxy Backend Servers.
- HAProxyDNSResolver
- Defines a Model for HAProxy DNS Resolvers.
- HAProxyEmailMailer
- Defines a Model for HAProxy Email Mailers.
- HAProxyFile
- Defines a Model for HAProxy Files.
- HAProxyFrontend
- Defines a Model that interacts with HAProxy frontends.
- HAProxyFrontendACL
- Defines a Model for HAProxy Frontend Access Control Lists.
- HAProxyFrontendAction
- Defines a Model for HAProxy Frontend Actions.
- HAProxyFrontendAddress
- Defines a Model for HAProxy Frontend Addresses.
- HAProxyFrontendErrorFile
- Defines a Model that interacts with HAProxy frontend error files.
- HAProxySettings
- Defines a Model that interacts with HAProxy settings.
- InterfaceApply
- Defines a Model object that gathers details on pending interface changes as well as tools to apply pending interface changes.
- InterfaceBridge
- Defines a Model for interacting with Interface Bridges.
- InterfaceGroup
- Defines a Model for interacting with Interface Groups.
- InterfaceStats
- Defines a Model that represents interface statistics and detailed interface information.
- InterfaceVLAN
- Defines a Model for interacting with VLAN interfaces.
- IPsecApply
- Defines a Model that provides details on pending IPsec changes and allows IPsec changes to be applied.
- IPsecChildSAStatus
- A Model that provides the status of IPsec child SAs.
- IPsecPhase1
- Defines a Model for interacting with IPsec Phase 1 entries.
- IPsecPhase1Encryption
- Defines a Model that represents IPsec Phase 1 Encryption settings.
- IPsecPhase2
- Defines a Model that represents IPsec Phase 2 settings.
- IPsecPhase2Encryption
- Defines a Model that represents IPsec Phase 2 Encryption settings.
- IPsecSAStatus
- A Model that provides the status of IPsec tunnels.
- LogSettings
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- NetworkInterface
- Defines a Model that interacts with network interfaces. Note: PHP does not allow us to name a class `Interface` so we must use `NetworkInterface` even though this isn't inconsistent.
- NTPSettings
- Defines a Model for interacting with NTP server settings.
- NTPTimeServer
- Defines a Model for interacting with NTP time server settings.
- OneToOneNATMapping
- Defines a Model that represents 1:1 NAT mappings.
- OpenVPNClient
- Defines a Model that represents OpenVPN clients.
- OpenVPNClientSpecificOverride
- Defines a Model that represents OpenVPN Client Specific Overrides.
- OpenVPNClientStatus
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- OpenVPNServer
- Defines a Model that represents OpenVPN server settings.
- OpenVPNServerConnectionStatus
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- OpenVPNServerRouteStatus
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- OpenVPNServerStatus
- Defines a Model object that relates to a pfSense configuration or service. This model defines the necessary steps to validate incoming configuration and create, read, update, and/or delete data from the pfSense configuration this object relates to.
- OutboundNATMapping
- Defines a Model that represents outbound NAT mappings.
- OutboundNATMode
- Defines a Model that represents the outbound NAT mode.
- Package
- Defines a Model for packages that are currently installed on this system.
- PortForward
- Defines a Model that represents port forward rules.
- RESTAPIAccessListEntry
- Defines a model that interacts with the REST API access list entries.
- RESTAPIJWT
- Defines a Model that represents a REST API JWT.
- RESTAPIKey
- Defines a Model that represents REST API keys.
- RESTAPISettings
- Defines a Model that represents the REST API settings.
- RESTAPISettingsSync
- Defines a Model that interacts with the REST API settings sync feature. This Model is not intended for public use.
- RESTAPIVersion
- Defines a Model that represents the REST API version installed on this system.
- RoutingApply
- Defines a Model that provides details on pending routing changes and allows pending routing changes to be applied.
- RoutingGateway
- Defines a Model for interacting with routing gateways in pfSense.
- RoutingGatewayGroup
- Defines a Model for interacting with a Gateway Group priority item.
- RoutingGatewayGroupPriority
- Defines a Model for interacting with a Gateway Group priority item.
- RoutingGatewayStatus
- Defines a Model that represents the status of gateways on this system.
- Service
- Defines a Model that represents the status of services on this system.
- ServiceWatchdog
- Defines a Model that represents the Service Watchdog configuration on this system.
- SSH
- Defines a Model that represents the SSH server configuration on this system.
- StaticRoute
- Defines a Model that interacts with static routes on this system.
- SystemConsole
- Defines a Model that represents the console configuration on this system.
- SystemDNS
- Defines a Model that represents the DNS configuration on this system.
- SystemHalt
- Defines a Model that performs a system halt operation.
- SystemHostname
- Defines a Model that represents the system's current hostname.
- SystemLog
- Defines a Model for interacting with the system log at /var/log/system.log.
- SystemReboot
- Defines a Model that performs a system reboot operation.
- SystemStatus
- Defines a Model that represents the system's current status.
- SystemTunable
- Defines a Model that represents a sysctl tunable on this system.
- SystemVersion
- Defines a Model that represents the pfSense version of the current system.
- Test
- Defines a Test model object that can be used for unit testing. This model does not define any real object in pfSense and should only be used for testing purposes!
- TrafficShaper
- Defines a Model for interacting with the traffic shaper.
- TrafficShaperLimiter
- Defines a Model for interacting with the traffic shaper limiters.
- TrafficShaperLimiterBandwidth
- Defines a Model for interacting with the traffic shaper limiter bandwidth.
- TrafficShaperLimiterQueue
- Defines a Model for interacting with the traffic shaper limiter queues.
- TrafficShaperQueue
- Defines a Model for interacting with the traffic shaper queues.
- User
- Defines a Model for interacting with the local users on this system.
- UserGroup
- Defines a Model for interacting with the user groups on this system.
- VirtualIP
- Defines a Model for interacting with the virtual IPs on this system.
- VirtualIPApply
- Defines a Model that provides details on pending virtual IP changes and allows virtual IP changes to be applied.
- WakeOnLANSend
- Defines a Model for sending wake-on-LAN packets to hosts on the network.
- WebGUISettings
- Defines a Model for interacting with the system's web GUI settings.
- WireGuardApply
- Defines a Model that provides details on pending WireGuard changes and allows DNS Resolver changes to be applied.
- WireGuardPeer
- Defines a Model for interacting with the WireGuard peers on this system.
- WireGuardPeerAllowedIP
- Defines a Model for interacting with the WireGuard peer allowed IPs on this system.
- WireGuardSettings
- Defines a Model for interacting with the WireGuard settings on this system.
- WireGuardTunnel
- Defines a Model for interacting with the WireGuard tunnels on this system.
- WireGuardTunnelAddress
- Defines a Model for interacting with the WireGuard tunnel addresses on this system.
- ContainsQueryFilter
- Defines a query filter that checks if the given field value contains the given filter value.
- EndsWithQueryFilter
- Defines a query filter that checks if the given field value ends with the given filter value.
- ExactQueryFilter
- Defines a query filter that obtains matches to a field's value exactly.
- ExceptQueryFilter
- Defines a query filter that checks if the given field value does not match the given filter value exactly.
- FormatQueryFilter
- Defines a query filter that obtains matches to a field's value exactly.
- GreaterThanEqualQueryFilter
- Defines a query filter that checks if the given field value is greater than or equal to the given filter value.
- GreaterThanQueryFilter
- Defines a query filter that checks if the given field value is greater than the given filter value.
- LessThanEqualQueryFilter
- Defines a query filter that checks if the given field value is less than or equal to the given filter value.
- LessThanQueryFilter
- Defines a query filter that checks if the given field value is less than the given filter value.
- RegexQueryFilter
- Defines a query filter that checks if the given field value matches the given filter value using a regular expression.
- StartsWithQueryFilter
- Defines a query filter that checks if the given field value starts with the given filter value.
- AuthenticationError
- Exception class tha indicates an authentication error. This exception generally corresponds with a 401 unauthorized HTTP code.
- ConflictError
- Exception class that indicates their is a conflict with the requested action. This exception generally corresponds with a 409 conflict HTTP code.
- FailedDependencyError
- Exception class that indicates a requested resource requires a dependency which is not installed. This exception generally corresponds with a 424 Failed Dependency HTTP code.
- ForbiddenError
- Exception class that indicates insufficient privileges or an attempt to access a protected API resource. This exception generally corresponds with a 403 forbidden HTTP code.
- GraphQLResponse
- Response class that represents a GraphQL response. Unlike other responses, this response does not represent a successful or failed response, but rather a generic one where the error details are embedded in the response data.
- MediaTypeError
- Exception class tha indicates the request media type is not supported. This exception generally corresponds with a 415 Unsupported Media Type HTTP code.
- MethodNotAllowedError
- Exception class that indicates the requested method is not allowed. This exception generally corresponds with a 405 method not allowed HTTP code.
- NotAcceptableError
- Exception class tha indicates the request was not acceptable. This exception generally corresponds with a 406 Not Acceptable HTTP code.
- NotFoundError
- Exception class tha indicates a requested resource was not found. This exception generally corresponds with a 404 Not Found HTTP code.
- ServerError
- Exception class that indicates a server or programming error. This exception generally corresponds with a 500 Internal Server Error HTTP code.
- ServiceUnavailableError
- Exception class that indicates the requested services is temporarily unavailable. This exception generally corresponds with a 503 Service Unavailable error code.
- Success
- Exception class that indicates a successful transaction occurred. This exception generally corresponds with a 200 OK HTTP code and is typically not thrown as an error.
- UnprocessableContentError
- Exception class that indicates a request was understood but cannot be processed for one or more reasons. This exception generally corresponds with a 422 Unprocessable Content HTTP code.
- ValidationError
- Exception class tha indicates an input validation error. This exception generally corresponds with a 400 Bad Request HTTP code.
- GraphQLSchema
- Defines a Schema that represents this API in GraphQL format. This class is used to generate a GraphQL schema file.
- OpenAPISchema
- Defines a class that is used to represent a specific schema for this API. This class is intended to be extended by a child class to implement custom schema definitions using Endpoints, Models and Fields defined in this package.
- EmailAddressValidator
- Defines a Validator that determines if a given value is a valid email address.
- FilterNameValidator
- Defines a Validator that checks if a given value is a valid firewall filter name.
- HexValidator
- Defines a Validator that checks if a given value is a valid hexadecimal value.
- HostnameValidator
- Defines a Validator that checks if a given value is a valid hostname, domain or FQDN.
- IPAddressValidator
- Defines a Validator that checks if a given value is a valid IPv4 or IPv6 address.
- LengthValidator
- Defines a Validator that checks if a given value is within a specified length range. This can be used to check both array and string lengths.
- MACAddressValidator
- Defines a Validator that checks if a given value is a valid MAC address.
- NumericRangeValidator
- Defines a Validator that checks if a given value is within a specified numeric range.
- RegexValidator
- Defines a Validator that checks if a given value matches a specified regex pattern.
- SubnetValidator
- Defines a Validator that checks if a given value is a valid subnet CIDR.
- UniqueFromForeignModelValidator
- Defines a Validator object that ensures a Field's value is unique from another specified Model's field. This allows you to prevent a Field from being set to the same value as a different Model's Field.
- URLValidator
- Defines a Validator that checks if a given value is a valid URL
- X509Validator
- Defines a Validator that determines if a given string is an X509 encoded object.
Traits
- BaseTraits
- Defines a standard set of traits for all classes defined by this package. When class use this trait they will automatically inherit all resources included.
- CertificateModelTraits
- LogFileModelTraits
- Defines a set of traits that are intended to be used by Models to read, decompress and process log files.
Constants
- API_SETTINGS_BACKUP_FILE_PATH = '/usr/local/share/pfSense-pkg-RESTAPI/backup.json'
- API_SETTINGS_BACKUP_NOT_CONFIGURED = -1
- API_SETTINGS_BACKUP_SUCCESS = 0
- API_SETTINGS_RESTORE_NO_BACKUP = 2
- API_SETTINGS_RESTORE_NO_CHANGE = 1
- API_SETTINGS_RESTORE_SUCCESS = 0
- DEFAULT_CLIENT_IP_ADDRESS = '127.0.0.1'
- DEFAULT_CLIENT_USERNAME = '(system)'
- HAL_REL_NAMESPACE = 'pfsense'
- HTTP_STATUS_MESSAGES = [100 => 'continue', 101 => 'switching protocols', 102 => 'processing', 103 => 'checkpoint', 200 => 'ok', 201 => 'created', 202 => 'accepted', 203 => 'non-authoritative information', 204 => 'no content', 205 => 'reset content', 206 => 'partial content', 207 => 'multi-status', 300 => 'multiple choices', 301 => 'moved permanently', 302 => 'found', 303 => 'see other', 304 => 'not modified', 305 => 'use proxy', 306 => 'switch proxy', 307 => 'temporary redirect', 400 => 'bad request', 401 => 'unauthorized', 402 => 'payment required', 403 => 'forbidden', 404 => 'not found', 405 => 'method not allowed', 406 => 'not acceptable', 407 => 'proxy authentication required', 408 => 'request timeout', 409 => 'conflict', 410 => 'gone', 411 => 'length required', 412 => 'precondition failed', 413 => 'request entity too large', 414 => 'request-uri too long', 415 => 'unsupported media type', 416 => 'requested range not satisfiable', 417 => 'expectation failed', 418 => "i'm a teapot", 422 => 'unprocessable entity', 423 => 'locked', 424 => 'failed dependency', 425 => 'unordered collection', 426 => 'upgrade required', 449 => 'retry with', 450 => 'blocked by windows parental controls', 500 => 'internal server error', 501 => 'not implemented', 502 => 'bad gateway', 503 => 'service unavailable', 504 => 'gateway timeout', 505 => 'http version not supported', 506 => 'variant also negotiates', 507 => 'insufficient storage', 509 => 'bandwidth limit exceeded', 510 => 'not extended']
- RESERVED_FIELD_NAMES = ['id', 'parent_id', '_links', 'apply', 'async', 'limit', 'offset', 'extra', 'placement', 'append', 'remove', 'reverse']
- RESTAPI_LIBRARIES = ['/usr/local/pkg/RESTAPI/Core/', '/usr/local/pkg/RESTAPI/Dispatchers/', '/usr/local/pkg/RESTAPI/Caches/', '/usr/local/pkg/RESTAPI/Responses/', '/usr/local/pkg/RESTAPI/Validators/', '/usr/local/pkg/RESTAPI/Fields/', '/usr/local/pkg/RESTAPI/ModelTraits/', '/usr/local/pkg/RESTAPI/Models/', '/usr/local/pkg/RESTAPI/QueryFilters/', '/usr/local/pkg/RESTAPI/ContentHandlers/', '/usr/local/pkg/RESTAPI/Schemas/', '/usr/local/pkg/RESTAPI/GraphQL/', '/usr/local/pkg/RESTAPI/Auth', '/usr/local/pkg/RESTAPI/Endpoints/', '/usr/local/pkg/RESTAPI/Forms/', '/usr/local/pkg/RESTAPI/Tests/']
Functions
- build_endpoints() : void
- Builds a PHP API endpoint in the pfSense webroot for each Endpoint class defined in \RESTAPI\Endpoints using the Endpoint class's specified $url property.
- build_forms() : void
- Builds a PHP webConfigurator page in the pfSense webroot for each Form class defined in \RESTAPI\Forms using the Form class's specified $url property.
- build_privs() : void
- Automatically creates pfSense privileges for each Endpoint class defined in \RESTAPI\Endpoints and each Form class defined in \RESTAPI\Forms.
- build_schemas() : void
- Automatically generates the package schemas/documentation files for each Schema class defined in \RESTAPI\Schemas and writes them to /usr/local/pkg/RESTAPI/.resources/schemas/.
- notify_dispatcher() : void
- Runs the process for a specified Dispatcher class in \RESTAPI\Dispatchers.
- schedule_dispatchers() : void
- Creates cron jobs for all Dispatcher classes in \RESTAPI\Dispatchers and all Cache classes in \RESTAPI\Caches that have configured schedules.
- refresh_cache() : void
- Refreshes the cache file by obtaining new day for a given Cache object.
- run_tests() : void
- Runs all (or select) TestCase classes in \RESTAPI\Tests. This is only intended to test development of this package and should not be used on live installs.
- restart_webgui() : void
- Restarts the webConfigurator in the background.
- backup() : void
- Creates a backup of the REST API configuration if `keep_backup` is enabled. The backup will be stored in /usr/local/share/pfSense-pkg-RESTAPI/backup.json
- restore() : void
- Restores the latest REST API configuration backup from /usr/local/share/pfSense-pkg-RESTAPI/backup.json
- sync() : void
- Syncs the REST API configuration to HA peers if enabled.
- update() : void
- Updates this package to the latest version available to this system
- revert() : void
- Reverts or updates the REST API package to a specific version.
- delete() : mixed
- Delete the REST API package and restart the webConfigurator to remove nginx changes.
- rotate_server_key() : void
- Rotates the JWT server key. Warning: This will revoke any active JWTs.
- version() : void
- Prints the pfSense-pkg-RESTAPI version information.
- help() : void
- Prints the pfsense-restapi help page.
- is_assoc_array() : bool
- Checks if a given array is an associative array.
- to_upper_camel_case() : string
- Converts a string to UpperCamelCase.
- cprint() : void
- Conditionally prints a message to the console. The specified $message will only be printed if $condition is true.
- bandwidth_to_bits() : int
- Converts a $bandwidth to bits for it's given $bandwidthtype
- http_request() : bool|string
- Makes an HTTP request.
- get_classes_from_namespace() : array<string|int, mixed>
- Obtains the classes nested under a specified namespace. This only works for namespaces that match the directory structure (e.g. RESTAPI\Core for /usr/local/pkg/RESTAPI/Core) and only includes classes defined in their own class .inc file with a matching name.
- restapi_plugin_nginx() : string
- The pfSense-pkg-RESTAPI's 'plugin_nginx' package hook. This function is automatically called by the pfSense package system to add custom NGINX configurations. For this packacge, this function ensures an nginx server block is defined for API endpoints to allow the utiliziation of additional HTTP methods like PUT, PATCH and DELETE and URLs without a trailing slash.
Constants
API_SETTINGS_BACKUP_FILE_PATH
public
mixed
API_SETTINGS_BACKUP_FILE_PATH
= '/usr/local/share/pfSense-pkg-RESTAPI/backup.json'
API_SETTINGS_BACKUP_NOT_CONFIGURED
public
mixed
API_SETTINGS_BACKUP_NOT_CONFIGURED
= -1
API_SETTINGS_BACKUP_SUCCESS
public
mixed
API_SETTINGS_BACKUP_SUCCESS
= 0
API_SETTINGS_RESTORE_NO_BACKUP
public
mixed
API_SETTINGS_RESTORE_NO_BACKUP
= 2
API_SETTINGS_RESTORE_NO_CHANGE
public
mixed
API_SETTINGS_RESTORE_NO_CHANGE
= 1
API_SETTINGS_RESTORE_SUCCESS
public
mixed
API_SETTINGS_RESTORE_SUCCESS
= 0
DEFAULT_CLIENT_IP_ADDRESS
public
mixed
DEFAULT_CLIENT_IP_ADDRESS
= '127.0.0.1'
DEFAULT_CLIENT_USERNAME
public
mixed
DEFAULT_CLIENT_USERNAME
= '(system)'
HAL_REL_NAMESPACE
public
mixed
HAL_REL_NAMESPACE
= 'pfsense'
HTTP_STATUS_MESSAGES
public
mixed
HTTP_STATUS_MESSAGES
= [100 => 'continue', 101 => 'switching protocols', 102 => 'processing', 103 => 'checkpoint', 200 => 'ok', 201 => 'created', 202 => 'accepted', 203 => 'non-authoritative information', 204 => 'no content', 205 => 'reset content', 206 => 'partial content', 207 => 'multi-status', 300 => 'multiple choices', 301 => 'moved permanently', 302 => 'found', 303 => 'see other', 304 => 'not modified', 305 => 'use proxy', 306 => 'switch proxy', 307 => 'temporary redirect', 400 => 'bad request', 401 => 'unauthorized', 402 => 'payment required', 403 => 'forbidden', 404 => 'not found', 405 => 'method not allowed', 406 => 'not acceptable', 407 => 'proxy authentication required', 408 => 'request timeout', 409 => 'conflict', 410 => 'gone', 411 => 'length required', 412 => 'precondition failed', 413 => 'request entity too large', 414 => 'request-uri too long', 415 => 'unsupported media type', 416 => 'requested range not satisfiable', 417 => 'expectation failed', 418 => "i'm a teapot", 422 => 'unprocessable entity', 423 => 'locked', 424 => 'failed dependency', 425 => 'unordered collection', 426 => 'upgrade required', 449 => 'retry with', 450 => 'blocked by windows parental controls', 500 => 'internal server error', 501 => 'not implemented', 502 => 'bad gateway', 503 => 'service unavailable', 504 => 'gateway timeout', 505 => 'http version not supported', 506 => 'variant also negotiates', 507 => 'insufficient storage', 509 => 'bandwidth limit exceeded', 510 => 'not extended']
RESERVED_FIELD_NAMES
public
mixed
RESERVED_FIELD_NAMES
= ['id', 'parent_id', '_links', 'apply', 'async', 'limit', 'offset', 'extra', 'placement', 'append', 'remove', 'reverse']
RESTAPI_LIBRARIES
public
mixed
RESTAPI_LIBRARIES
= ['/usr/local/pkg/RESTAPI/Core/', '/usr/local/pkg/RESTAPI/Dispatchers/', '/usr/local/pkg/RESTAPI/Caches/', '/usr/local/pkg/RESTAPI/Responses/', '/usr/local/pkg/RESTAPI/Validators/', '/usr/local/pkg/RESTAPI/Fields/', '/usr/local/pkg/RESTAPI/ModelTraits/', '/usr/local/pkg/RESTAPI/Models/', '/usr/local/pkg/RESTAPI/QueryFilters/', '/usr/local/pkg/RESTAPI/ContentHandlers/', '/usr/local/pkg/RESTAPI/Schemas/', '/usr/local/pkg/RESTAPI/GraphQL/', '/usr/local/pkg/RESTAPI/Auth', '/usr/local/pkg/RESTAPI/Endpoints/', '/usr/local/pkg/RESTAPI/Forms/', '/usr/local/pkg/RESTAPI/Tests/']
Functions
build_endpoints()
Builds a PHP API endpoint in the pfSense webroot for each Endpoint class defined in \RESTAPI\Endpoints using the Endpoint class's specified $url property.
build_endpoints() : void
build_forms()
Builds a PHP webConfigurator page in the pfSense webroot for each Form class defined in \RESTAPI\Forms using the Form class's specified $url property.
build_forms() : void
build_privs()
Automatically creates pfSense privileges for each Endpoint class defined in \RESTAPI\Endpoints and each Form class defined in \RESTAPI\Forms.
build_privs() : void
build_schemas()
Automatically generates the package schemas/documentation files for each Schema class defined in \RESTAPI\Schemas and writes them to /usr/local/pkg/RESTAPI/.resources/schemas/.
build_schemas() : void
notify_dispatcher()
Runs the process for a specified Dispatcher class in \RESTAPI\Dispatchers.
notify_dispatcher(string|null $dispatcher_name[, array<string|int, mixed> $arguments = [] ]) : void
Parameters
- $dispatcher_name : string|null
- $arguments : array<string|int, mixed> = []
Tags
schedule_dispatchers()
Creates cron jobs for all Dispatcher classes in \RESTAPI\Dispatchers and all Cache classes in \RESTAPI\Caches that have configured schedules.
schedule_dispatchers() : void
refresh_cache()
Refreshes the cache file by obtaining new day for a given Cache object.
refresh_cache(string|null $cache_name) : void
Parameters
- $cache_name : string|null
-
The shortname of the Cache class that should have its cache file refreshed.
run_tests()
Runs all (or select) TestCase classes in \RESTAPI\Tests. This is only intended to test development of this package and should not be used on live installs.
run_tests([mixed $contains = '' ]) : void
Parameters
- $contains : mixed = ''
-
string|null Only run tests that contain this sub-string in the test name.
Tags
restart_webgui()
Restarts the webConfigurator in the background.
restart_webgui() : void
Tags
backup()
Creates a backup of the REST API configuration if `keep_backup` is enabled. The backup will be stored in /usr/local/share/pfSense-pkg-RESTAPI/backup.json
backup() : void
restore()
Restores the latest REST API configuration backup from /usr/local/share/pfSense-pkg-RESTAPI/backup.json
restore() : void
sync()
Syncs the REST API configuration to HA peers if enabled.
sync() : void
update()
Updates this package to the latest version available to this system
update() : void
revert()
Reverts or updates the REST API package to a specific version.
revert(mixed $tag) : void
Parameters
- $tag : mixed
-
string semantic version tag to revert or upgrade to.
delete()
Delete the REST API package and restart the webConfigurator to remove nginx changes.
delete() : mixed
rotate_server_key()
Rotates the JWT server key. Warning: This will revoke any active JWTs.
rotate_server_key() : void
version()
Prints the pfSense-pkg-RESTAPI version information.
version() : void
help()
Prints the pfsense-restapi help page.
help() : void
is_assoc_array()
Checks if a given array is an associative array.
is_assoc_array(array<string|int, mixed> $array) : bool
Parameters
- $array : array<string|int, mixed>
-
The array to check.
Return values
bool —true
if the value is an associative array. false
if it is an indexed array.
to_upper_camel_case()
Converts a string to UpperCamelCase.
to_upper_camel_case(string $string) : string
Parameters
- $string : string
-
The string to convert to UpperCamelCase.
Return values
string —The string converted to UpperCamelCase.
cprint()
Conditionally prints a message to the console. The specified $message will only be printed if $condition is true.
cprint(string $message, bool $condition) : void
Parameters
- $message : string
-
The message to be printed if the $condition is true.
- $condition : bool
-
A true or false condition. If the condition is true, the $message will be printed. Otherwise it will not.
bandwidth_to_bits()
Converts a $bandwidth to bits for it's given $bandwidthtype
bandwidth_to_bits(int $bandwidth, string $scale) : int
Parameters
- $bandwidth : int
-
The amount of bandwidth scaled using $bandwidthtype.
- $scale : string
-
The scale of $bandwidth. Options are: b, Kb, Mb, and Gb.
Tags
Return values
int —The bandwidth's total number of bits.
http_request()
Makes an HTTP request.
http_request(string $url, string $method[, array<string|int, mixed> $data = [] ][, array<string|int, mixed> $headers = [] ][, string $username = '' ][, string $password = '' ][, bool $validate_certs = true ]) : bool|string
Parameters
- $url : string
-
The full URL of the resource to submit the request to.
- $method : string
-
The HTTP method to use to submit the request.
- $data : array<string|int, mixed> = []
-
The data payload to submit to the remote host. Only JSON payloads are supported.
- $headers : array<string|int, mixed> = []
-
The HTTP headers to submit in the request.
- $username : string = ''
-
The username portion for basic authentication (if applicable)
- $password : string = ''
-
The password portion for basic authentication (if applicable)
- $validate_certs : bool = true
-
Enables or disables TLS certificate verification.
Return values
bool|string —The response from the remote host.
get_classes_from_namespace()
Obtains the classes nested under a specified namespace. This only works for namespaces that match the directory structure (e.g. RESTAPI\Core for /usr/local/pkg/RESTAPI/Core) and only includes classes defined in their own class .inc file with a matching name.
get_classes_from_namespace(string $namespace[, bool $shortnames = false ]) : array<string|int, mixed>
Parameters
- $namespace : string
-
The namespace to obtain classes from. This must be the full namespace including leading and trailing slash (\Full\Namespace).
- $shortnames : bool = false
-
Obtain the class shortnames instead of FQNs.
Return values
array<string|int, mixed> —An array containing the class names for each .inc class file.
restapi_plugin_nginx()
The pfSense-pkg-RESTAPI's 'plugin_nginx' package hook. This function is automatically called by the pfSense package system to add custom NGINX configurations. For this packacge, this function ensures an nginx server block is defined for API endpoints to allow the utiliziation of additional HTTP methods like PUT, PATCH and DELETE and URLs without a trailing slash.
restapi_plugin_nginx(mixed $pluginparams) : string
Parameters
- $pluginparams : mixed
-
Plugin parameters passed in by the pfSense package system.
Return values
string —The custom nginx block to be added to the webConfigurator's nginx.conf file