# DEX ## Domain Types ### Digital Experience Monitor - `class DigitalExperienceMonitor: …` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` ### Network Path - `class NetworkPath: …` - `slots: List[Slot]` - `id: str` API Resource UUID tag. - `client_to_app_rtt_ms: Optional[int]` Round trip time in ms of the client to app mile - `client_to_cf_egress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare egress mile - `client_to_cf_ingress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: str` - `client_to_isp_rtt_ms: Optional[int]` Round trip time in ms of the client to ISP mile - `sampling: Optional[Sampling]` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: Literal["hours"]` - `"hours"` - `value: int` ### Network Path Response - `class NetworkPathResponse: …` - `id: str` API Resource UUID tag. - `device_name: Optional[str]` - `interval: Optional[str]` The interval at which the Traceroute synthetic application test is set to run. - `kind: Optional[Literal["traceroute"]]` - `"traceroute"` - `name: Optional[str]` - `network_path: Optional[NetworkPath]` - `slots: List[Slot]` - `id: str` API Resource UUID tag. - `client_to_app_rtt_ms: Optional[int]` Round trip time in ms of the client to app mile - `client_to_cf_egress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare egress mile - `client_to_cf_ingress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: str` - `client_to_isp_rtt_ms: Optional[int]` Round trip time in ms of the client to ISP mile - `sampling: Optional[Sampling]` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: Literal["hours"]` - `"hours"` - `value: int` - `url: Optional[str]` The host of the Traceroute synthetic application test ### Percentiles - `class Percentiles: …` - `p50: Optional[float]` p50 observed in the time period - `p90: Optional[float]` p90 observed in the time period - `p95: Optional[float]` p95 observed in the time period - `p99: Optional[float]` p99 observed in the time period # WARP Change Events ## List WARP change events. `zero_trust.dex.warp_change_events.get(WARPChangeEventGetParams**kwargs) -> WARPChangeEventGetResponse` **get** `/accounts/{account_id}/dex/warp-change-events` List WARP configuration and enablement toggle change events by device. ### Parameters - `account_id: str` - `from_: str` Start time for the query in ISO (RFC3339 - ISO 8601) format - `page: float` Page number of paginated results - `per_page: float` Number of items per page - `to: str` End time for the query in ISO (RFC3339 - ISO 8601) format - `account_name: Optional[str]` Filter events by account name. - `config_name: Optional[str]` Filter events by WARP configuration name changed from or to. Applicable to type='config' events only. - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort response by event timestamp. - `"ASC"` - `"DESC"` - `toggle: Optional[Literal["on", "off"]]` Filter events by type toggle value. Applicable to type='toggle' events only. - `"on"` - `"off"` - `type: Optional[Literal["config", "toggle"]]` Filter events by type 'config' or 'toggle' - `"config"` - `"toggle"` ### Returns - `List[WARPChangeEventGetResponseItem]` - `class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPToggleChangeEvent: …` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` The public account identifier. - `device_id: Optional[str]` API Resource UUID tag. - `device_registration: Optional[str]` API Resource UUID tag. - `hostname: Optional[str]` The hostname of the machine the event is from - `serial_number: Optional[str]` The serial number of the machine the event is from - `timestamp: Optional[str]` Timestamp in ISO format - `toggle: Optional[Literal["on", "off"]]` The state of the WARP toggle. - `"on"` - `"off"` - `user_email: Optional[str]` Email tied to the device - `class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEvent: …` - `device_id: Optional[str]` API Resource UUID tag. - `device_registration: Optional[str]` API Resource UUID tag. - `from_: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventFrom]` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` API Resource UUID tag. - `config_name: Optional[str]` The name of the WARP configuration. - `hostname: Optional[str]` The hostname of the machine the event is from - `serial_number: Optional[str]` The serial number of the machine the event is from - `timestamp: Optional[str]` Timestamp in ISO format - `to: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventTo]` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` API Resource UUID tag. - `config_name: Optional[str]` The name of the WARP configuration. - `user_email: Optional[str]` Email tied to the device ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) warp_change_events = client.zero_trust.dex.warp_change_events.get( account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-09-20T17:00:00Z", page=1, per_page=1, to="2023-09-20T17:00:00Z", ) print(warp_change_events) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "account_name": "account_name", "account_tag": "account_tag", "device_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "device_registration": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "hostname": "hostname", "serial_number": "serial_number", "timestamp": "2023-10-11T00:00:00Z", "toggle": "on", "user_email": "user_email" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### WARP Change Event Get Response - `List[WARPChangeEventGetResponseItem]` - `class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPToggleChangeEvent: …` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` The public account identifier. - `device_id: Optional[str]` API Resource UUID tag. - `device_registration: Optional[str]` API Resource UUID tag. - `hostname: Optional[str]` The hostname of the machine the event is from - `serial_number: Optional[str]` The serial number of the machine the event is from - `timestamp: Optional[str]` Timestamp in ISO format - `toggle: Optional[Literal["on", "off"]]` The state of the WARP toggle. - `"on"` - `"off"` - `user_email: Optional[str]` Email tied to the device - `class WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEvent: …` - `device_id: Optional[str]` API Resource UUID tag. - `device_registration: Optional[str]` API Resource UUID tag. - `from_: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventFrom]` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` API Resource UUID tag. - `config_name: Optional[str]` The name of the WARP configuration. - `hostname: Optional[str]` The hostname of the machine the event is from - `serial_number: Optional[str]` The serial number of the machine the event is from - `timestamp: Optional[str]` Timestamp in ISO format - `to: Optional[WARPChangeEventGetResponseItemDigitalExperienceMonitoringWARPConfigChangeEventTo]` - `account_name: Optional[str]` The account name. - `account_tag: Optional[str]` API Resource UUID tag. - `config_name: Optional[str]` The name of the WARP configuration. - `user_email: Optional[str]` Email tied to the device # Commands ## List account commands `zero_trust.dex.commands.list(CommandListParams**kwargs) -> SyncV4PagePagination[Optional[CommandListResponse]]` **get** `/accounts/{account_id}/dex/commands` Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters ### Parameters - `account_id: str` - `page: float` Page number for pagination - `per_page: float` Number of results per page - `command_type: Optional[str]` Optionally filter executed commands by command type - `device_id: Optional[str]` Unique identifier for a device - `from_: Optional[Union[str, datetime]]` Start time for the query in ISO (RFC3339 - ISO 8601) format - `status: Optional[Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"]]` Optionally filter executed commands by status - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `to: Optional[Union[str, datetime]]` End time for the query in ISO (RFC3339 - ISO 8601) format - `user_email: Optional[str]` Email tied to the device ### Returns - `class CommandListResponse: …` - `commands: Optional[List[Command]]` - `id: Optional[str]` - `completed_date: Optional[datetime]` - `created_date: Optional[datetime]` - `device_id: Optional[str]` - `filename: Optional[str]` - `registration_id: Optional[str]` Unique identifier for the device registration - `status: Optional[str]` - `type: Optional[str]` - `user_email: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.commands.list( account_id="01a7362d577a6c3019a474fd6f485823", page=1, per_page=50, ) page = page.result.items[0] print(page.commands) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "commands": [ { "id": "id", "completed_date": "2019-12-27T18:11:19.117Z", "created_date": "2019-12-27T18:11:19.117Z", "device_id": "device_id", "filename": "filename", "registration_id": "registration_id", "status": "status", "type": "type", "user_email": "user_email" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create account commands `zero_trust.dex.commands.create(CommandCreateParams**kwargs) -> CommandCreateResponse` **post** `/accounts/{account_id}/dex/commands` Initiate commands for up to 10 devices per account ### Parameters - `account_id: str` - `commands: Iterable[Command]` List of device-level commands to execute - `command_type: Literal["pcap", "warp-diag"]` Type of command to execute on the device - `"pcap"` - `"warp-diag"` - `device_id: str` Unique identifier for the physical device - `user_email: str` Email tied to the device - `command_args: Optional[CommandCommandArgs]` - `interfaces: Optional[List[Literal["default", "tunnel"]]]` List of interfaces to capture packets on - `"default"` - `"tunnel"` - `max_file_size_mb: Optional[float]` Maximum file size (in MB) for the capture file. Specifies the maximum file size of the warp-diag zip artifact that can be uploaded. If the zip artifact exceeds the specified max file size, it will NOT be uploaded - `packet_size_bytes: Optional[float]` Maximum number of bytes to save for each packet - `test_all_routes: Optional[bool]` Test an IP address from all included or excluded ranges. Tests an IP address from all included or excluded ranges. Essentially the same as running 'route get '' and collecting the results. This option may increase the time taken to collect the warp-diag - `time_limit_min: Optional[float]` Limit on capture duration (in minutes) - `registration_id: Optional[str]` Unique identifier for the device registration. Required for multi-user devices to target the correct user session. ### Returns - `class CommandCreateResponse: …` - `commands: Optional[List[Command]]` List of created commands - `id: Optional[str]` Unique identifier for the command - `args: Optional[Dict[str, str]]` Command arguments - `device_id: Optional[str]` Identifier for the device associated with the command - `registration_id: Optional[str]` Unique identifier for the device registration - `status: Optional[Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"]]` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type: Optional[str]` Type of the command (e.g., "pcap" or "warp-diag") ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) command = client.zero_trust.dex.commands.create( account_id="01a7362d577a6c3019a474fd6f485823", commands=[{ "command_type": "pcap", "device_id": "device_id", "user_email": "user_email", }], ) print(command.commands) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "commands": [ { "id": "id", "args": { "foo": "string" }, "device_id": "device_id", "registration_id": "registration_id", "status": "PENDING_EXEC", "type": "type" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Command List Response - `class CommandListResponse: …` - `commands: Optional[List[Command]]` - `id: Optional[str]` - `completed_date: Optional[datetime]` - `created_date: Optional[datetime]` - `device_id: Optional[str]` - `filename: Optional[str]` - `registration_id: Optional[str]` Unique identifier for the device registration - `status: Optional[str]` - `type: Optional[str]` - `user_email: Optional[str]` ### Command Create Response - `class CommandCreateResponse: …` - `commands: Optional[List[Command]]` List of created commands - `id: Optional[str]` Unique identifier for the command - `args: Optional[Dict[str, str]]` Command arguments - `device_id: Optional[str]` Identifier for the device associated with the command - `registration_id: Optional[str]` Unique identifier for the device registration - `status: Optional[Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"]]` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type: Optional[str]` Type of the command (e.g., "pcap" or "warp-diag") # Devices ## List devices eligible for remote captures `zero_trust.dex.commands.devices.list(DeviceListParams**kwargs) -> SyncV4PagePagination[Optional[DeviceListResponse]]` **get** `/accounts/{account_id}/dex/commands/devices` List devices with WARP client support for remote captures which have been connected in the last 1 hour. ### Parameters - `account_id: str` - `page: float` Page number of paginated results - `per_page: float` Number of items per page - `search: Optional[str]` Filter devices by name or email ### Returns - `class DeviceListResponse: …` - `devices: Optional[List[Device]]` List of eligible devices - `device_id: Optional[str]` Device identifier (UUID v4) - `device_name: Optional[str]` Device identifier (human readable) - `eligible: Optional[bool]` Whether the device is eligible for remote captures - `ineligible_reason: Optional[str]` If the device is not eligible, the reason why. - `person_email: Optional[str]` User contact email address - `platform: Optional[str]` Operating system - `registration_id: Optional[str]` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status: Optional[str]` Network status - `timestamp: Optional[str]` Timestamp in ISO format - `version: Optional[str]` WARP client version ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.commands.devices.list( account_id="01a7362d577a6c3019a474fd6f485823", page=1, per_page=1, ) page = page.result.items[0] print(page.devices) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "devices": [ { "deviceId": "deviceId", "deviceName": "deviceName", "eligible": true, "ineligibleReason": "ineligibleReason", "personEmail": "personEmail", "platform": "windows", "registrationId": "registrationId", "status": "connected", "timestamp": "2023-10-11T00:00:00Z", "version": "1.0.0" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Device List Response - `class DeviceListResponse: …` - `devices: Optional[List[Device]]` List of eligible devices - `device_id: Optional[str]` Device identifier (UUID v4) - `device_name: Optional[str]` Device identifier (human readable) - `eligible: Optional[bool]` Whether the device is eligible for remote captures - `ineligible_reason: Optional[str]` If the device is not eligible, the reason why. - `person_email: Optional[str]` User contact email address - `platform: Optional[str]` Operating system - `registration_id: Optional[str]` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status: Optional[str]` Network status - `timestamp: Optional[str]` Timestamp in ISO format - `version: Optional[str]` WARP client version # Downloads ## Download command output file `zero_trust.dex.commands.downloads.get(strfilename, DownloadGetParams**kwargs) -> BinaryResponseContent` **get** `/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}` Downloads artifacts for an executed command. Bulk downloads are not supported ### Parameters - `account_id: str` - `command_id: str` Unique identifier for a command - `filename: str` ### Returns - `BinaryResponseContent` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) download = client.zero_trust.dex.commands.downloads.get( filename="filename", account_id="01a7362d577a6c3019a474fd6f485823", command_id="5758fefe-ae7e-4538-a39b-1fef6abcb909", ) print(download) content = download.read() print(content) ``` # Quota ## Returns account commands usage, quota, and reset time `zero_trust.dex.commands.quota.get(QuotaGetParams**kwargs) -> QuotaGetResponse` **get** `/accounts/{account_id}/dex/commands/quota` Retrieves the current quota usage and limits for device commands within a specific account, including the time when the quota will reset ### Parameters - `account_id: str` ### Returns - `class QuotaGetResponse: …` - `quota: float` The remaining number of commands that can be initiated for an account - `quota_usage: float` The number of commands that have been initiated for an account - `reset_time: datetime` The time when the quota resets ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) quota = client.zero_trust.dex.commands.quota.get( account_id="01a7362d577a6c3019a474fd6f485823", ) print(quota.quota) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "quota": 0, "quota_usage": 0, "reset_time": "2019-12-27T18:11:19.117Z" }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Quota Get Response - `class QuotaGetResponse: …` - `quota: float` The remaining number of commands that can be initiated for an account - `quota_usage: float` The number of commands that have been initiated for an account - `reset_time: datetime` The time when the quota resets # Colos ## List Cloudflare colos `zero_trust.dex.colos.list(ColoListParams**kwargs) -> SyncSinglePage[ColoListResponse]` **get** `/accounts/{account_id}/dex/colos` List Cloudflare colos that account's devices were connected to during a time period, sorted by usage starting from the most used colo. Colos without traffic are also returned and sorted alphabetically. ### Parameters - `account_id: str` - `from_: str` Start time for connection period in ISO (RFC3339 - ISO 8601) format - `to: str` End time for connection period in ISO (RFC3339 - ISO 8601) format - `sort_by: Optional[Literal["fleet-status-usage", "application-tests-usage"]]` Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically. - `"fleet-status-usage"` - `"application-tests-usage"` ### Returns - `class ColoListResponse: …` - `airport_code: str` Airport code - `city: str` City - `country_code: str` Country code ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.colos.list( account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-08-20T20:45:00Z", to="2023-08-24T20:45:00Z", ) page = page.result[0] print(page.airport_code) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "airportCode": "SFO", "city": "San Francisco", "countryCode": "US" } ] } ``` ## Domain Types ### Colo List Response - `class ColoListResponse: …` - `airport_code: str` Airport code - `city: str` City - `country_code: str` Country code # Fleet Status ## List fleet status details by dimension `zero_trust.dex.fleet_status.live(FleetStatusLiveParams**kwargs) -> FleetStatusLiveResponse` **get** `/accounts/{account_id}/dex/fleet-status/live` List details for live (up to 60 minutes) devices using WARP ### Parameters - `account_id: str` - `since_minutes: float` Number of minutes before current time ### Returns - `class FleetStatusLiveResponse: …` - `device_stats: Optional[DeviceStats]` - `by_colo: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_mode: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_platform: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_status: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_version: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `unique_devices_total: Optional[float]` Number of unique devices ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.zero_trust.dex.fleet_status.live( account_id="01a7362d577a6c3019a474fd6f485823", since_minutes=10, ) print(response.device_stats) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "deviceStats": { "byColo": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byMode": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byPlatform": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byStatus": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "byVersion": [ { "uniqueDevicesTotal": 0, "value": "value" } ], "uniqueDevicesTotal": 0 } } } ``` ## List fleet status aggregate details by dimension `zero_trust.dex.fleet_status.over_time(FleetStatusOverTimeParams**kwargs) -> FleetStatusOverTimeResponse` **get** `/accounts/{account_id}/dex/fleet-status/over-time` List details for devices using WARP, up to 7 days ### Parameters - `account_id: str` - `from_: str` Time range beginning in ISO format - `to: str` Time range end in ISO format - `colo: Optional[str]` Cloudflare colo - `device_id: Optional[str]` Device-specific ID, given as UUID v4 ### Returns - `class FleetStatusOverTimeResponse: …` - `device_stats: Optional[DeviceStats]` - `by_mode: Optional[List[DeviceStatsByMode]]` - `timestamp: Optional[str]` Timestamp in ISO format - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_status: Optional[List[DeviceStatsByStatus]]` - `timestamp: Optional[str]` Timestamp in ISO format - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `unique_devices_total: Optional[float]` Number of unique devices ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.zero_trust.dex.fleet_status.over_time( account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-10-11T00:00:00Z", to="2023-10-11T00:00:00Z", ) print(response.device_stats) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "deviceStats": { "byMode": [ { "timestamp": "2023-10-11T00:00:00Z", "uniqueDevicesTotal": 0, "value": "value" } ], "byStatus": [ { "timestamp": "2023-10-11T00:00:00Z", "uniqueDevicesTotal": 0, "value": "value" } ], "uniqueDevicesTotal": 0 } }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Live Stat - `class LiveStat: …` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` ### Fleet Status Live Response - `class FleetStatusLiveResponse: …` - `device_stats: Optional[DeviceStats]` - `by_colo: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_mode: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_platform: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_status: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_version: Optional[List[LiveStat]]` - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `unique_devices_total: Optional[float]` Number of unique devices ### Fleet Status Over Time Response - `class FleetStatusOverTimeResponse: …` - `device_stats: Optional[DeviceStats]` - `by_mode: Optional[List[DeviceStatsByMode]]` - `timestamp: Optional[str]` Timestamp in ISO format - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `by_status: Optional[List[DeviceStatsByStatus]]` - `timestamp: Optional[str]` Timestamp in ISO format - `unique_devices_total: Optional[float]` Number of unique devices - `value: Optional[str]` - `unique_devices_total: Optional[float]` Number of unique devices # Devices ## List fleet status devices `zero_trust.dex.fleet_status.devices.list(DeviceListParams**kwargs) -> SyncV4PagePaginationArray[DeviceListResponse]` **get** `/accounts/{account_id}/dex/fleet-status/devices` List details for devices using WARP ### Parameters - `account_id: str` - `from_: str` Time range beginning in ISO format - `page: float` Page number - `per_page: float` Number of results per page - `to: str` Time range end in ISO format - `colo: Optional[str]` Cloudflare colo - `device_id: Optional[str]` Device-specific ID, given as UUID v4 - `mode: Optional[str]` The mode under which the WARP client is run - `platform: Optional[str]` Operating system - `sort_by: Optional[Literal["colo", "device_id", "mode", 4 more]]` Dimension to sort results by - `"colo"` - `"device_id"` - `"mode"` - `"platform"` - `"status"` - `"timestamp"` - `"version"` - `source: Optional[Literal["last_seen", "hourly", "raw"]]` Source: * `hourly` - device details aggregated hourly, up to 7 days prior * `last_seen` - device details, up to 60 minutes prior * `raw` - device details, up to 7 days prior - `"last_seen"` - `"hourly"` - `"raw"` - `status: Optional[str]` Network status - `version: Optional[str]` WARP client version ### Returns - `class DeviceListResponse: …` - `colo: str` Cloudflare colo - `device_id: str` Device identifier (UUID v4) - `mode: str` The mode under which the WARP client is run - `platform: str` Operating system - `status: str` Network status - `timestamp: str` Timestamp in ISO format - `version: str` WARP client version - `always_on: Optional[bool]` - `battery_charging: Optional[bool]` - `battery_cycles: Optional[int]` - `battery_pct: Optional[float]` - `connection_type: Optional[str]` - `cpu_pct: Optional[float]` - `cpu_pct_by_app: Optional[List[List[CPUPctByApp]]]` - `cpu_pct: Optional[float]` - `name: Optional[str]` - `device_ipv4: Optional[DeviceIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[DeviceIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `device_ipv6: Optional[DeviceIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[DeviceIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `device_name: Optional[str]` Device identifier (human readable) - `disk_read_bps: Optional[int]` - `disk_usage_pct: Optional[float]` - `disk_write_bps: Optional[int]` - `doh_subdomain: Optional[str]` - `estimated_loss_pct: Optional[float]` - `firewall_enabled: Optional[bool]` - `gateway_ipv4: Optional[GatewayIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[GatewayIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `gateway_ipv6: Optional[GatewayIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[GatewayIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `handshake_latency_ms: Optional[float]` - `isp_ipv4: Optional[ISPIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[ISPIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `isp_ipv6: Optional[ISPIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[ISPIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `metal: Optional[str]` - `network_rcvd_bps: Optional[int]` - `network_sent_bps: Optional[int]` - `network_ssid: Optional[str]` - `person_email: Optional[str]` User contact email address - `ram_available_kb: Optional[int]` - `ram_used_pct: Optional[float]` - `ram_used_pct_by_app: Optional[List[List[RamUsedPctByApp]]]` - `name: Optional[str]` - `ram_used_pct: Optional[float]` - `switch_locked: Optional[bool]` - `wifi_strength_dbm: Optional[int]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.fleet_status.devices.list( account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-10-11T00:00:00Z", page=1, per_page=10, to="2023-10-11T00:00:00Z", ) page = page.result[0] print(page.network_ssid) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": [ { "colo": "SJC", "deviceId": "deviceId", "mode": "proxy", "platform": "windows", "status": "connected", "timestamp": "2023-10-11T00:00:00Z", "version": "1.0.0", "alwaysOn": true, "batteryCharging": true, "batteryCycles": 0, "batteryPct": 0, "connectionType": "connectionType", "cpuPct": 0, "cpuPctByApp": [ [ { "cpu_pct": 0, "name": "name" } ] ], "deviceIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "deviceIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "deviceName": "deviceName", "diskReadBps": 0, "diskUsagePct": 0, "diskWriteBps": 0, "dohSubdomain": "dohSubdomain", "estimatedLossPct": 0, "firewallEnabled": true, "gatewayIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "gatewayIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "handshakeLatencyMs": 0, "ispIpv4": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "ispIpv6": { "address": "address", "asn": 0, "aso": "aso", "location": { "city": "city", "country_iso": "country_iso", "state_iso": "state_iso", "zip": "zip" }, "netmask": "netmask", "version": "version" }, "metal": "metal", "networkRcvdBps": 0, "networkSentBps": 0, "networkSsid": "networkSsid", "personEmail": "personEmail", "ramAvailableKb": 0, "ramUsedPct": 0, "ramUsedPctByApp": [ [ { "name": "name", "ram_used_pct": 0 } ] ], "switchLocked": true, "wifiStrengthDbm": 0 } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Device List Response - `class DeviceListResponse: …` - `colo: str` Cloudflare colo - `device_id: str` Device identifier (UUID v4) - `mode: str` The mode under which the WARP client is run - `platform: str` Operating system - `status: str` Network status - `timestamp: str` Timestamp in ISO format - `version: str` WARP client version - `always_on: Optional[bool]` - `battery_charging: Optional[bool]` - `battery_cycles: Optional[int]` - `battery_pct: Optional[float]` - `connection_type: Optional[str]` - `cpu_pct: Optional[float]` - `cpu_pct_by_app: Optional[List[List[CPUPctByApp]]]` - `cpu_pct: Optional[float]` - `name: Optional[str]` - `device_ipv4: Optional[DeviceIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[DeviceIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `device_ipv6: Optional[DeviceIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[DeviceIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `device_name: Optional[str]` Device identifier (human readable) - `disk_read_bps: Optional[int]` - `disk_usage_pct: Optional[float]` - `disk_write_bps: Optional[int]` - `doh_subdomain: Optional[str]` - `estimated_loss_pct: Optional[float]` - `firewall_enabled: Optional[bool]` - `gateway_ipv4: Optional[GatewayIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[GatewayIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `gateway_ipv6: Optional[GatewayIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[GatewayIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `handshake_latency_ms: Optional[float]` - `isp_ipv4: Optional[ISPIPV4]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[ISPIPV4Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `isp_ipv6: Optional[ISPIPV6]` - `address: Optional[str]` - `asn: Optional[int]` - `aso: Optional[str]` - `location: Optional[ISPIPV6Location]` - `city: Optional[str]` - `country_iso: Optional[str]` - `state_iso: Optional[str]` - `zip: Optional[str]` - `netmask: Optional[str]` - `version: Optional[str]` - `metal: Optional[str]` - `network_rcvd_bps: Optional[int]` - `network_sent_bps: Optional[int]` - `network_ssid: Optional[str]` - `person_email: Optional[str]` User contact email address - `ram_available_kb: Optional[int]` - `ram_used_pct: Optional[float]` - `ram_used_pct_by_app: Optional[List[List[RamUsedPctByApp]]]` - `name: Optional[str]` - `ram_used_pct: Optional[float]` - `switch_locked: Optional[bool]` - `wifi_strength_dbm: Optional[int]` # HTTP Tests ## Get details and aggregate metrics for an http test `zero_trust.dex.http_tests.get(strtest_id, HTTPTestGetParams**kwargs) -> HTTPDetails` **get** `/accounts/{account_id}/dex/http-tests/{test_id}` Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days. ### Parameters - `account_id: str` - `test_id: str` API Resource UUID tag. - `from_: str` Start time for aggregate metrics in ISO ms - `interval: Literal["minute", "hour"]` Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: str` End time for aggregate metrics in ISO ms - `colo: Optional[str]` Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `class HTTPDetails: …` - `host: Optional[str]` The url of the HTTP synthetic application test - `http_stats: Optional[HTTPStats]` - `availability_pct: HTTPStatsAvailabilityPct` - `slots: List[HTTPStatsAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `dns_response_time_ms: TestStatOverTime` - `slots: List[Slot]` - `timestamp: str` - `value: int` - `avg: Optional[int]` average observed in the time period - `max: Optional[int]` highest observed in the time period - `min: Optional[int]` lowest observed in the time period - `http_status_code: List[HTTPStatsHTTPStatusCode]` - `status200: int` - `status300: int` - `status400: int` - `status500: int` - `timestamp: str` - `resource_fetch_time_ms: TestStatOverTime` - `server_response_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `http_stats_by_colo: Optional[List[HTTPStatsByColo]]` - `availability_pct: HTTPStatsByColoAvailabilityPct` - `slots: List[HTTPStatsByColoAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `colo: str` - `dns_response_time_ms: TestStatOverTime` - `http_status_code: List[HTTPStatsByColoHTTPStatusCode]` - `status200: int` - `status300: int` - `status400: int` - `status500: int` - `timestamp: str` - `resource_fetch_time_ms: TestStatOverTime` - `server_response_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `interval: Optional[str]` The interval at which the HTTP synthetic application test is set to run. - `kind: Optional[Literal["http"]]` - `"http"` - `method: Optional[str]` The HTTP method to use when running the test - `name: Optional[str]` The name of the HTTP synthetic application test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) http_details = client.zero_trust.dex.http_tests.get( test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", from_="1689520412000", interval="minute", to="1689606812000", ) print(http_details.host) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "host": "http://example.com", "httpStats": { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "dnsResponseTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "httpStatusCode": [ { "status200": 0, "status300": 0, "status400": 0, "status500": 0, "timestamp": "2023-07-16 15:00:00+00" } ], "resourceFetchTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "serverResponseTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 }, "httpStatsByColo": [ { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "colo": "DFW", "dnsResponseTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "httpStatusCode": [ { "status200": 0, "status300": 0, "status400": 0, "status500": 0, "timestamp": "2023-07-16 15:00:00+00" } ], "resourceFetchTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "serverResponseTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 } ], "interval": "0h5m0s", "kind": "http", "method": "GET", "name": "Atlassian Sign In Page", "target_policies": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "default": true, "name": "name" } ], "targeted": true } } ``` ## Domain Types ### HTTP Details - `class HTTPDetails: …` - `host: Optional[str]` The url of the HTTP synthetic application test - `http_stats: Optional[HTTPStats]` - `availability_pct: HTTPStatsAvailabilityPct` - `slots: List[HTTPStatsAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `dns_response_time_ms: TestStatOverTime` - `slots: List[Slot]` - `timestamp: str` - `value: int` - `avg: Optional[int]` average observed in the time period - `max: Optional[int]` highest observed in the time period - `min: Optional[int]` lowest observed in the time period - `http_status_code: List[HTTPStatsHTTPStatusCode]` - `status200: int` - `status300: int` - `status400: int` - `status500: int` - `timestamp: str` - `resource_fetch_time_ms: TestStatOverTime` - `server_response_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `http_stats_by_colo: Optional[List[HTTPStatsByColo]]` - `availability_pct: HTTPStatsByColoAvailabilityPct` - `slots: List[HTTPStatsByColoAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `colo: str` - `dns_response_time_ms: TestStatOverTime` - `http_status_code: List[HTTPStatsByColoHTTPStatusCode]` - `status200: int` - `status300: int` - `status400: int` - `status500: int` - `timestamp: str` - `resource_fetch_time_ms: TestStatOverTime` - `server_response_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `interval: Optional[str]` The interval at which the HTTP synthetic application test is set to run. - `kind: Optional[Literal["http"]]` - `"http"` - `method: Optional[str]` The HTTP method to use when running the test - `name: Optional[str]` The name of the HTTP synthetic application test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` # Percentiles ## Get percentiles for an http test `zero_trust.dex.http_tests.percentiles.get(strtest_id, PercentileGetParams**kwargs) -> HTTPDetailsPercentiles` **get** `/accounts/{account_id}/dex/http-tests/{test_id}/percentiles` Get percentiles for an http test for a given time period between 1 hour and 7 days. ### Parameters - `account_id: str` - `test_id: str` API Resource UUID tag. - `from_: str` Start time for the query in ISO (RFC3339 - ISO 8601) format - `to: str` End time for the query in ISO (RFC3339 - ISO 8601) format - `colo: Optional[str]` Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `class HTTPDetailsPercentiles: …` - `dns_response_time_ms: Optional[Percentiles]` - `p50: Optional[float]` p50 observed in the time period - `p90: Optional[float]` p90 observed in the time period - `p95: Optional[float]` p95 observed in the time period - `p99: Optional[float]` p99 observed in the time period - `resource_fetch_time_ms: Optional[Percentiles]` - `server_response_time_ms: Optional[Percentiles]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) http_details_percentiles = client.zero_trust.dex.http_tests.percentiles.get( test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-09-20T17:00:00Z", to="2023-09-20T17:00:00Z", ) print(http_details_percentiles.dns_response_time_ms) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "dnsResponseTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "resourceFetchTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "serverResponseTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 } } } ``` ## Domain Types ### HTTP Details Percentiles - `class HTTPDetailsPercentiles: …` - `dns_response_time_ms: Optional[Percentiles]` - `p50: Optional[float]` p50 observed in the time period - `p90: Optional[float]` p90 observed in the time period - `p95: Optional[float]` p95 observed in the time period - `p99: Optional[float]` p99 observed in the time period - `resource_fetch_time_ms: Optional[Percentiles]` - `server_response_time_ms: Optional[Percentiles]` ### Test Stat Over Time - `class TestStatOverTime: …` - `slots: List[Slot]` - `timestamp: str` - `value: int` - `avg: Optional[int]` average observed in the time period - `max: Optional[int]` highest observed in the time period - `min: Optional[int]` lowest observed in the time period # Tests ## List DEX test analytics `zero_trust.dex.tests.list(TestListParams**kwargs) -> SyncV4PagePagination[Optional[Tests]]` **get** `/accounts/{account_id}/dex/tests/overview` List DEX tests with overview metrics ### Parameters - `account_id: str` - `colo: Optional[str]` Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `kind: Optional[Literal["http", "traceroute"]]` Filter by test type - `"http"` - `"traceroute"` - `page: Optional[float]` Page number of paginated results - `per_page: Optional[float]` Number of items per page - `test_name: Optional[str]` Optionally filter results by test name ### Returns - `class Tests: …` - `overview_metrics: OverviewMetrics` - `tests_total: int` number of tests. - `avg_http_availability_pct: Optional[float]` percentage availability for all HTTP test results in response - `avg_traceroute_availability_pct: Optional[float]` percentage availability for all traceroutes results in response - `tests: List[Test]` array of test results objects. - `id: str` API Resource UUID tag. - `created: str` date the test was created. - `description: str` the test description defined during configuration - `enabled: bool` if true, then the test will run on targeted devices. Else, the test will not run. - `host: str` - `interval: str` The interval at which the synthetic application test is set to run. - `kind: Literal["http", "traceroute"]` test type, http or traceroute - `"http"` - `"traceroute"` - `name: str` name given to this test - `updated: str` - `http_results: Optional[TestHTTPResults]` - `resource_fetch_time: TestHTTPResultsResourceFetchTime` - `history: List[TestHTTPResultsResourceFetchTimeHistory]` - `time_period: AggregateTimePeriod` - `units: Literal["hours", "days", "testRuns"]` - `"hours"` - `"days"` - `"testRuns"` - `value: int` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestHTTPResultsResourceFetchTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestHTTPResultsResourceFetchTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `http_results_by_colo: Optional[List[TestHTTPResultsByColo]]` - `colo: str` Cloudflare colo - `resource_fetch_time: TestHTTPResultsByColoResourceFetchTime` - `history: List[TestHTTPResultsByColoResourceFetchTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestHTTPResultsByColoResourceFetchTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestHTTPResultsByColoResourceFetchTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `method: Optional[str]` for HTTP, the method to use when running the test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` - `traceroute_results: Optional[TestTracerouteResults]` - `round_trip_time: TestTracerouteResultsRoundTripTime` - `history: List[TestTracerouteResultsRoundTripTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestTracerouteResultsRoundTripTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestTracerouteResultsRoundTripTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `traceroute_results_by_colo: Optional[List[TestTracerouteResultsByColo]]` - `colo: str` Cloudflare colo - `round_trip_time: TestTracerouteResultsByColoRoundTripTime` - `history: List[TestTracerouteResultsByColoRoundTripTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestTracerouteResultsByColoRoundTripTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestTracerouteResultsByColoRoundTripTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.tests.list( account_id="01a7362d577a6c3019a474fd6f485823", ) page = page.result.items[0] print(page.overview_metrics) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "overviewMetrics": { "testsTotal": 0, "avgHttpAvailabilityPct": 0, "avgTracerouteAvailabilityPct": 0 }, "tests": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created": "created", "description": "description", "enabled": true, "host": "host", "interval": "interval", "kind": "http", "name": "name", "updated": "updated", "httpResults": { "resourceFetchTime": { "history": [ { "timePeriod": { "units": "hours", "value": 0 }, "avgMs": 0, "deltaPct": 0 } ], "avgMs": 0, "overTime": { "timePeriod": { "units": "hours", "value": 0 }, "values": [ { "avgMs": 0, "timestamp": "timestamp" } ] } } }, "httpResultsByColo": [ { "colo": "SJC", "resourceFetchTime": { "history": [ { "timePeriod": { "units": "hours", "value": 0 }, "avgMs": 0, "deltaPct": 0 } ], "avgMs": 0, "overTime": { "timePeriod": { "units": "hours", "value": 0 }, "values": [ { "avgMs": 0, "timestamp": "timestamp" } ] } } } ], "method": "method", "target_policies": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "default": true, "name": "name" } ], "targeted": true, "tracerouteResults": { "roundTripTime": { "history": [ { "timePeriod": { "units": "hours", "value": 0 }, "avgMs": 0, "deltaPct": 0 } ], "avgMs": 0, "overTime": { "timePeriod": { "units": "hours", "value": 0 }, "values": [ { "avgMs": 0, "timestamp": "timestamp" } ] } } }, "tracerouteResultsByColo": [ { "colo": "SJC", "roundTripTime": { "history": [ { "timePeriod": { "units": "hours", "value": 0 }, "avgMs": 0, "deltaPct": 0 } ], "avgMs": 0, "overTime": { "timePeriod": { "units": "hours", "value": 0 }, "values": [ { "avgMs": 0, "timestamp": "timestamp" } ] } } } ] } ] } } ``` ## Domain Types ### Aggregate Time Period - `class AggregateTimePeriod: …` - `units: Literal["hours", "days", "testRuns"]` - `"hours"` - `"days"` - `"testRuns"` - `value: int` ### Tests - `class Tests: …` - `overview_metrics: OverviewMetrics` - `tests_total: int` number of tests. - `avg_http_availability_pct: Optional[float]` percentage availability for all HTTP test results in response - `avg_traceroute_availability_pct: Optional[float]` percentage availability for all traceroutes results in response - `tests: List[Test]` array of test results objects. - `id: str` API Resource UUID tag. - `created: str` date the test was created. - `description: str` the test description defined during configuration - `enabled: bool` if true, then the test will run on targeted devices. Else, the test will not run. - `host: str` - `interval: str` The interval at which the synthetic application test is set to run. - `kind: Literal["http", "traceroute"]` test type, http or traceroute - `"http"` - `"traceroute"` - `name: str` name given to this test - `updated: str` - `http_results: Optional[TestHTTPResults]` - `resource_fetch_time: TestHTTPResultsResourceFetchTime` - `history: List[TestHTTPResultsResourceFetchTimeHistory]` - `time_period: AggregateTimePeriod` - `units: Literal["hours", "days", "testRuns"]` - `"hours"` - `"days"` - `"testRuns"` - `value: int` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestHTTPResultsResourceFetchTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestHTTPResultsResourceFetchTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `http_results_by_colo: Optional[List[TestHTTPResultsByColo]]` - `colo: str` Cloudflare colo - `resource_fetch_time: TestHTTPResultsByColoResourceFetchTime` - `history: List[TestHTTPResultsByColoResourceFetchTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestHTTPResultsByColoResourceFetchTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestHTTPResultsByColoResourceFetchTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `method: Optional[str]` for HTTP, the method to use when running the test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` - `traceroute_results: Optional[TestTracerouteResults]` - `round_trip_time: TestTracerouteResultsRoundTripTime` - `history: List[TestTracerouteResultsRoundTripTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestTracerouteResultsRoundTripTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestTracerouteResultsRoundTripTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` - `traceroute_results_by_colo: Optional[List[TestTracerouteResultsByColo]]` - `colo: str` Cloudflare colo - `round_trip_time: TestTracerouteResultsByColoRoundTripTime` - `history: List[TestTracerouteResultsByColoRoundTripTimeHistory]` - `time_period: AggregateTimePeriod` - `avg_ms: Optional[int]` - `delta_pct: Optional[float]` - `avg_ms: Optional[int]` - `over_time: Optional[TestTracerouteResultsByColoRoundTripTimeOverTime]` - `time_period: AggregateTimePeriod` - `values: List[TestTracerouteResultsByColoRoundTripTimeOverTimeValue]` - `avg_ms: int` - `timestamp: str` # Unique Devices ## Get count of devices targeted `zero_trust.dex.tests.unique_devices.list(UniqueDeviceListParams**kwargs) -> UniqueDevices` **get** `/accounts/{account_id}/dex/tests/unique-devices` Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days. ### Parameters - `account_id: str` - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `test_name: Optional[str]` Optionally filter results by test name ### Returns - `class UniqueDevices: …` - `unique_devices_total: int` total number of unique devices ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) unique_devices = client.zero_trust.dex.tests.unique_devices.list( account_id="01a7362d577a6c3019a474fd6f485823", ) print(unique_devices.unique_devices_total) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "uniqueDevicesTotal": 0 } } ``` ## Domain Types ### Unique Devices - `class UniqueDevices: …` - `unique_devices_total: int` total number of unique devices # Traceroute Test Results # Network Path ## Get details for a specific traceroute test run `zero_trust.dex.traceroute_test_results.network_path.get(strtest_result_id, NetworkPathGetParams**kwargs) -> NetworkPathGetResponse` **get** `/accounts/{account_id}/dex/traceroute-test-results/{test_result_id}/network-path` Get a breakdown of hops and performance metrics for a specific traceroute test run ### Parameters - `account_id: str` - `test_result_id: str` API Resource UUID tag. ### Returns - `class NetworkPathGetResponse: …` - `hops: List[Hop]` an array of the hops taken by the device to reach the end destination - `ttl: int` - `asn: Optional[int]` - `aso: Optional[str]` - `ip_address: Optional[str]` - `location: Optional[HopLocation]` - `city: Optional[str]` - `state: Optional[str]` - `zip: Optional[str]` - `mile: Optional[Literal["client-to-app", "client-to-cf-egress", "client-to-cf-ingress", "client-to-isp"]]` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name: Optional[str]` - `packet_loss_pct: Optional[float]` - `rtt_ms: Optional[int]` - `result_id: str` API Resource UUID tag. - `device_name: Optional[str]` name of the device associated with this network path response - `test_id: Optional[str]` API Resource UUID tag. - `test_name: Optional[str]` name of the tracroute test ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) network_path = client.zero_trust.dex.traceroute_test_results.network_path.get( test_result_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) print(network_path.hops) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "hops": [ { "ttl": 0, "asn": 0, "aso": "aso", "ipAddress": "ipAddress", "location": { "city": "city", "state": "state", "zip": "zip" }, "mile": "client-to-app", "name": "name", "packetLossPct": 0, "rttMs": 0 } ], "resultId": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "deviceName": "deviceName", "testId": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "testName": "testName" } } ``` ## Domain Types ### Network Path Get Response - `class NetworkPathGetResponse: …` - `hops: List[Hop]` an array of the hops taken by the device to reach the end destination - `ttl: int` - `asn: Optional[int]` - `aso: Optional[str]` - `ip_address: Optional[str]` - `location: Optional[HopLocation]` - `city: Optional[str]` - `state: Optional[str]` - `zip: Optional[str]` - `mile: Optional[Literal["client-to-app", "client-to-cf-egress", "client-to-cf-ingress", "client-to-isp"]]` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name: Optional[str]` - `packet_loss_pct: Optional[float]` - `rtt_ms: Optional[int]` - `result_id: str` API Resource UUID tag. - `device_name: Optional[str]` name of the device associated with this network path response - `test_id: Optional[str]` API Resource UUID tag. - `test_name: Optional[str]` name of the tracroute test # Traceroute Tests ## Get details and aggregate metrics for a traceroute test `zero_trust.dex.traceroute_tests.get(strtest_id, TracerouteTestGetParams**kwargs) -> Traceroute` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}` Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. ### Parameters - `account_id: str` - `test_id: str` API Resource UUID tag. - `from_: str` Start time for aggregate metrics in ISO ms - `interval: Literal["minute", "hour"]` Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: str` End time for aggregate metrics in ISO ms - `colo: Optional[str]` Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `class Traceroute: …` - `host: str` The host of the Traceroute synthetic application test - `interval: str` The interval at which the Traceroute synthetic application test is set to run. - `kind: Literal["traceroute"]` - `"traceroute"` - `name: str` The name of the Traceroute synthetic application test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` - `traceroute_stats: Optional[TracerouteStats]` - `availability_pct: TracerouteStatsAvailabilityPct` - `slots: List[TracerouteStatsAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `hops_count: TestStatOverTime` - `slots: List[Slot]` - `timestamp: str` - `value: int` - `avg: Optional[int]` average observed in the time period - `max: Optional[int]` highest observed in the time period - `min: Optional[int]` lowest observed in the time period - `packet_loss_pct: TracerouteStatsPacketLossPct` - `slots: List[TracerouteStatsPacketLossPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `round_trip_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `traceroute_stats_by_colo: Optional[List[TracerouteStatsByColo]]` - `availability_pct: TracerouteStatsByColoAvailabilityPct` - `slots: List[TracerouteStatsByColoAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `colo: str` - `hops_count: TestStatOverTime` - `packet_loss_pct: TracerouteStatsByColoPacketLossPct` - `slots: List[TracerouteStatsByColoPacketLossPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `round_trip_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) traceroute = client.zero_trust.dex.traceroute_tests.get( test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", from_="1689520412000", interval="minute", to="1689606812000", ) print(traceroute.host) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "host": "1.1.1.1", "interval": "0h5m0s", "kind": "traceroute", "name": "Atlassian Sign In Page", "target_policies": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "default": true, "name": "name" } ], "targeted": true, "tracerouteStats": { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "hopsCount": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "packetLossPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "roundTripTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 }, "tracerouteStatsByColo": [ { "availabilityPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "colo": "DFW", "hopsCount": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "packetLossPct": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "roundTripTimeMs": { "slots": [ { "timestamp": "2023-07-16 15:00:00+00", "value": 0 } ], "avg": 0, "max": 0, "min": 0 }, "uniqueDevicesTotal": 57 } ] } } ``` ## Get percentiles for a traceroute test `zero_trust.dex.traceroute_tests.percentiles(strtest_id, TracerouteTestPercentilesParams**kwargs) -> TracerouteTestPercentilesResponse` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}/percentiles` Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. ### Parameters - `account_id: str` - `test_id: str` API Resource UUID tag. - `from_: str` Start time for the query in ISO (RFC3339 - ISO 8601) format - `to: str` End time for the query in ISO (RFC3339 - ISO 8601) format - `colo: Optional[str]` Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `device_id: Optional[SequenceNotStr[str]]` Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `class TracerouteTestPercentilesResponse: …` - `hops_count: Optional[Percentiles]` - `p50: Optional[float]` p50 observed in the time period - `p90: Optional[float]` p90 observed in the time period - `p95: Optional[float]` p95 observed in the time period - `p99: Optional[float]` p99 observed in the time period - `packet_loss_pct: Optional[Percentiles]` - `round_trip_time_ms: Optional[Percentiles]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.zero_trust.dex.traceroute_tests.percentiles( test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", from_="2023-09-20T17:00:00Z", to="2023-09-20T17:00:00Z", ) print(response.hops_count) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "hopsCount": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "packetLossPct": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 }, "roundTripTimeMs": { "p50": 0, "p90": 0, "p95": 0, "p99": 0 } } } ``` ## Get network path breakdown for a traceroute test `zero_trust.dex.traceroute_tests.network_path(strtest_id, TracerouteTestNetworkPathParams**kwargs) -> NetworkPathResponse` **get** `/accounts/{account_id}/dex/traceroute-tests/{test_id}/network-path` Get a breakdown of metrics by hop for individual traceroute test runs ### Parameters - `account_id: str` - `test_id: str` API Resource UUID tag. - `device_id: str` Device to filter tracroute result runs to - `from_: str` Start time for aggregate metrics in ISO ms - `interval: Literal["minute", "hour"]` Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: str` End time for aggregate metrics in ISO ms ### Returns - `class NetworkPathResponse: …` - `id: str` API Resource UUID tag. - `device_name: Optional[str]` - `interval: Optional[str]` The interval at which the Traceroute synthetic application test is set to run. - `kind: Optional[Literal["traceroute"]]` - `"traceroute"` - `name: Optional[str]` - `network_path: Optional[NetworkPath]` - `slots: List[Slot]` - `id: str` API Resource UUID tag. - `client_to_app_rtt_ms: Optional[int]` Round trip time in ms of the client to app mile - `client_to_cf_egress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare egress mile - `client_to_cf_ingress_rtt_ms: Optional[int]` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: str` - `client_to_isp_rtt_ms: Optional[int]` Round trip time in ms of the client to ISP mile - `sampling: Optional[Sampling]` Specifies the sampling applied, if any, to the slots response. When sampled, results shown represent the first test run to the start of each sampling interval. - `unit: Literal["hours"]` - `"hours"` - `value: int` - `url: Optional[str]` The host of the Traceroute synthetic application test ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) network_path_response = client.zero_trust.dex.traceroute_tests.network_path( test_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", device_id="deviceId", from_="1689520412000", interval="minute", to="1689606812000", ) print(network_path_response.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "deviceName": "deviceName", "interval": "0h5m0s", "kind": "traceroute", "name": "name", "networkPath": { "slots": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "clientToAppRttMs": 0, "clientToCfEgressRttMs": 0, "clientToCfIngressRttMs": 0, "timestamp": "2023-07-16 15:00:00+00", "clientToIspRttMs": 0 } ], "sampling": { "unit": "hours", "value": 0 } }, "url": "1.1.1.1" } } ``` ## Domain Types ### Traceroute - `class Traceroute: …` - `host: str` The host of the Traceroute synthetic application test - `interval: str` The interval at which the Traceroute synthetic application test is set to run. - `kind: Literal["traceroute"]` - `"traceroute"` - `name: str` The name of the Traceroute synthetic application test - `target_policies: Optional[List[DigitalExperienceMonitor]]` - `id: str` API Resource UUID tag. - `default: bool` Whether the policy is the default for the account - `name: str` - `targeted: Optional[bool]` - `traceroute_stats: Optional[TracerouteStats]` - `availability_pct: TracerouteStatsAvailabilityPct` - `slots: List[TracerouteStatsAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `hops_count: TestStatOverTime` - `slots: List[Slot]` - `timestamp: str` - `value: int` - `avg: Optional[int]` average observed in the time period - `max: Optional[int]` highest observed in the time period - `min: Optional[int]` lowest observed in the time period - `packet_loss_pct: TracerouteStatsPacketLossPct` - `slots: List[TracerouteStatsPacketLossPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `round_trip_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period - `traceroute_stats_by_colo: Optional[List[TracerouteStatsByColo]]` - `availability_pct: TracerouteStatsByColoAvailabilityPct` - `slots: List[TracerouteStatsByColoAvailabilityPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `colo: str` - `hops_count: TestStatOverTime` - `packet_loss_pct: TracerouteStatsByColoPacketLossPct` - `slots: List[TracerouteStatsByColoPacketLossPctSlot]` - `timestamp: str` - `value: float` - `avg: Optional[float]` average observed in the time period - `max: Optional[float]` highest observed in the time period - `min: Optional[float]` lowest observed in the time period - `round_trip_time_ms: TestStatOverTime` - `unique_devices_total: int` Count of unique devices that have run this test in the given time period ### Traceroute Test Percentiles Response - `class TracerouteTestPercentilesResponse: …` - `hops_count: Optional[Percentiles]` - `p50: Optional[float]` p50 observed in the time period - `p90: Optional[float]` p90 observed in the time period - `p95: Optional[float]` p95 observed in the time period - `p99: Optional[float]` p99 observed in the time period - `packet_loss_pct: Optional[Percentiles]` - `round_trip_time_ms: Optional[Percentiles]` # Rules ## Get DEX Rule `zero_trust.dex.rules.get(strrule_id, RuleGetParams**kwargs) -> RuleGetResponse` **get** `/accounts/{account_id}/dex/rules/{rule_id}` Get details for a DEX Rule ### Parameters - `account_id: str` - `rule_id: str` API Resource UUID tag. ### Returns - `class RuleGetResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) rule = client.zero_trust.dex.rules.get( rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) print(rule.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## Delete a DEX Rule `zero_trust.dex.rules.delete(strrule_id, RuleDeleteParams**kwargs) -> RuleDeleteResponse` **delete** `/accounts/{account_id}/dex/rules/{rule_id}` Delete a DEX Rule ### Parameters - `account_id: str` - `rule_id: str` API Resource UUID tag. ### Returns - `Optional[bool]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) rule = client.zero_trust.dex.rules.delete( rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) print(rule) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": true } ``` ## Update a DEX Rule `zero_trust.dex.rules.update(strrule_id, RuleUpdateParams**kwargs) -> RuleUpdateResponse` **patch** `/accounts/{account_id}/dex/rules/{rule_id}` Update a DEX Rule ### Parameters - `account_id: str` - `rule_id: str` API Resource UUID tag. - `description: Optional[str]` - `match: Optional[str]` The wirefilter expression to match. - `name: Optional[str]` The name of the Rule. ### Returns - `class RuleUpdateResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) rule = client.zero_trust.dex.rules.update( rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) print(rule.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## Create a DEX Rule `zero_trust.dex.rules.create(RuleCreateParams**kwargs) -> RuleCreateResponse` **post** `/accounts/{account_id}/dex/rules` Create a DEX Rule ### Parameters - `account_id: str` - `match: str` The wirefilter expression to match. - `name: str` The name of the Rule. - `description: Optional[str]` ### Returns - `class RuleCreateResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) rule = client.zero_trust.dex.rules.create( account_id="01a7362d577a6c3019a474fd6f485823", match="match", name="name", ) print(rule.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } } ``` ## List DEX Rules `zero_trust.dex.rules.list(RuleListParams**kwargs) -> SyncV4PagePagination[Optional[RuleListResponse]]` **get** `/accounts/{account_id}/dex/rules` List DEX Rules ### Parameters - `account_id: str` - `page: float` Page number of paginated results - `per_page: float` Number of items per page - `name: Optional[str]` Filter results by rule name - `sort_by: Optional[Literal["name", "created_at", "updated_at"]]` Which property to sort results by - `"name"` - `"created_at"` - `"updated_at"` - `sort_order: Optional[Literal["ASC", "DESC"]]` Sort direction for sort_by property - `"ASC"` - `"DESC"` ### Returns - `class RuleListResponse: …` - `rules: Optional[List[Rule]]` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[RuleTargetedTest]]` - `data: RuleTargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) page = client.zero_trust.dex.rules.list( account_id="01a7362d577a6c3019a474fd6f485823", page=1, per_page=1, ) page = page.result.items[0] print(page.rules) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "rules": [ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "created_at": "2023-07-16 15:00:00+00", "match": "match", "name": "name", "description": "description", "targeted_tests": [ { "data": { "host": "https://dash.cloudflare.com", "kind": "http", "method": "GET" }, "enabled": true, "name": "name", "test_id": "test_id" } ], "updated_at": "2023-07-16 15:00:00+00" } ] }, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Rule Get Response - `class RuleGetResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Rule Delete Response - `Optional[bool]` ### Rule Update Response - `class RuleUpdateResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Rule Create Response - `class RuleCreateResponse: …` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[TargetedTest]]` - `data: TargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]` ### Rule List Response - `class RuleListResponse: …` - `rules: Optional[List[Rule]]` - `id: str` API Resource UUID tag. - `created_at: str` - `match: str` - `name: str` - `description: Optional[str]` - `targeted_tests: Optional[List[RuleTargetedTest]]` - `data: RuleTargetedTestData` The configuration object which contains the details for the WARP client to conduct the test. - `host: str` The desired endpoint to test. - `kind: Literal["http", "traceroute"]` The type of test. - `"http"` - `"traceroute"` - `method: Optional[Literal["GET"]]` The HTTP request method type. - `"GET"` - `enabled: bool` - `name: str` - `test_id: str` - `updated_at: Optional[str]`