waft.actions.dashboard_actions.device_actions module

class waft.actions.dashboard_actions.device_actions.DeviceActions(dashboard: DashboardActions)

Bases: Actions

Class to define interactions with Zero Trust team devices over Cloudflare Python SDK

create_device_profile(profile_name: str, match_criteria: str) DeviceProfileModel

Creates and returns a device profile with the given name and WireFilter match criteria.

Parameters:
  • profile_name (str) – The name of the device settings profile.

  • match_criteria (str) – The wirefilter expression to match devices. Available values: “identity.email”, “identity.groups.id”, “identity.groups.name”, “identity.groups.email”, “identity.service_token_uuid”, “identity.saml_attributes” “network”, “os.name”, “os.version”.

Returns:

Device profile model with interactive methods

Return type:

DeviceProfileModel

delete(registration: RegistrationListResponse)

Removes a Zero Trust user seat.

Parameters:

registration (RegistrationListResponse) – Device registration object

enable_settings(disable_for_time: float | None = None, gateway_proxy_enabled: bool | None = None, gateway_udp_proxy_enabled: bool | None = None, root_certificate_installation_enabled: bool | None = None, use_zt_virtual_ip: bool | None = None) DeviceSettings

Enables WARP device API settings.

Parameters:
  • disable_for_time (Optional[float]) – Sets the time limit, in seconds, that a user can use an override code to bypass WARP.

  • gateway_proxy_enabled (Optional[bool]) – Enable gateway proxy filtering on TCP.

  • gateway_udp_proxy_enabled (Optional[bool]) – Enable gateway proxy filtering on UDP.

  • root_certificate_installation_enabled (Optional[bool]) – Enable installation of Cloudflare managed root certificate.

  • use_zt_virtual_ip (Optional[bool]) – Enable using CGNAT virtual IPv4.

Returns:

WARP device API settings

Return type:

DeviceSettings

get_admin_override_codes(registration_id: str) dict

Fetches one-time use admin override codes for a registration.

Parameters:

registration_id – Device registration ID to query

get_device_registration(user_email: str) RegistrationListResponse

Fetches a single WARP registration for the specified user email.

Parameters:

user_email (str) – Email address used to confirm device registration

Returns:

Device registration object

Return type:

RegistrationListResponse

reset_settings() DeviceSettings

Resets WARP device API settings to defaults.

Returns:

WARP device API settings

Return type:

DeviceSettings

revoke_access(registration_ids: list[str])

Revokes device registrations.

Parameters:

registration_ids (list[str]) – List of device registration IDs to revoke

Returns:

API response object

Return type:

object

property settings: DeviceSettings

Fetches WARP device API settings.