go-unifi

Feature constants

The features package — string constants naming UniFi controller feature flags, for use with GetFeature / IsFeatureEnabled / ListFeatures.

The features package is a small set of string constants naming the controller's feature flags. They exist so you don't hand-type the raw SCREAMING_SNAKE_CASE names when probing capabilities.

Pass them to the Internal API's feature methods (names are case-insensitive):

  • IsFeatureEnabled(ctx, site, name) (bool, error)
  • GetFeature(ctx, site, name) (*DescribedFeature, error)
  • ListFeatures(ctx, site) ([]DescribedFeature, error)
features.go
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/filipowm/go-unifi/v2/unifi"
	"github.com/filipowm/go-unifi/v2/unifi/features"
)

func main() {
	ctx := context.Background()
	c, err := unifi.NewClient(&unifi.ClientConfig{URL: "https://unifi.example.com", APIKey: "your-api-key"})
	if err != nil {
		log.Fatal(err)
	}

	enabled, err := c.IsFeatureEnabled(ctx, "default", features.ZoneBasedFirewall)
	if err != nil {
		log.Fatalf("check feature: %v", err)
	}
	fmt.Println("zone-based firewall enabled:", enabled)
}

These constants are plain string values — they only name a flag. Whether the flag exists or is enabled is up to the controller; always probe with IsFeatureEnabled / GetFeature rather than assuming.

Constants

ConstantString value
features.AdBlockingAD_BLOCKING
features.AllUnifiDevicesPageALL_UNIFI_DEVICES_PAGE
features.CustomDohServersCUSTOM_DOH_SERVERS
features.Hotspot2PasspointHOTSPOT2_PASSPOINT
features.IgmpProxyIGMP_PROXY
features.IpExclusionFromLeasesIP_EXCLUSION_FROM_LEASES
features.IpsIPS
features.IpsEtProIPS_ET_PRO
features.IpsSignatureReportIPS_SIGNATURE_REPORT
features.IpsecFqdnIPSEC_FQDN
features.Ipv4ActiveLeaseReportingIPV4_ACTIVE_LEASE_REPORTING
features.LegacyUiSupportedLEGACY_UI_SUPPORTED
features.LimitIpsCategoriesLIMIT_IPS_CATEGORIES
features.LiveDeviceUpdatesLIVE_DEVICE_UPDATES
features.LockApLOCK_AP
features.NatPoolNAT_POOL
features.NetflowNETFLOW
features.OspfDefaultRouteAnnouncementOSPF_DEFAULT_ROUTE_ANNOUNCEMENT
features.OspfRoutingOSPF_ROUTING
features.OpenVpnClientOPENVPN_CLIENT
features.OpenVpnClientTrafficRoutesOPENVPN_CLIENT_TRAFFIC_ROUTES
features.OpenVpnEncryptionCiphersOPENVPN_ENCRYPTION_CIPHERS
features.OpenVpnRemoteDisconnectOPENVPN_REMOTE_DISCONNECT
features.OpenVpnServerOPENVPN_SERVER
features.RadiusBatchUsersRADIUS_BATCH_USERS
features.RadiusProfilesRADIUS_PROFILES
features.RadiusServerRADIUS_SERVER
features.ScorePageSCORE_PAGE
features.SdwanHubSpokeSDWAN_HUB_SPOKE
features.SdwanMeshSDWAN_MESH
features.SpeedTestSPEED_TEST
features.StaticDnsSTATIC_DNS
features.SwitchBgpRoutingSWITCH_BGP_ROUTING
features.SwitchCustomAclRulesSWITCH_CUSTOM_ACL_RULES
features.SwitchGlobalAclRulesSWITCH_GLOBAL_ACL_RULES
features.TeleportTELEPORT
features.TrafficMapTRAFFIC_MAP
features.TrafficRouteKillSwitchTRAFFIC_ROUTE_KILL_SWITCH
features.TrafficRoutesTRAFFIC_ROUTES
features.TrafficRoutesIpsecS2sVpnTRAFFIC_ROUTES_IPSEC_S2S_VPN
features.TrafficRoutesOpenVpnS2sVpnTRAFFIC_ROUTES_OPENVPN_S2S_VPN
features.TrafficRuleAndRouteRegionsTRAFFIC_RULE_AND_ROUTE_REGIONS
features.TrafficRuleRateLimitingTRAFFIC_RULE_RATE_LIMITING
features.TrafficRuleSchedulesTRAFFIC_RULE_SCHEDULES
features.UdapiGetBlocksUDAPI_GET_BLOCKS
features.UcoreAutolinkDeviceUpdatesUCORE_AUTOLINK_DEVICE_UPDATES
features.UcorePartialDeviceUpdatesUCORE_PARTIAL_DEVICE_UPDATES
features.UidRadiusUID_RADIUS
features.UidRadiusGroupPolicyUID_RADIUS_GROUP_POLICY
features.UidVpnUID_VPN
features.UidVpnAllowWanLocalUID_VPN_ALLOW_WAN_LOCAL
features.UidVpnOverrideDnsUID_VPN_OVERRIDE_DNS
features.UidVpnStrictClientCommonNameUID_VPN_STRICT_CLIENT_COMMON_NAME
features.UidVpnSupportUdpUID_VPN_SUPPORT_UDP
features.UidWifiUID_WIFI
features.UidWifiIotUID_WIFI_IOT
features.UidWifiRadiusGroupPolicyUID_WIFI_RADIUS_GROUP_POLICY
features.UnboundWanMonitorUNBOUND_WAN_MONITOR
features.UserDefinedNatRulesUSER_DEFINED_NAT_RULES
features.VisualProgrammingVISUAL_PROGRAMMING
features.WanDhcpRequestCosWAN_DHCP_REQUEST_COS
features.WanDhcpv6StatelessWAN_DHCPV6_STATELESS
features.WanDsLiteWAN_DS_LITE
features.WanLoadBalancingDistributedModeWAN_LOAD_BALANCING_DISTRIBUTED_MODE
features.WifiConfigCreatedWIFI_CONFIG_CREATED
features.WifiMimoWIFI_MIMO
features.WireguardVpnClientWIREGUARD_VPN_CLIENT
features.WireguardVpnServerWIREGUARD_VPN_SERVER
features.ZoneBasedFirewallZONE_BASED_FIREWALL
features.ZoneBasedFirewallMigrationZONE_BASED_FIREWALL_MIGRATION

See also

On this page