# DEX ## Domain Types ### Digital Experience Monitor - `DigitalExperienceMonitor` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` ### Network Path - `NetworkPath` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` 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: "hours"` - `"hours"` - `value: number` ### Network Path Response - `NetworkPathResponse` - `id: string` API Resource UUID tag. - `deviceName?: string` - `interval?: string` The interval at which the Traceroute synthetic application test is set to run. - `kind?: "traceroute"` - `"traceroute"` - `name?: string` - `networkPath?: NetworkPath | null` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` 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: "hours"` - `"hours"` - `value: number` - `url?: string` The host of the Traceroute synthetic application test ### Percentiles - `Percentiles` - `p50?: number | null` p50 observed in the time period - `p90?: number | null` p90 observed in the time period - `p95?: number | null` p95 observed in the time period - `p99?: number | null` p99 observed in the time period # WARP Change Events ## List WARP change events. `client.zeroTrust.dex.warpChangeEvents.get(WARPChangeEventGetParamsparams, RequestOptionsoptions?): WARPChangeEventGetResponse` **get** `/accounts/{account_id}/dex/warp-change-events` List WARP configuration and enablement toggle change events by device. ### Parameters - `params: WARPChangeEventGetParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `page: number` Query param: Page number of paginated results - `per_page: number` Query param: Number of items per page - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `account_name?: string` Query param: Filter events by account name. - `config_name?: string` Query param: Filter events by WARP configuration name changed from or to. Applicable to type='config' events only. - `sort_order?: "ASC" | "DESC"` Query param: Sort response by event timestamp. - `"ASC"` - `"DESC"` - `toggle?: "on" | "off"` Query param: Filter events by type toggle value. Applicable to type='toggle' events only. - `"on"` - `"off"` - `type?: "config" | "toggle"` Query param: Filter events by type 'config' or 'toggle' - `"config"` - `"toggle"` ### Returns - `WARPChangeEventGetResponse = Array` - `DigitalExperienceMonitoringWARPToggleChangeEvent` - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `device_id?: string` API Resource UUID tag. - `device_registration?: string` API Resource UUID tag. - `hostname?: string` The hostname of the machine the event is from - `registration_id?: string` API Resource UUID tag. - `serial_number?: string` The serial number of the machine the event is from - `timestamp?: string` Timestamp in ISO format - `toggle?: "on" | "off"` The state of the WARP toggle. - `"on"` - `"off"` - `user_email?: string` Email tied to the device - `DigitalExperienceMonitoringWARPConfigChangeEvent` - `device_id?: string` API Resource UUID tag. - `device_registration?: string` API Resource UUID tag. - `from?: From` - `account_name?: string` The account name. - `account_tag?: string` API Resource UUID tag. - `config_name?: string` The name of the WARP configuration. - `hostname?: string` The hostname of the machine the event is from - `registration_id?: string` API Resource UUID tag. - `serial_number?: string` The serial number of the machine the event is from - `timestamp?: string` Timestamp in ISO format - `to?: To` - `account_name?: string` The account name. - `account_tag?: string` API Resource UUID tag. - `config_name?: string` The name of the WARP configuration. - `user_email?: string` Email tied to the device ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const warpChangeEvents = await client.zeroTrust.dex.warpChangeEvents.get({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', page: 1, per_page: 1, to: '2023-09-20T17:00:00Z', }); console.log(warpChangeEvents); ``` #### 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", "registration_id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "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 - `WARPChangeEventGetResponse = Array` - `DigitalExperienceMonitoringWARPToggleChangeEvent` - `account_name?: string` The account name. - `account_tag?: string` The public account identifier. - `device_id?: string` API Resource UUID tag. - `device_registration?: string` API Resource UUID tag. - `hostname?: string` The hostname of the machine the event is from - `registration_id?: string` API Resource UUID tag. - `serial_number?: string` The serial number of the machine the event is from - `timestamp?: string` Timestamp in ISO format - `toggle?: "on" | "off"` The state of the WARP toggle. - `"on"` - `"off"` - `user_email?: string` Email tied to the device - `DigitalExperienceMonitoringWARPConfigChangeEvent` - `device_id?: string` API Resource UUID tag. - `device_registration?: string` API Resource UUID tag. - `from?: From` - `account_name?: string` The account name. - `account_tag?: string` API Resource UUID tag. - `config_name?: string` The name of the WARP configuration. - `hostname?: string` The hostname of the machine the event is from - `registration_id?: string` API Resource UUID tag. - `serial_number?: string` The serial number of the machine the event is from - `timestamp?: string` Timestamp in ISO format - `to?: To` - `account_name?: string` The account name. - `account_tag?: string` API Resource UUID tag. - `config_name?: string` The name of the WARP configuration. - `user_email?: string` Email tied to the device # Commands ## List account commands `client.zeroTrust.dex.commands.list(CommandListParamsparams, RequestOptionsoptions?): V4PagePagination` **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 - `params: CommandListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `page: number` Query param: Page number for pagination - `per_page: number` Query param: Number of results per page - `command_type?: string` Query param: Optionally filter executed commands by command type - `device_id?: string` Query param: Unique identifier for a device - `from?: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Query param: Optionally filter executed commands by status - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `to?: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `user_email?: string` Query param: Email tied to the device ### Returns - `CommandListResponse` - `commands?: Array` - `id?: string` - `completed_date?: string | null` - `created_date?: string` - `device_id?: string` - `filename?: string | null` - `registration_id?: string` Unique identifier for the device registration - `status?: string` - `type?: string` - `user_email?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const commandListResponse of client.zeroTrust.dex.commands.list({ account_id: '01a7362d577a6c3019a474fd6f485823', page: 1, per_page: 50, })) { console.log(commandListResponse.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 `client.zeroTrust.dex.commands.create(CommandCreateParamsparams, RequestOptionsoptions?): CommandCreateResponse` **post** `/accounts/{account_id}/dex/commands` Initiate commands for up to 10 devices per account ### Parameters - `params: CommandCreateParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `commands: Array` Body param: List of device-level commands to execute - `command_type: "pcap" | "warp-diag"` Type of command to execute on the device - `"pcap"` - `"warp-diag"` - `device_id: string` Unique identifier for the physical device - `user_email: string` Email tied to the device - `command_args?: CommandArgs` - `interfaces?: Array<"default" | "tunnel">` List of interfaces to capture packets on - `"default"` - `"tunnel"` - `"max-file-size-mb"?: number` 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"?: number` Maximum number of bytes to save for each packet - `"test-all-routes"?: boolean` 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"?: number` Limit on capture duration (in minutes) - `registration_id?: string` Unique identifier for the device registration. Required for multi-user devices to target the correct user session. ### Returns - `CommandCreateResponse` - `commands?: Array` List of created commands - `id?: string` Unique identifier for the command - `args?: Record` Command arguments - `device_id?: string` Identifier for the device associated with the command - `registration_id?: string` Unique identifier for the device registration - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type?: string` Type of the command (e.g., "pcap" or "warp-diag") ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const command = await client.zeroTrust.dex.commands.create({ account_id: '01a7362d577a6c3019a474fd6f485823', commands: [ { command_type: 'pcap', device_id: 'device_id', user_email: 'user_email', }, ], }); console.log(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 - `CommandListResponse` - `commands?: Array` - `id?: string` - `completed_date?: string | null` - `created_date?: string` - `device_id?: string` - `filename?: string | null` - `registration_id?: string` Unique identifier for the device registration - `status?: string` - `type?: string` - `user_email?: string` ### Command Create Response - `CommandCreateResponse` - `commands?: Array` List of created commands - `id?: string` Unique identifier for the command - `args?: Record` Command arguments - `device_id?: string` Identifier for the device associated with the command - `registration_id?: string` Unique identifier for the device registration - `status?: "PENDING_EXEC" | "PENDING_UPLOAD" | "SUCCESS" | "FAILED"` Current status of the command - `"PENDING_EXEC"` - `"PENDING_UPLOAD"` - `"SUCCESS"` - `"FAILED"` - `type?: string` Type of the command (e.g., "pcap" or "warp-diag") # Devices ## List devices eligible for remote captures `client.zeroTrust.dex.commands.devices.list(DeviceListParamsparams, RequestOptionsoptions?): V4PagePagination` **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 - `params: DeviceListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `page: number` Query param: Page number of paginated results - `per_page: number` Query param: Number of items per page - `search?: string` Query param: Filter devices by name or email ### Returns - `DeviceListResponse` - `devices?: Array` List of eligible devices - `deviceId?: string` Device identifier (UUID v4) - `deviceName?: string` Device identifier (human readable) - `eligible?: boolean` Whether the device is eligible for remote captures - `ineligibleReason?: string` If the device is not eligible, the reason why. - `personEmail?: string` User contact email address - `platform?: string` Operating system - `registrationId?: string` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status?: string` Network status - `timestamp?: string` Timestamp in ISO format - `version?: string` WARP client version ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const deviceListResponse of client.zeroTrust.dex.commands.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', page: 1, per_page: 1, })) { console.log(deviceListResponse.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 - `DeviceListResponse` - `devices?: Array` List of eligible devices - `deviceId?: string` Device identifier (UUID v4) - `deviceName?: string` Device identifier (human readable) - `eligible?: boolean` Whether the device is eligible for remote captures - `ineligibleReason?: string` If the device is not eligible, the reason why. - `personEmail?: string` User contact email address - `platform?: string` Operating system - `registrationId?: string` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `status?: string` Network status - `timestamp?: string` Timestamp in ISO format - `version?: string` WARP client version # Downloads ## Download command output file `client.zeroTrust.dex.commands.downloads.get(stringcommandId, stringfilename, DownloadGetParamsparams, RequestOptionsoptions?): Response` **get** `/accounts/{account_id}/dex/commands/{command_id}/downloads/{filename}` Downloads artifacts for an executed command. Bulk downloads are not supported ### Parameters - `commandId: string` Unique identifier for a command - `filename: string` - `params: DownloadGetParams` - `account_id: string` unique identifier linked to an account in the API request path ### Returns - `unnamed_schema_8 = Response` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const download = await client.zeroTrust.dex.commands.downloads.get( '5758fefe-ae7e-4538-a39b-1fef6abcb909', 'filename', { account_id: '01a7362d577a6c3019a474fd6f485823' }, ); console.log(download); const content = await download.blob(); console.log(content); ``` # Quota ## Returns account commands usage, quota, and reset time `client.zeroTrust.dex.commands.quota.get(QuotaGetParamsparams, RequestOptionsoptions?): 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 - `params: QuotaGetParams` - `account_id: string` unique identifier linked to an account in the API request path ### Returns - `QuotaGetResponse` - `quota: number` The remaining number of commands that can be initiated for an account - `quota_usage: number` The number of commands that have been initiated for an account - `reset_time: string` The time when the quota resets ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const quota = await client.zeroTrust.dex.commands.quota.get({ account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(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 - `QuotaGetResponse` - `quota: number` The remaining number of commands that can be initiated for an account - `quota_usage: number` The number of commands that have been initiated for an account - `reset_time: string` The time when the quota resets # Colos ## List Cloudflare colos `client.zeroTrust.dex.colos.list(ColoListParamsparams, RequestOptionsoptions?): SinglePage` **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 - `params: ColoListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `from: string` Query param: Start time for connection period in ISO (RFC3339 - ISO 8601) format - `to: string` Query param: End time for connection period in ISO (RFC3339 - ISO 8601) format - `sortBy?: "fleet-status-usage" | "application-tests-usage"` Query param: Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically. - `"fleet-status-usage"` - `"application-tests-usage"` ### Returns - `ColoListResponse` - `airportCode: string` Airport code - `city: string` City - `countryCode: string` Country code ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const coloListResponse of client.zeroTrust.dex.colos.list({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-08-20T20:45:00Z', to: '2023-08-24T20:45:00Z', })) { console.log(coloListResponse.airportCode); } ``` #### 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 - `ColoListResponse` - `airportCode: string` Airport code - `city: string` City - `countryCode: string` Country code # Fleet Status ## List fleet status details by dimension `client.zeroTrust.dex.fleetStatus.live(FleetStatusLiveParamsparams, RequestOptionsoptions?): FleetStatusLiveResponse` **get** `/accounts/{account_id}/dex/fleet-status/live` List details for live (up to 60 minutes) devices using WARP ### Parameters - `params: FleetStatusLiveParams` - `account_id: string` Path param: Unique identifier for account - `since_minutes: number` Query param: Number of minutes before current time ### Returns - `FleetStatusLiveResponse` - `deviceStats?: DeviceStats` - `byColo?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byMode?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byPlatform?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byVersion?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.fleetStatus.live({ account_id: '01a7362d577a6c3019a474fd6f485823', since_minutes: 10, }); console.log(response.deviceStats); ``` #### 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 `client.zeroTrust.dex.fleetStatus.overTime(FleetStatusOverTimeParamsparams, RequestOptionsoptions?): FleetStatusOverTimeResponse` **get** `/accounts/{account_id}/dex/fleet-status/over-time` List details for devices using WARP, up to 7 days ### Parameters - `params: FleetStatusOverTimeParams` - `account_id: string` Path param: Unique identifier for account - `from: string` Query param: Time range beginning in ISO format - `to: string` Query param: Time range end in ISO format - `colo?: string` Query param: Cloudflare colo - `device_id?: string` Query param: Device-specific ID, given as UUID v4 ### Returns - `FleetStatusOverTimeResponse` - `deviceStats?: DeviceStats` - `byMode?: Array` - `timestamp?: string` Timestamp in ISO format - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array` - `timestamp?: string` Timestamp in ISO format - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.fleetStatus.overTime({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-10-11T00:00:00Z', to: '2023-10-11T00:00:00Z', }); console.log(response.deviceStats); ``` #### 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 - `LiveStat` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` ### Fleet Status Live Response - `FleetStatusLiveResponse` - `deviceStats?: DeviceStats` - `byColo?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byMode?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byPlatform?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byVersion?: Array | null` - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices ### Fleet Status Over Time Response - `FleetStatusOverTimeResponse` - `deviceStats?: DeviceStats` - `byMode?: Array` - `timestamp?: string` Timestamp in ISO format - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `byStatus?: Array` - `timestamp?: string` Timestamp in ISO format - `uniqueDevicesTotal?: number` Number of unique devices - `value?: string` - `uniqueDevicesTotal?: number` Number of unique devices # Devices ## List fleet status devices `client.zeroTrust.dex.fleetStatus.devices.list(DeviceListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/dex/fleet-status/devices` List details for devices using WARP ### Parameters - `params: DeviceListParams` - `account_id: string` Path param: Unique identifier for account - `from: string` Query param: Time range beginning in ISO format - `page: number` Query param: Page number - `per_page: number` Query param: Number of results per page - `to: string` Query param: Time range end in ISO format - `colo?: string` Query param: Cloudflare colo - `device_id?: string` Query param: Device-specific ID, given as UUID v4 - `mode?: string` Query param: The mode under which the WARP client is run - `platform?: string` Query param: Operating system - `sort_by?: "colo" | "device_id" | "mode" | 4 more` Query param: Dimension to sort results by - `"colo"` - `"device_id"` - `"mode"` - `"platform"` - `"status"` - `"timestamp"` - `"version"` - `source?: "last_seen" | "hourly" | "raw"` Query param: Source: * `hourly` - device details aggregated hourly, up to 7 days prior * `last_seen` - device details, up to 60 minutes prior. Time windows exceeding 60 minutes will be rejected from June 1st, 2026. Please use 'hourly' or 'raw' instead for longer time ranges. * `raw` - device details, up to 7 days prior - `"last_seen"` - `"hourly"` - `"raw"` - `status?: string` Query param: Network status - `version?: string` Query param: WARP client version ### Returns - `DeviceListResponse` - `colo: string` Cloudflare colo - `deviceId: string` Device identifier (UUID v4) - `mode: string` The mode under which the WARP client is run - `platform: string` Operating system - `status: string` Network status - `timestamp: string` Timestamp in ISO format - `version: string` WARP client version - `alwaysOn?: boolean | null` - `batteryCharging?: boolean | null` - `batteryCycles?: number | null` - `batteryPct?: number | null` - `connectionType?: string | null` - `cpuPct?: number | null` - `cpuPctByApp?: Array> | null` - `cpu_pct?: number` - `name?: string` - `deviceIpv4?: DeviceIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `deviceIpv6?: DeviceIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `deviceName?: string` Device identifier (human readable) - `diskReadBps?: number | null` - `diskUsagePct?: number | null` - `diskWriteBps?: number | null` - `dohSubdomain?: string | null` - `estimatedLossPct?: number | null` - `firewallEnabled?: boolean | null` - `gatewayIpv4?: GatewayIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `gatewayIpv6?: GatewayIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `handshakeLatencyMs?: number | null` - `ispIpv4?: ISPIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `ispIpv6?: ISPIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `metal?: string | null` - `networkRcvdBps?: number | null` - `networkSentBps?: number | null` - `networkSsid?: string | null` - `personEmail?: string` User contact email address - `ramAvailableKb?: number | null` - `ramUsedPct?: number | null` - `ramUsedPctByApp?: Array> | null` - `name?: string` - `ram_used_pct?: number` - `registrationId?: string | null` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `switchLocked?: boolean | null` - `wifiStrengthDbm?: number | null` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const deviceListResponse of client.zeroTrust.dex.fleetStatus.devices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-10-11T00:00:00Z', page: 1, per_page: 10, to: '2023-10-11T00:00:00Z', })) { console.log(deviceListResponse.networkSsid); } ``` #### 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 } ] ], "registrationId": "registrationId", "switchLocked": true, "wifiStrengthDbm": 0 } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Domain Types ### Device List Response - `DeviceListResponse` - `colo: string` Cloudflare colo - `deviceId: string` Device identifier (UUID v4) - `mode: string` The mode under which the WARP client is run - `platform: string` Operating system - `status: string` Network status - `timestamp: string` Timestamp in ISO format - `version: string` WARP client version - `alwaysOn?: boolean | null` - `batteryCharging?: boolean | null` - `batteryCycles?: number | null` - `batteryPct?: number | null` - `connectionType?: string | null` - `cpuPct?: number | null` - `cpuPctByApp?: Array> | null` - `cpu_pct?: number` - `name?: string` - `deviceIpv4?: DeviceIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `deviceIpv6?: DeviceIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `deviceName?: string` Device identifier (human readable) - `diskReadBps?: number | null` - `diskUsagePct?: number | null` - `diskWriteBps?: number | null` - `dohSubdomain?: string | null` - `estimatedLossPct?: number | null` - `firewallEnabled?: boolean | null` - `gatewayIpv4?: GatewayIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `gatewayIpv6?: GatewayIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `handshakeLatencyMs?: number | null` - `ispIpv4?: ISPIPV4` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `ispIpv6?: ISPIPV6` - `address?: string | null` - `asn?: number | null` - `aso?: string | null` - `location?: Location` - `city?: string | null` - `country_iso?: string | null` - `state_iso?: string | null` - `zip?: string | null` - `netmask?: string | null` - `version?: string | null` - `metal?: string | null` - `networkRcvdBps?: number | null` - `networkSentBps?: number | null` - `networkSsid?: string | null` - `personEmail?: string` User contact email address - `ramAvailableKb?: number | null` - `ramUsedPct?: number | null` - `ramUsedPctByApp?: Array> | null` - `name?: string` - `ram_used_pct?: number` - `registrationId?: string | null` Device registration identifier (UUID v4). On multi-user devices, this uniquely identifies a user's registration on the device. - `switchLocked?: boolean | null` - `wifiStrengthDbm?: number | null` # HTTP Tests ## Get details and aggregate metrics for an http test `client.zeroTrust.dex.httpTests.get(stringtestId, HTTPTestGetParamsparams, RequestOptionsoptions?): 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 - `testId: string` API Resource UUID tag. - `params: HTTPTestGetParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `from: string` Query param: Start time for aggregate metrics in ISO ms - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `HTTPDetails` - `host?: string` The url of the HTTP synthetic application test - `httpStats?: HTTPStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `dnsResponseTimeMs: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `httpStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `colo: string` - `dnsResponseTimeMs: TestStatOverTime` - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `interval?: string` The interval at which the HTTP synthetic application test is set to run. - `kind?: "http"` - `"http"` - `method?: string` The HTTP method to use when running the test - `name?: string` The name of the HTTP synthetic application test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const httpDetails = await client.zeroTrust.dex.httpTests.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(httpDetails.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 - `HTTPDetails` - `host?: string` The url of the HTTP synthetic application test - `httpStats?: HTTPStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `dnsResponseTimeMs: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `httpStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `colo: string` - `dnsResponseTimeMs: TestStatOverTime` - `httpStatusCode: Array` - `status200: number` - `status300: number` - `status400: number` - `status500: number` - `timestamp: string` - `resourceFetchTimeMs: TestStatOverTime` - `serverResponseTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `interval?: string` The interval at which the HTTP synthetic application test is set to run. - `kind?: "http"` - `"http"` - `method?: string` The HTTP method to use when running the test - `name?: string` The name of the HTTP synthetic application test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` # Percentiles ## Get percentiles for an http test `client.zeroTrust.dex.httpTests.percentiles.get(stringtestId, PercentileGetParamsparams, RequestOptionsoptions?): 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 - `testId: string` API Resource UUID tag. - `params: PercentileGetParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `HTTPDetailsPercentiles` - `dnsResponseTimeMs?: Percentiles` - `p50?: number | null` p50 observed in the time period - `p90?: number | null` p90 observed in the time period - `p95?: number | null` p95 observed in the time period - `p99?: number | null` p99 observed in the time period - `resourceFetchTimeMs?: Percentiles` - `serverResponseTimeMs?: Percentiles` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const httpDetailsPercentiles = await client.zeroTrust.dex.httpTests.percentiles.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', to: '2023-09-20T17:00:00Z', }, ); console.log(httpDetailsPercentiles.dnsResponseTimeMs); ``` #### 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 - `HTTPDetailsPercentiles` - `dnsResponseTimeMs?: Percentiles` - `p50?: number | null` p50 observed in the time period - `p90?: number | null` p90 observed in the time period - `p95?: number | null` p95 observed in the time period - `p99?: number | null` p99 observed in the time period - `resourceFetchTimeMs?: Percentiles` - `serverResponseTimeMs?: Percentiles` ### Test Stat Over Time - `TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period # Tests ## List DEX test analytics `client.zeroTrust.dex.tests.list(TestListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/tests/overview` List DEX tests with overview metrics ### Parameters - `params: TestListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `kind?: "http" | "traceroute"` Query param: Filter by test type - `"http"` - `"traceroute"` - `page?: number` Query param: Page number of paginated results - `per_page?: number` Query param: Number of items per page - `registration_id?: string` Query param: Optionally filter results to a specific device registration. Must be used in combination with a single deviceId. - `testName?: string` Query param: Optionally filter results by test name ### Returns - `Tests` - `overviewMetrics: OverviewMetrics` - `testsTotal: number` number of tests. - `avgHttpAvailabilityPct?: number | null` percentage availability for all HTTP test results in response - `avgTracerouteAvailabilityPct?: number | null` percentage availability for all traceroutes results in response - `tests: Array` array of test results objects. - `id: string` API Resource UUID tag. - `created: string` date the test was created. - `description: string` the test description defined during configuration - `enabled: boolean` if true, then the test will run on targeted devices. Else, the test will not run. - `host: string` - `interval: string` The interval at which the synthetic application test is set to run. - `kind: "http" | "traceroute"` test type, http or traceroute - `"http"` - `"traceroute"` - `name: string` name given to this test - `updated: string` - `httpResults?: HTTPResults | null` - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `httpResultsByColo?: Array` - `colo: string` Cloudflare colo - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `method?: string` for HTTP, the method to use when running the test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` - `tracerouteResults?: TracerouteResults | null` - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `tracerouteResultsByColo?: Array` - `colo: string` Cloudflare colo - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const tests of client.zeroTrust.dex.tests.list({ account_id: '01a7362d577a6c3019a474fd6f485823', })) { console.log(tests.overviewMetrics); } ``` #### 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 - `AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` ### Tests - `Tests` - `overviewMetrics: OverviewMetrics` - `testsTotal: number` number of tests. - `avgHttpAvailabilityPct?: number | null` percentage availability for all HTTP test results in response - `avgTracerouteAvailabilityPct?: number | null` percentage availability for all traceroutes results in response - `tests: Array` array of test results objects. - `id: string` API Resource UUID tag. - `created: string` date the test was created. - `description: string` the test description defined during configuration - `enabled: boolean` if true, then the test will run on targeted devices. Else, the test will not run. - `host: string` - `interval: string` The interval at which the synthetic application test is set to run. - `kind: "http" | "traceroute"` test type, http or traceroute - `"http"` - `"traceroute"` - `name: string` name given to this test - `updated: string` - `httpResults?: HTTPResults | null` - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `units: "hours" | "days" | "testRuns"` - `"hours"` - `"days"` - `"testRuns"` - `value: number` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `httpResultsByColo?: Array` - `colo: string` Cloudflare colo - `resourceFetchTime: ResourceFetchTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `method?: string` for HTTP, the method to use when running the test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` - `tracerouteResults?: TracerouteResults | null` - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` - `tracerouteResultsByColo?: Array` - `colo: string` Cloudflare colo - `roundTripTime: RoundTripTime` - `history: Array` - `timePeriod: AggregateTimePeriod` - `avgMs?: number | null` - `deltaPct?: number | null` - `avgMs?: number | null` - `overTime?: OverTime | null` - `timePeriod: AggregateTimePeriod` - `values: Array` - `avgMs: number` - `timestamp: string` # Unique Devices ## Get count of devices targeted `client.zeroTrust.dex.tests.uniqueDevices.list(UniqueDeviceListParamsparams, RequestOptionsoptions?): 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 - `params: UniqueDeviceListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `testName?: string` Query param: Optionally filter results by test name ### Returns - `UniqueDevices` - `uniqueDevicesTotal: number` total number of unique devices ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const uniqueDevices = await client.zeroTrust.dex.tests.uniqueDevices.list({ account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(uniqueDevices.uniqueDevicesTotal); ``` #### 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 - `UniqueDevices` - `uniqueDevicesTotal: number` total number of unique devices # Traceroute Test Results # Network Path ## Get details for a specific traceroute test run `client.zeroTrust.dex.tracerouteTestResults.networkPath.get(stringtestResultId, NetworkPathGetParamsparams, RequestOptionsoptions?): 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 - `testResultId: string` API Resource UUID tag. - `params: NetworkPathGetParams` - `account_id: string` unique identifier linked to an account ### Returns - `NetworkPathGetResponse` - `hops: Array` an array of the hops taken by the device to reach the end destination - `ttl: number` - `asn?: number | null` - `aso?: string | null` - `ipAddress?: string | null` - `location?: Location | null` - `city?: string | null` - `state?: string | null` - `zip?: string | null` - `mile?: "client-to-app" | "client-to-cf-egress" | "client-to-cf-ingress" | "client-to-isp" | null` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name?: string | null` - `packetLossPct?: number | null` - `rttMs?: number | null` - `resultId: string` API Resource UUID tag. - `deviceName?: string` name of the device associated with this network path response - `testId?: string` API Resource UUID tag. - `testName?: string` name of the tracroute test ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const networkPath = await client.zeroTrust.dex.tracerouteTestResults.networkPath.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823' }, ); console.log(networkPath.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 - `NetworkPathGetResponse` - `hops: Array` an array of the hops taken by the device to reach the end destination - `ttl: number` - `asn?: number | null` - `aso?: string | null` - `ipAddress?: string | null` - `location?: Location | null` - `city?: string | null` - `state?: string | null` - `zip?: string | null` - `mile?: "client-to-app" | "client-to-cf-egress" | "client-to-cf-ingress" | "client-to-isp" | null` - `"client-to-app"` - `"client-to-cf-egress"` - `"client-to-cf-ingress"` - `"client-to-isp"` - `name?: string | null` - `packetLossPct?: number | null` - `rttMs?: number | null` - `resultId: string` API Resource UUID tag. - `deviceName?: string` name of the device associated with this network path response - `testId?: string` API Resource UUID tag. - `testName?: string` name of the tracroute test # Traceroute Tests ## Get details and aggregate metrics for a traceroute test `client.zeroTrust.dex.tracerouteTests.get(stringtestId, TracerouteTestGetParamsparams, RequestOptionsoptions?): 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 - `testId: string` API Resource UUID tag. - `params: TracerouteTestGetParams` - `account_id: string` Path param: Unique identifier linked to an account - `from: string` Query param: Start time for aggregate metrics in ISO ms - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `Traceroute` - `host: string` The host of the Traceroute synthetic application test - `interval: string` The interval at which the Traceroute synthetic application test is set to run. - `kind: "traceroute"` - `"traceroute"` - `name: string` The name of the Traceroute synthetic application test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` - `tracerouteStats?: TracerouteStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `hopsCount: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `tracerouteStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `colo: string` - `hopsCount: TestStatOverTime` - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const traceroute = await client.zeroTrust.dex.tracerouteTests.get( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(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 `client.zeroTrust.dex.tracerouteTests.percentiles(stringtestId, TracerouteTestPercentilesParamsparams, RequestOptionsoptions?): 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 - `testId: string` API Resource UUID tag. - `params: TracerouteTestPercentilesParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path. - `from: string` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `to: string` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `colo?: string` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `deviceId?: Array` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `TracerouteTestPercentilesResponse` - `hopsCount?: Percentiles` - `p50?: number | null` p50 observed in the time period - `p90?: number | null` p90 observed in the time period - `p95?: number | null` p95 observed in the time period - `p99?: number | null` p99 observed in the time period - `packetLossPct?: Percentiles` - `roundTripTimeMs?: Percentiles` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.zeroTrust.dex.tracerouteTests.percentiles( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', from: '2023-09-20T17:00:00Z', to: '2023-09-20T17:00:00Z', }, ); console.log(response.hopsCount); ``` #### 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 `client.zeroTrust.dex.tracerouteTests.networkPath(stringtestId, TracerouteTestNetworkPathParamsparams, RequestOptionsoptions?): 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 - `testId: string` API Resource UUID tag. - `params: TracerouteTestNetworkPathParams` - `account_id: string` Path param: unique identifier linked to an account - `deviceId: string` Query param: Device to filter tracroute result runs to - `from: string` Query param: Start time for aggregate metrics in ISO ms - `interval: "minute" | "hour"` Query param: Time interval for aggregate time slots. - `"minute"` - `"hour"` - `to: string` Query param: End time for aggregate metrics in ISO ms ### Returns - `NetworkPathResponse` - `id: string` API Resource UUID tag. - `deviceName?: string` - `interval?: string` The interval at which the Traceroute synthetic application test is set to run. - `kind?: "traceroute"` - `"traceroute"` - `name?: string` - `networkPath?: NetworkPath | null` - `slots: Array` - `id: string` API Resource UUID tag. - `clientToAppRttMs: number | null` Round trip time in ms of the client to app mile - `clientToCfEgressRttMs: number | null` Round trip time in ms of the client to Cloudflare egress mile - `clientToCfIngressRttMs: number | null` Round trip time in ms of the client to Cloudflare ingress mile - `timestamp: string` - `clientToIspRttMs?: number | null` Round trip time in ms of the client to ISP mile - `sampling?: Sampling | null` 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: "hours"` - `"hours"` - `value: number` - `url?: string` The host of the Traceroute synthetic application test ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const networkPathResponse = await client.zeroTrust.dex.tracerouteTests.networkPath( 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', deviceId: 'deviceId', from: '1689520412000', interval: 'minute', to: '1689606812000', }, ); console.log(networkPathResponse.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 - `Traceroute` - `host: string` The host of the Traceroute synthetic application test - `interval: string` The interval at which the Traceroute synthetic application test is set to run. - `kind: "traceroute"` - `"traceroute"` - `name: string` The name of the Traceroute synthetic application test - `target_policies?: Array | null` - `id: string` API Resource UUID tag. - `default: boolean` Whether the policy is the default for the account - `name: string` - `targeted?: boolean` - `tracerouteStats?: TracerouteStats | null` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `hopsCount: TestStatOverTime` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period - `tracerouteStatsByColo?: Array` - `availabilityPct: AvailabilityPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `colo: string` - `hopsCount: TestStatOverTime` - `packetLossPct: PacketLossPct` - `slots: Array` - `timestamp: string` - `value: number` - `avg?: number | null` average observed in the time period - `max?: number | null` highest observed in the time period - `min?: number | null` lowest observed in the time period - `roundTripTimeMs: TestStatOverTime` - `uniqueDevicesTotal: number` Count of unique devices that have run this test in the given time period ### Traceroute Test Percentiles Response - `TracerouteTestPercentilesResponse` - `hopsCount?: Percentiles` - `p50?: number | null` p50 observed in the time period - `p90?: number | null` p90 observed in the time period - `p95?: number | null` p95 observed in the time period - `p99?: number | null` p99 observed in the time period - `packetLossPct?: Percentiles` - `roundTripTimeMs?: Percentiles` # Rules ## Get DEX Rule `client.zeroTrust.dex.rules.get(stringruleId, RuleGetParamsparams, RequestOptionsoptions?): RuleGetResponse` **get** `/accounts/{account_id}/dex/rules/{rule_id}` Get details for a DEX Rule ### Parameters - `ruleId: string` API Resource UUID tag. - `params: RuleGetParams` - `account_id: string` unique identifier linked to an account in the API request path ### Returns - `RuleGetResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.get('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(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 `client.zeroTrust.dex.rules.delete(stringruleId, RuleDeleteParamsparams, RequestOptionsoptions?): RuleDeleteResponse | null` **delete** `/accounts/{account_id}/dex/rules/{rule_id}` Delete a DEX Rule ### Parameters - `ruleId: string` API Resource UUID tag. - `params: RuleDeleteParams` - `account_id: string` unique identifier linked to an account in the API request path ### Returns - `RuleDeleteResponse = boolean | null` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.delete('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(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 `client.zeroTrust.dex.rules.update(stringruleId, RuleUpdateParamsparams, RequestOptionsoptions?): RuleUpdateResponse` **patch** `/accounts/{account_id}/dex/rules/{rule_id}` Update a DEX Rule ### Parameters - `ruleId: string` API Resource UUID tag. - `params: RuleUpdateParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `description?: string` Body param - `match?: string` Body param: The wirefilter expression to match. - `name?: string` Body param: The name of the Rule. ### Returns - `RuleUpdateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.update('f174e90a-fafe-4643-bbbc-4a0ed4fc8415', { account_id: '01a7362d577a6c3019a474fd6f485823', }); console.log(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 `client.zeroTrust.dex.rules.create(RuleCreateParamsparams, RequestOptionsoptions?): RuleCreateResponse` **post** `/accounts/{account_id}/dex/rules` Create a DEX Rule ### Parameters - `params: RuleCreateParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `match: string` Body param: The wirefilter expression to match. - `name: string` Body param: The name of the Rule. - `description?: string` Body param ### Returns - `RuleCreateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const rule = await client.zeroTrust.dex.rules.create({ account_id: '01a7362d577a6c3019a474fd6f485823', match: 'match', name: 'name', }); console.log(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 `client.zeroTrust.dex.rules.list(RuleListParamsparams, RequestOptionsoptions?): V4PagePagination` **get** `/accounts/{account_id}/dex/rules` List DEX Rules ### Parameters - `params: RuleListParams` - `account_id: string` Path param: unique identifier linked to an account in the API request path - `page: number` Query param: Page number of paginated results - `per_page: number` Query param: Number of items per page - `name?: string` Query param: Filter results by rule name - `sort_by?: "name" | "created_at" | "updated_at"` Query param: Which property to sort results by - `"name"` - `"created_at"` - `"updated_at"` - `sort_order?: "ASC" | "DESC"` Query param: Sort direction for sort_by property - `"ASC"` - `"DESC"` ### Returns - `RuleListResponse` - `rules?: Array` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const ruleListResponse of client.zeroTrust.dex.rules.list({ account_id: '01a7362d577a6c3019a474fd6f485823', page: 1, per_page: 1, })) { console.log(ruleListResponse.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 - `RuleGetResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule Delete Response - `RuleDeleteResponse = boolean | null` ### Rule Update Response - `RuleUpdateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule Create Response - `RuleCreateResponse` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string` ### Rule List Response - `RuleListResponse` - `rules?: Array` - `id: string` API Resource UUID tag. - `created_at: string` - `match: string` - `name: string` - `description?: string` - `targeted_tests?: Array` - `data: Data` The configuration object which contains the details for the WARP client to conduct the test. - `host: string` The desired endpoint to test. - `kind: "http" | "traceroute"` The type of test. - `"http"` - `"traceroute"` - `method?: "GET"` The HTTP request method type. - `"GET"` - `enabled: boolean` - `name: string` - `test_id: string` - `updated_at?: string`