# DEX ## Domain Types ### Digital Experience Monitor - `type DigitalExperienceMonitor struct{…}` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` ### Network Path - `type NetworkPath struct{…}` - `Slots []NetworkPathSlot` - `ID string` API Resource UUID tag. - `ClientToAppRTTMs int64` Round trip time in ms of the client to app mile - `ClientToCfEgressRTTMs int64` Round trip time in ms of the client to Cloudflare egress mile - `ClientToCfIngressRTTMs int64` Round trip time in ms of the client to Cloudflare ingress mile - `Timestamp string` - `ClientToISPRTTMs int64` Round trip time in ms of the client to ISP mile - `Sampling NetworkPathSampling` 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 NetworkPathSamplingUnit` - `const NetworkPathSamplingUnitHours NetworkPathSamplingUnit = "hours"` - `Value int64` ### Network Path Response - `type NetworkPathResponse struct{…}` - `ID string` API Resource UUID tag. - `DeviceName string` - `Interval string` The interval at which the Traceroute synthetic application test is set to run. - `Kind NetworkPathResponseKind` - `const NetworkPathResponseKindTraceroute NetworkPathResponseKind = "traceroute"` - `Name string` - `NetworkPath NetworkPath` - `Slots []NetworkPathSlot` - `ID string` API Resource UUID tag. - `ClientToAppRTTMs int64` Round trip time in ms of the client to app mile - `ClientToCfEgressRTTMs int64` Round trip time in ms of the client to Cloudflare egress mile - `ClientToCfIngressRTTMs int64` Round trip time in ms of the client to Cloudflare ingress mile - `Timestamp string` - `ClientToISPRTTMs int64` Round trip time in ms of the client to ISP mile - `Sampling NetworkPathSampling` 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 NetworkPathSamplingUnit` - `const NetworkPathSamplingUnitHours NetworkPathSamplingUnit = "hours"` - `Value int64` - `URL string` The host of the Traceroute synthetic application test ### Percentiles - `type Percentiles struct{…}` - `P50 float64` p50 observed in the time period - `P90 float64` p90 observed in the time period - `P95 float64` p95 observed in the time period - `P99 float64` p99 observed in the time period # WARP Change Events ## List WARP change events. `client.ZeroTrust.DEX.WARPChangeEvents.Get(ctx, params) (*[]DexwarpChangeEventGetResponse, error)` **get** `/accounts/{account_id}/dex/warp-change-events` List WARP configuration and enablement toggle change events by device. ### Parameters - `params DEXWARPChangeEventGetParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `From param.Field[string]` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `Page param.Field[float64]` Query param: Page number of paginated results - `PerPage param.Field[float64]` Query param: Number of items per page - `To param.Field[string]` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `AccountName param.Field[string]` Query param: Filter events by account name. - `ConfigName param.Field[string]` Query param: Filter events by WARP configuration name changed from or to. Applicable to type='config' events only. - `SortOrder param.Field[DexwarpChangeEventGetParamsSortOrder]` Query param: Sort response by event timestamp. - `const DexwarpChangeEventGetParamsSortOrderAsc DexwarpChangeEventGetParamsSortOrder = "ASC"` - `const DexwarpChangeEventGetParamsSortOrderDesc DexwarpChangeEventGetParamsSortOrder = "DESC"` - `Toggle param.Field[DexwarpChangeEventGetParamsToggle]` Query param: Filter events by type toggle value. Applicable to type='toggle' events only. - `const DexwarpChangeEventGetParamsToggleOn DexwarpChangeEventGetParamsToggle = "on"` - `const DexwarpChangeEventGetParamsToggleOff DexwarpChangeEventGetParamsToggle = "off"` - `Type param.Field[DexwarpChangeEventGetParamsType]` Query param: Filter events by type 'config' or 'toggle' - `const DexwarpChangeEventGetParamsTypeConfig DexwarpChangeEventGetParamsType = "config"` - `const DexwarpChangeEventGetParamsTypeToggle DexwarpChangeEventGetParamsType = "toggle"` ### Returns - `type DexwarpChangeEventGetResponseEnvelopeResult []DexwarpChangeEventGetResponse` - `type DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEvent struct{…}` - `AccountName string` The account name. - `AccountTag string` The public account identifier. - `DeviceID string` API Resource UUID tag. - `DeviceRegistration string` API Resource UUID tag. - `Hostname string` The hostname of the machine the event is from - `SerialNumber string` The serial number of the machine the event is from - `Timestamp string` Timestamp in ISO format - `Toggle DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEventToggle` The state of the WARP toggle. - `const DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEventToggleOn DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEventToggle = "on"` - `const DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEventToggleOff DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPToggleChangeEventToggle = "off"` - `UserEmail string` Email tied to the device - `type DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPConfigChangeEvent struct{…}` - `DeviceID string` API Resource UUID tag. - `DeviceRegistration string` API Resource UUID tag. - `From DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPConfigChangeEventFrom` - `AccountName string` The account name. - `AccountTag string` API Resource UUID tag. - `ConfigName string` The name of the WARP configuration. - `Hostname string` The hostname of the machine the event is from - `SerialNumber string` The serial number of the machine the event is from - `Timestamp string` Timestamp in ISO format - `To DexwarpChangeEventGetResponseDigitalExperienceMonitoringWARPConfigChangeEventTo` - `AccountName string` The account name. - `AccountTag string` API Resource UUID tag. - `ConfigName string` The name of the WARP configuration. - `UserEmail string` Email tied to the device ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) warpChangeEvents, err := client.ZeroTrust.DEX.WARPChangeEvents.Get(context.TODO(), zero_trust.DEXWARPChangeEventGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-09-20T17:00:00Z"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), To: cloudflare.F("2023-09-20T17:00:00Z"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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", "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 } } ``` # Commands ## List account commands `client.ZeroTrust.DEX.Commands.List(ctx, params) (*V4PagePagination[DEXCommandListResponse], error)` **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 DEXCommandListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Page param.Field[float64]` Query param: Page number for pagination - `PerPage param.Field[float64]` Query param: Number of results per page - `CommandType param.Field[string]` Query param: Optionally filter executed commands by command type - `DeviceID param.Field[string]` Query param: Unique identifier for a device - `From param.Field[Time]` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `Status param.Field[DEXCommandListParamsStatus]` Query param: Optionally filter executed commands by status - `const DEXCommandListParamsStatusPendingExec DEXCommandListParamsStatus = "PENDING_EXEC"` - `const DEXCommandListParamsStatusPendingUpload DEXCommandListParamsStatus = "PENDING_UPLOAD"` - `const DEXCommandListParamsStatusSuccess DEXCommandListParamsStatus = "SUCCESS"` - `const DEXCommandListParamsStatusFailed DEXCommandListParamsStatus = "FAILED"` - `To param.Field[Time]` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `UserEmail param.Field[string]` Query param: Email tied to the device ### Returns - `type DEXCommandListResponse struct{…}` - `Commands []DEXCommandListResponseCommand` - `ID string` - `CompletedDate Time` - `CreatedDate Time` - `DeviceID string` - `Filename string` - `RegistrationID string` Unique identifier for the device registration - `Status string` - `Type string` - `UserEmail string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.Commands.List(context.TODO(), zero_trust.DEXCommandListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(50.000000), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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.New(ctx, params) (*DEXCommandNewResponse, error)` **post** `/accounts/{account_id}/dex/commands` Initiate commands for up to 10 devices per account ### Parameters - `params DEXCommandNewParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Commands param.Field[[]DEXCommandNewParamsCommand]` Body param: List of device-level commands to execute - `CommandType DEXCommandNewParamsCommandsCommandType` Type of command to execute on the device - `const DEXCommandNewParamsCommandsCommandTypePCAP DEXCommandNewParamsCommandsCommandType = "pcap"` - `const DEXCommandNewParamsCommandsCommandTypeWARPDiag DEXCommandNewParamsCommandsCommandType = "warp-diag"` - `DeviceID string` Unique identifier for the physical device - `UserEmail string` Email tied to the device - `CommandArgs DEXCommandNewParamsCommandsCommandArgs` - `Interfaces []DEXCommandNewParamsCommandsCommandArgsInterface` List of interfaces to capture packets on - `const DEXCommandNewParamsCommandsCommandArgsInterfaceDefault DEXCommandNewParamsCommandsCommandArgsInterface = "default"` - `const DEXCommandNewParamsCommandsCommandArgsInterfaceTunnel DEXCommandNewParamsCommandsCommandArgsInterface = "tunnel"` - `MaxFileSizeMB float64` 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 - `PacketSizeBytes float64` Maximum number of bytes to save for each packet - `TestAllRoutes 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 - `TimeLimitMin float64` Limit on capture duration (in minutes) - `RegistrationID string` Unique identifier for the device registration. Required for multi-user devices to target the correct user session. ### Returns - `type DEXCommandNewResponse struct{…}` - `Commands []DEXCommandNewResponseCommand` List of created commands - `ID string` Unique identifier for the command - `Args map[string, string]` Command arguments - `DeviceID string` Identifier for the device associated with the command - `RegistrationID string` Unique identifier for the device registration - `Status DEXCommandNewResponseCommandsStatus` Current status of the command - `const DEXCommandNewResponseCommandsStatusPendingExec DEXCommandNewResponseCommandsStatus = "PENDING_EXEC"` - `const DEXCommandNewResponseCommandsStatusPendingUpload DEXCommandNewResponseCommandsStatus = "PENDING_UPLOAD"` - `const DEXCommandNewResponseCommandsStatusSuccess DEXCommandNewResponseCommandsStatus = "SUCCESS"` - `const DEXCommandNewResponseCommandsStatusFailed DEXCommandNewResponseCommandsStatus = "FAILED"` - `Type string` Type of the command (e.g., "pcap" or "warp-diag") ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) command, err := client.ZeroTrust.DEX.Commands.New(context.TODO(), zero_trust.DEXCommandNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Commands: cloudflare.F([]zero_trust.DEXCommandNewParamsCommand{zero_trust.DEXCommandNewParamsCommand{ CommandType: cloudflare.F(zero_trust.DEXCommandNewParamsCommandsCommandTypePCAP), DeviceID: cloudflare.F("device_id"), UserEmail: cloudflare.F("user_email"), }}), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } } ``` # Devices ## List devices eligible for remote captures `client.ZeroTrust.DEX.Commands.Devices.List(ctx, params) (*V4PagePagination[DEXCommandDeviceListResponse], error)` **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 DEXCommandDeviceListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Page param.Field[float64]` Query param: Page number of paginated results - `PerPage param.Field[float64]` Query param: Number of items per page - `Search param.Field[string]` Query param: Filter devices by name or email ### Returns - `type DEXCommandDeviceListResponse struct{…}` - `Devices []DEXCommandDeviceListResponseDevice` List of eligible devices - `DeviceID string` Device identifier (UUID v4) - `DeviceName string` Device identifier (human readable) - `Eligible bool` 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 ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.Commands.Devices.List(context.TODO(), zero_trust.DEXCommandDeviceListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 } } ``` # Downloads ## Download command output file `client.ZeroTrust.DEX.Commands.Downloads.Get(ctx, commandID, filename, query) (*Response, error)` **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` - `query DEXCommandDownloadGetParams` - `AccountID param.Field[string]` unique identifier linked to an account in the API request path ### Returns - `type DEXCommandDownloadGetResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) download, err := client.ZeroTrust.DEX.Commands.Downloads.Get( context.TODO(), "5758fefe-ae7e-4538-a39b-1fef6abcb909", "filename", zero_trust.DEXCommandDownloadGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", download) } ``` # Quota ## Returns account commands usage, quota, and reset time `client.ZeroTrust.DEX.Commands.Quota.Get(ctx, query) (*DEXCommandQuotaGetResponse, error)` **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 - `query DEXCommandQuotaGetParams` - `AccountID param.Field[string]` unique identifier linked to an account in the API request path ### Returns - `type DEXCommandQuotaGetResponse struct{…}` - `Quota float64` The remaining number of commands that can be initiated for an account - `QuotaUsage float64` The number of commands that have been initiated for an account - `ResetTime Time` The time when the quota resets ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) quota, err := client.ZeroTrust.DEX.Commands.Quota.Get(context.TODO(), zero_trust.DEXCommandQuotaGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 } } ``` # Colos ## List Cloudflare colos `client.ZeroTrust.DEX.Colos.List(ctx, params) (*SinglePage[DEXColoListResponse], error)` **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 DEXColoListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `From param.Field[string]` Query param: Start time for connection period in ISO (RFC3339 - ISO 8601) format - `To param.Field[string]` Query param: End time for connection period in ISO (RFC3339 - ISO 8601) format - `SortBy param.Field[DEXColoListParamsSortBy]` Query param: Type of usage that colos should be sorted by. If unspecified, returns all Cloudflare colos sorted alphabetically. - `const DEXColoListParamsSortByFleetStatusUsage DEXColoListParamsSortBy = "fleet-status-usage"` - `const DEXColoListParamsSortByApplicationTestsUsage DEXColoListParamsSortBy = "application-tests-usage"` ### Returns - `type DEXColoListResponse struct{…}` - `AirportCode string` Airport code - `City string` City - `CountryCode string` Country code ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.Colos.List(context.TODO(), zero_trust.DEXColoListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-08-20T20:45:00Z"), To: cloudflare.F("2023-08-24T20:45:00Z"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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" } ] } ``` # Fleet Status ## List fleet status details by dimension `client.ZeroTrust.DEX.FleetStatus.Live(ctx, params) (*DEXFleetStatusLiveResponse, error)` **get** `/accounts/{account_id}/dex/fleet-status/live` List details for live (up to 60 minutes) devices using WARP ### Parameters - `params DEXFleetStatusLiveParams` - `AccountID param.Field[string]` Path param: Unique identifier for account - `SinceMinutes param.Field[float64]` Query param: Number of minutes before current time ### Returns - `type DEXFleetStatusLiveResponse struct{…}` - `DeviceStats DEXFleetStatusLiveResponseDeviceStats` - `ByColo []LiveStat` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `ByMode []LiveStat` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `ByPlatform []LiveStat` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `ByStatus []LiveStat` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `ByVersion []LiveStat` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `UniqueDevicesTotal float64` Number of unique devices ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.ZeroTrust.DEX.FleetStatus.Live(context.TODO(), zero_trust.DEXFleetStatusLiveParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), SinceMinutes: cloudflare.F(10.000000), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, params) (*DEXFleetStatusOverTimeResponse, error)` **get** `/accounts/{account_id}/dex/fleet-status/over-time` List details for devices using WARP, up to 7 days ### Parameters - `params DEXFleetStatusOverTimeParams` - `AccountID param.Field[string]` Path param: Unique identifier for account - `From param.Field[string]` Query param: Time range beginning in ISO format - `To param.Field[string]` Query param: Time range end in ISO format - `Colo param.Field[string]` Query param: Cloudflare colo - `DeviceID param.Field[string]` Query param: Device-specific ID, given as UUID v4 ### Returns - `type DEXFleetStatusOverTimeResponse struct{…}` - `DeviceStats DEXFleetStatusOverTimeResponseDeviceStats` - `ByMode []DEXFleetStatusOverTimeResponseDeviceStatsByMode` - `Timestamp string` Timestamp in ISO format - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `ByStatus []DEXFleetStatusOverTimeResponseDeviceStatsByStatus` - `Timestamp string` Timestamp in ISO format - `UniqueDevicesTotal float64` Number of unique devices - `Value string` - `UniqueDevicesTotal float64` Number of unique devices ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.ZeroTrust.DEX.FleetStatus.OverTime(context.TODO(), zero_trust.DEXFleetStatusOverTimeParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-10-11T00:00:00Z"), To: cloudflare.F("2023-10-11T00:00:00Z"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type LiveStat struct{…}` - `UniqueDevicesTotal float64` Number of unique devices - `Value string` # Devices ## List fleet status devices `client.ZeroTrust.DEX.FleetStatus.Devices.List(ctx, params) (*V4PagePaginationArray[DEXFleetStatusDeviceListResponse], error)` **get** `/accounts/{account_id}/dex/fleet-status/devices` List details for devices using WARP ### Parameters - `params DEXFleetStatusDeviceListParams` - `AccountID param.Field[string]` Path param: Unique identifier for account - `From param.Field[string]` Query param: Time range beginning in ISO format - `Page param.Field[float64]` Query param: Page number - `PerPage param.Field[float64]` Query param: Number of results per page - `To param.Field[string]` Query param: Time range end in ISO format - `Colo param.Field[string]` Query param: Cloudflare colo - `DeviceID param.Field[string]` Query param: Device-specific ID, given as UUID v4 - `Mode param.Field[string]` Query param: The mode under which the WARP client is run - `Platform param.Field[string]` Query param: Operating system - `SortBy param.Field[DEXFleetStatusDeviceListParamsSortBy]` Query param: Dimension to sort results by - `const DEXFleetStatusDeviceListParamsSortByColo DEXFleetStatusDeviceListParamsSortBy = "colo"` - `const DEXFleetStatusDeviceListParamsSortByDeviceID DEXFleetStatusDeviceListParamsSortBy = "device_id"` - `const DEXFleetStatusDeviceListParamsSortByMode DEXFleetStatusDeviceListParamsSortBy = "mode"` - `const DEXFleetStatusDeviceListParamsSortByPlatform DEXFleetStatusDeviceListParamsSortBy = "platform"` - `const DEXFleetStatusDeviceListParamsSortByStatus DEXFleetStatusDeviceListParamsSortBy = "status"` - `const DEXFleetStatusDeviceListParamsSortByTimestamp DEXFleetStatusDeviceListParamsSortBy = "timestamp"` - `const DEXFleetStatusDeviceListParamsSortByVersion DEXFleetStatusDeviceListParamsSortBy = "version"` - `Source param.Field[DEXFleetStatusDeviceListParamsSource]` Query param: 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 - `const DEXFleetStatusDeviceListParamsSourceLastSeen DEXFleetStatusDeviceListParamsSource = "last_seen"` - `const DEXFleetStatusDeviceListParamsSourceHourly DEXFleetStatusDeviceListParamsSource = "hourly"` - `const DEXFleetStatusDeviceListParamsSourceRaw DEXFleetStatusDeviceListParamsSource = "raw"` - `Status param.Field[string]` Query param: Network status - `Version param.Field[string]` Query param: WARP client version ### Returns - `type DEXFleetStatusDeviceListResponse struct{…}` - `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 bool` - `BatteryCharging bool` - `BatteryCycles int64` - `BatteryPct float64` - `ConnectionType string` - `CPUPct float64` - `CPUPctByApp [][]DEXFleetStatusDeviceListResponseCPUPctByApp` - `CPUPct float64` - `Name string` - `DeviceIPV4 DEXFleetStatusDeviceListResponseDeviceIPV4` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseDeviceIPV4Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `DeviceIPV6 DEXFleetStatusDeviceListResponseDeviceIPV6` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseDeviceIPV6Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `DeviceName string` Device identifier (human readable) - `DiskReadBps int64` - `DiskUsagePct float64` - `DiskWriteBps int64` - `DOHSubdomain string` - `EstimatedLossPct float64` - `FirewallEnabled bool` - `GatewayIPV4 DEXFleetStatusDeviceListResponseGatewayIPV4` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseGatewayIPV4Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `GatewayIPV6 DEXFleetStatusDeviceListResponseGatewayIPV6` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseGatewayIPV6Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `HandshakeLatencyMs float64` - `ISPIPV4 DEXFleetStatusDeviceListResponseISPIPV4` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseISPIPV4Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `ISPIPV6 DEXFleetStatusDeviceListResponseISPIPV6` - `Address string` - `ASN int64` - `Aso string` - `Location DEXFleetStatusDeviceListResponseISPIPV6Location` - `City string` - `CountryISO string` - `StateISO string` - `Zip string` - `Netmask string` - `Version string` - `Metal string` - `NetworkRcvdBps int64` - `NetworkSentBps int64` - `NetworkSsid string` - `PersonEmail string` User contact email address - `RamAvailableKB int64` - `RamUsedPct float64` - `RamUsedPctByApp [][]DEXFleetStatusDeviceListResponseRamUsedPctByApp` - `Name string` - `RamUsedPct float64` - `SwitchLocked bool` - `WifiStrengthDbm int64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.FleetStatus.Devices.List(context.TODO(), zero_trust.DEXFleetStatusDeviceListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-10-11T00:00:00Z"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(10.000000), To: cloudflare.F("2023-10-11T00:00:00Z"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 } } ``` # HTTP Tests ## Get details and aggregate metrics for an http test `client.ZeroTrust.DEX.HTTPTests.Get(ctx, testID, params) (*HTTPDetails, error)` **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 DEXHTTPTestGetParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `From param.Field[string]` Query param: Start time for aggregate metrics in ISO ms - `Interval param.Field[DexhttpTestGetParamsInterval]` Query param: Time interval for aggregate time slots. - `const DexhttpTestGetParamsIntervalMinute DexhttpTestGetParamsInterval = "minute"` - `const DexhttpTestGetParamsIntervalHour DexhttpTestGetParamsInterval = "hour"` - `To param.Field[string]` Query param: End time for aggregate metrics in ISO ms - `Colo param.Field[string]` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `type HTTPDetails struct{…}` - `Host string` The url of the HTTP synthetic application test - `HTTPStats HTTPDetailsHTTPStats` - `AvailabilityPct HTTPDetailsHTTPStatsAvailabilityPct` - `Slots []HTTPDetailsHTTPStatsAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `DNSResponseTimeMs TestStatOverTime` - `Slots []TestStatOverTimeSlot` - `Timestamp string` - `Value int64` - `Avg int64` average observed in the time period - `Max int64` highest observed in the time period - `Min int64` lowest observed in the time period - `HTTPStatusCode []HTTPDetailsHTTPStatsHTTPStatusCode` - `Status200 int64` - `Status300 int64` - `Status400 int64` - `Status500 int64` - `Timestamp string` - `ResourceFetchTimeMs TestStatOverTime` - `ServerResponseTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period - `HTTPStatsByColo []HTTPDetailsHTTPStatsByColo` - `AvailabilityPct HTTPDetailsHTTPStatsByColoAvailabilityPct` - `Slots []HTTPDetailsHTTPStatsByColoAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `Colo string` - `DNSResponseTimeMs TestStatOverTime` - `HTTPStatusCode []HTTPDetailsHTTPStatsByColoHTTPStatusCode` - `Status200 int64` - `Status300 int64` - `Status400 int64` - `Status500 int64` - `Timestamp string` - `ResourceFetchTimeMs TestStatOverTime` - `ServerResponseTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` 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 HTTPDetailsKind` - `const HTTPDetailsKindHTTP HTTPDetailsKind = "http"` - `Method string` The HTTP method to use when running the test - `Name string` The name of the HTTP synthetic application test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) httpDetails, err := client.ZeroTrust.DEX.HTTPTests.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXHTTPTestGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("1689520412000"), Interval: cloudflare.F(zero_trust.DexhttpTestGetParamsIntervalMinute), To: cloudflare.F("1689606812000"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type HTTPDetails struct{…}` - `Host string` The url of the HTTP synthetic application test - `HTTPStats HTTPDetailsHTTPStats` - `AvailabilityPct HTTPDetailsHTTPStatsAvailabilityPct` - `Slots []HTTPDetailsHTTPStatsAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `DNSResponseTimeMs TestStatOverTime` - `Slots []TestStatOverTimeSlot` - `Timestamp string` - `Value int64` - `Avg int64` average observed in the time period - `Max int64` highest observed in the time period - `Min int64` lowest observed in the time period - `HTTPStatusCode []HTTPDetailsHTTPStatsHTTPStatusCode` - `Status200 int64` - `Status300 int64` - `Status400 int64` - `Status500 int64` - `Timestamp string` - `ResourceFetchTimeMs TestStatOverTime` - `ServerResponseTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period - `HTTPStatsByColo []HTTPDetailsHTTPStatsByColo` - `AvailabilityPct HTTPDetailsHTTPStatsByColoAvailabilityPct` - `Slots []HTTPDetailsHTTPStatsByColoAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `Colo string` - `DNSResponseTimeMs TestStatOverTime` - `HTTPStatusCode []HTTPDetailsHTTPStatsByColoHTTPStatusCode` - `Status200 int64` - `Status300 int64` - `Status400 int64` - `Status500 int64` - `Timestamp string` - `ResourceFetchTimeMs TestStatOverTime` - `ServerResponseTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` 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 HTTPDetailsKind` - `const HTTPDetailsKindHTTP HTTPDetailsKind = "http"` - `Method string` The HTTP method to use when running the test - `Name string` The name of the HTTP synthetic application test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` # Percentiles ## Get percentiles for an http test `client.ZeroTrust.DEX.HTTPTests.Percentiles.Get(ctx, testID, params) (*HTTPDetailsPercentiles, error)` **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 DEXHTTPTestPercentileGetParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `From param.Field[string]` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `To param.Field[string]` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `Colo param.Field[string]` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `type HTTPDetailsPercentiles struct{…}` - `DNSResponseTimeMs Percentiles` - `P50 float64` p50 observed in the time period - `P90 float64` p90 observed in the time period - `P95 float64` p95 observed in the time period - `P99 float64` p99 observed in the time period - `ResourceFetchTimeMs Percentiles` - `ServerResponseTimeMs Percentiles` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) httpDetailsPercentiles, err := client.ZeroTrust.DEX.HTTPTests.Percentiles.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXHTTPTestPercentileGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-09-20T17:00:00Z"), To: cloudflare.F("2023-09-20T17:00:00Z"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type HTTPDetailsPercentiles struct{…}` - `DNSResponseTimeMs Percentiles` - `P50 float64` p50 observed in the time period - `P90 float64` p90 observed in the time period - `P95 float64` p95 observed in the time period - `P99 float64` p99 observed in the time period - `ResourceFetchTimeMs Percentiles` - `ServerResponseTimeMs Percentiles` ### Test Stat Over Time - `type TestStatOverTime struct{…}` - `Slots []TestStatOverTimeSlot` - `Timestamp string` - `Value int64` - `Avg int64` average observed in the time period - `Max int64` highest observed in the time period - `Min int64` lowest observed in the time period # Tests ## List DEX test analytics `client.ZeroTrust.DEX.Tests.List(ctx, params) (*V4PagePagination[Tests], error)` **get** `/accounts/{account_id}/dex/tests/overview` List DEX tests with overview metrics ### Parameters - `params DEXTestListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `Colo param.Field[string]` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `Kind param.Field[DEXTestListParamsKind]` Query param: Filter by test type - `const DEXTestListParamsKindHTTP DEXTestListParamsKind = "http"` - `const DEXTestListParamsKindTraceroute DEXTestListParamsKind = "traceroute"` - `Page param.Field[float64]` Query param: Page number of paginated results - `PerPage param.Field[float64]` Query param: Number of items per page - `TestName param.Field[string]` Query param: Optionally filter results by test name ### Returns - `type Tests struct{…}` - `OverviewMetrics TestsOverviewMetrics` - `TestsTotal int64` number of tests. - `AvgHTTPAvailabilityPct float64` percentage availability for all HTTP test results in response - `AvgTracerouteAvailabilityPct float64` percentage availability for all traceroutes results in response - `Tests []TestsTest` 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 bool` 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 TestsTestsKind` test type, http or traceroute - `const TestsTestsKindHTTP TestsTestsKind = "http"` - `const TestsTestsKindTraceroute TestsTestsKind = "traceroute"` - `Name string` name given to this test - `Updated string` - `HTTPResults TestsTestsHTTPResults` - `ResourceFetchTime TestsTestsHTTPResultsResourceFetchTime` - `History []TestsTestsHTTPResultsResourceFetchTimeHistory` - `TimePeriod AggregateTimePeriod` - `Units AggregateTimePeriodUnits` - `const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"` - `const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"` - `const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"` - `Value int64` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsHTTPResultsResourceFetchTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsHTTPResultsResourceFetchTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `HTTPResultsByColo []TestsTestsHTTPResultsByColo` - `Colo string` Cloudflare colo - `ResourceFetchTime TestsTestsHTTPResultsByColoResourceFetchTime` - `History []TestsTestsHTTPResultsByColoResourceFetchTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsHTTPResultsByColoResourceFetchTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsHTTPResultsByColoResourceFetchTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `Method string` for HTTP, the method to use when running the test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` - `TracerouteResults TestsTestsTracerouteResults` - `RoundTripTime TestsTestsTracerouteResultsRoundTripTime` - `History []TestsTestsTracerouteResultsRoundTripTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsTracerouteResultsRoundTripTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsTracerouteResultsRoundTripTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `TracerouteResultsByColo []TestsTestsTracerouteResultsByColo` - `Colo string` Cloudflare colo - `RoundTripTime TestsTestsTracerouteResultsByColoRoundTripTime` - `History []TestsTestsTracerouteResultsByColoRoundTripTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsTracerouteResultsByColoRoundTripTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsTracerouteResultsByColoRoundTripTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.Tests.List(context.TODO(), zero_trust.DEXTestListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 - `type AggregateTimePeriod struct{…}` - `Units AggregateTimePeriodUnits` - `const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"` - `const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"` - `const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"` - `Value int64` ### Tests - `type Tests struct{…}` - `OverviewMetrics TestsOverviewMetrics` - `TestsTotal int64` number of tests. - `AvgHTTPAvailabilityPct float64` percentage availability for all HTTP test results in response - `AvgTracerouteAvailabilityPct float64` percentage availability for all traceroutes results in response - `Tests []TestsTest` 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 bool` 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 TestsTestsKind` test type, http or traceroute - `const TestsTestsKindHTTP TestsTestsKind = "http"` - `const TestsTestsKindTraceroute TestsTestsKind = "traceroute"` - `Name string` name given to this test - `Updated string` - `HTTPResults TestsTestsHTTPResults` - `ResourceFetchTime TestsTestsHTTPResultsResourceFetchTime` - `History []TestsTestsHTTPResultsResourceFetchTimeHistory` - `TimePeriod AggregateTimePeriod` - `Units AggregateTimePeriodUnits` - `const AggregateTimePeriodUnitsHours AggregateTimePeriodUnits = "hours"` - `const AggregateTimePeriodUnitsDays AggregateTimePeriodUnits = "days"` - `const AggregateTimePeriodUnitsTestRuns AggregateTimePeriodUnits = "testRuns"` - `Value int64` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsHTTPResultsResourceFetchTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsHTTPResultsResourceFetchTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `HTTPResultsByColo []TestsTestsHTTPResultsByColo` - `Colo string` Cloudflare colo - `ResourceFetchTime TestsTestsHTTPResultsByColoResourceFetchTime` - `History []TestsTestsHTTPResultsByColoResourceFetchTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsHTTPResultsByColoResourceFetchTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsHTTPResultsByColoResourceFetchTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `Method string` for HTTP, the method to use when running the test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` - `TracerouteResults TestsTestsTracerouteResults` - `RoundTripTime TestsTestsTracerouteResultsRoundTripTime` - `History []TestsTestsTracerouteResultsRoundTripTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsTracerouteResultsRoundTripTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsTracerouteResultsRoundTripTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` - `TracerouteResultsByColo []TestsTestsTracerouteResultsByColo` - `Colo string` Cloudflare colo - `RoundTripTime TestsTestsTracerouteResultsByColoRoundTripTime` - `History []TestsTestsTracerouteResultsByColoRoundTripTimeHistory` - `TimePeriod AggregateTimePeriod` - `AvgMs int64` - `DeltaPct float64` - `AvgMs int64` - `OverTime TestsTestsTracerouteResultsByColoRoundTripTimeOverTime` - `TimePeriod AggregateTimePeriod` - `Values []TestsTestsTracerouteResultsByColoRoundTripTimeOverTimeValue` - `AvgMs int64` - `Timestamp string` # Unique Devices ## Get count of devices targeted `client.ZeroTrust.DEX.Tests.UniqueDevices.List(ctx, params) (*UniqueDevices, error)` **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 DEXTestUniqueDeviceListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. - `TestName param.Field[string]` Query param: Optionally filter results by test name ### Returns - `type UniqueDevices struct{…}` - `UniqueDevicesTotal int64` total number of unique devices ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) uniqueDevices, err := client.ZeroTrust.DEX.Tests.UniqueDevices.List(context.TODO(), zero_trust.DEXTestUniqueDeviceListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type UniqueDevices struct{…}` - `UniqueDevicesTotal int64` total number of unique devices # Traceroute Test Results # Network Path ## Get details for a specific traceroute test run `client.ZeroTrust.DEX.TracerouteTestResults.NetworkPath.Get(ctx, testResultID, query) (*DEXTracerouteTestResultNetworkPathGetResponse, error)` **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. - `query DEXTracerouteTestResultNetworkPathGetParams` - `AccountID param.Field[string]` unique identifier linked to an account ### Returns - `type DEXTracerouteTestResultNetworkPathGetResponse struct{…}` - `Hops []DEXTracerouteTestResultNetworkPathGetResponseHop` an array of the hops taken by the device to reach the end destination - `TTL int64` - `ASN int64` - `Aso string` - `IPAddress string` - `Location DEXTracerouteTestResultNetworkPathGetResponseHopsLocation` - `City string` - `State string` - `Zip string` - `Mile DEXTracerouteTestResultNetworkPathGetResponseHopsMile` - `const DEXTracerouteTestResultNetworkPathGetResponseHopsMileClientToApp DEXTracerouteTestResultNetworkPathGetResponseHopsMile = "client-to-app"` - `const DEXTracerouteTestResultNetworkPathGetResponseHopsMileClientToCfEgress DEXTracerouteTestResultNetworkPathGetResponseHopsMile = "client-to-cf-egress"` - `const DEXTracerouteTestResultNetworkPathGetResponseHopsMileClientToCfIngress DEXTracerouteTestResultNetworkPathGetResponseHopsMile = "client-to-cf-ingress"` - `const DEXTracerouteTestResultNetworkPathGetResponseHopsMileClientToISP DEXTracerouteTestResultNetworkPathGetResponseHopsMile = "client-to-isp"` - `Name string` - `PacketLossPct float64` - `RTTMs int64` - `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 ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) networkPath, err := client.ZeroTrust.DEX.TracerouteTestResults.NetworkPath.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXTracerouteTestResultNetworkPathGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ``` # Traceroute Tests ## Get details and aggregate metrics for a traceroute test `client.ZeroTrust.DEX.TracerouteTests.Get(ctx, testID, params) (*Traceroute, error)` **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 DEXTracerouteTestGetParams` - `AccountID param.Field[string]` Path param: Unique identifier linked to an account - `From param.Field[string]` Query param: Start time for aggregate metrics in ISO ms - `Interval param.Field[DEXTracerouteTestGetParamsInterval]` Query param: Time interval for aggregate time slots. - `const DEXTracerouteTestGetParamsIntervalMinute DEXTracerouteTestGetParamsInterval = "minute"` - `const DEXTracerouteTestGetParamsIntervalHour DEXTracerouteTestGetParamsInterval = "hour"` - `To param.Field[string]` Query param: End time for aggregate metrics in ISO ms - `Colo param.Field[string]` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `type Traceroute struct{…}` - `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 TracerouteKind` - `const TracerouteKindTraceroute TracerouteKind = "traceroute"` - `Name string` The name of the Traceroute synthetic application test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` - `TracerouteStats TracerouteTracerouteStats` - `AvailabilityPct TracerouteTracerouteStatsAvailabilityPct` - `Slots []TracerouteTracerouteStatsAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `HopsCount TestStatOverTime` - `Slots []TestStatOverTimeSlot` - `Timestamp string` - `Value int64` - `Avg int64` average observed in the time period - `Max int64` highest observed in the time period - `Min int64` lowest observed in the time period - `PacketLossPct TracerouteTracerouteStatsPacketLossPct` - `Slots []TracerouteTracerouteStatsPacketLossPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `RoundTripTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period - `TracerouteStatsByColo []TracerouteTracerouteStatsByColo` - `AvailabilityPct TracerouteTracerouteStatsByColoAvailabilityPct` - `Slots []TracerouteTracerouteStatsByColoAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `Colo string` - `HopsCount TestStatOverTime` - `PacketLossPct TracerouteTracerouteStatsByColoPacketLossPct` - `Slots []TracerouteTracerouteStatsByColoPacketLossPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `RoundTripTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) traceroute, err := client.ZeroTrust.DEX.TracerouteTests.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXTracerouteTestGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("1689520412000"), Interval: cloudflare.F(zero_trust.DEXTracerouteTestGetParamsIntervalMinute), To: cloudflare.F("1689606812000"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, testID, params) (*DEXTracerouteTestPercentilesResponse, error)` **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 DEXTracerouteTestPercentilesParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path. - `From param.Field[string]` Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format - `To param.Field[string]` Query param: End time for the query in ISO (RFC3339 - ISO 8601) format - `Colo param.Field[string]` Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used in combination with deviceId param. - `DeviceID param.Field[[]string]` Query param: Optionally filter result stats to a specific device(s). Cannot be used in combination with colo param. ### Returns - `type DEXTracerouteTestPercentilesResponse struct{…}` - `HopsCount Percentiles` - `P50 float64` p50 observed in the time period - `P90 float64` p90 observed in the time period - `P95 float64` p95 observed in the time period - `P99 float64` p99 observed in the time period - `PacketLossPct Percentiles` - `RoundTripTimeMs Percentiles` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) response, err := client.ZeroTrust.DEX.TracerouteTests.Percentiles( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXTracerouteTestPercentilesParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), From: cloudflare.F("2023-09-20T17:00:00Z"), To: cloudflare.F("2023-09-20T17:00:00Z"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, testID, params) (*NetworkPathResponse, error)` **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 DEXTracerouteTestNetworkPathParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account - `DeviceID param.Field[string]` Query param: Device to filter tracroute result runs to - `From param.Field[string]` Query param: Start time for aggregate metrics in ISO ms - `Interval param.Field[DEXTracerouteTestNetworkPathParamsInterval]` Query param: Time interval for aggregate time slots. - `const DEXTracerouteTestNetworkPathParamsIntervalMinute DEXTracerouteTestNetworkPathParamsInterval = "minute"` - `const DEXTracerouteTestNetworkPathParamsIntervalHour DEXTracerouteTestNetworkPathParamsInterval = "hour"` - `To param.Field[string]` Query param: End time for aggregate metrics in ISO ms ### Returns - `type NetworkPathResponse struct{…}` - `ID string` API Resource UUID tag. - `DeviceName string` - `Interval string` The interval at which the Traceroute synthetic application test is set to run. - `Kind NetworkPathResponseKind` - `const NetworkPathResponseKindTraceroute NetworkPathResponseKind = "traceroute"` - `Name string` - `NetworkPath NetworkPath` - `Slots []NetworkPathSlot` - `ID string` API Resource UUID tag. - `ClientToAppRTTMs int64` Round trip time in ms of the client to app mile - `ClientToCfEgressRTTMs int64` Round trip time in ms of the client to Cloudflare egress mile - `ClientToCfIngressRTTMs int64` Round trip time in ms of the client to Cloudflare ingress mile - `Timestamp string` - `ClientToISPRTTMs int64` Round trip time in ms of the client to ISP mile - `Sampling NetworkPathSampling` 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 NetworkPathSamplingUnit` - `const NetworkPathSamplingUnitHours NetworkPathSamplingUnit = "hours"` - `Value int64` - `URL string` The host of the Traceroute synthetic application test ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) networkPathResponse, err := client.ZeroTrust.DEX.TracerouteTests.NetworkPath( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXTracerouteTestNetworkPathParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), DeviceID: cloudflare.F("deviceId"), From: cloudflare.F("1689520412000"), Interval: cloudflare.F(zero_trust.DEXTracerouteTestNetworkPathParamsIntervalMinute), To: cloudflare.F("1689606812000"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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 - `type Traceroute struct{…}` - `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 TracerouteKind` - `const TracerouteKindTraceroute TracerouteKind = "traceroute"` - `Name string` The name of the Traceroute synthetic application test - `TargetPolicies []DigitalExperienceMonitor` - `ID string` API Resource UUID tag. - `Default bool` Whether the policy is the default for the account - `Name string` - `Targeted bool` - `TracerouteStats TracerouteTracerouteStats` - `AvailabilityPct TracerouteTracerouteStatsAvailabilityPct` - `Slots []TracerouteTracerouteStatsAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `HopsCount TestStatOverTime` - `Slots []TestStatOverTimeSlot` - `Timestamp string` - `Value int64` - `Avg int64` average observed in the time period - `Max int64` highest observed in the time period - `Min int64` lowest observed in the time period - `PacketLossPct TracerouteTracerouteStatsPacketLossPct` - `Slots []TracerouteTracerouteStatsPacketLossPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `RoundTripTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period - `TracerouteStatsByColo []TracerouteTracerouteStatsByColo` - `AvailabilityPct TracerouteTracerouteStatsByColoAvailabilityPct` - `Slots []TracerouteTracerouteStatsByColoAvailabilityPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `Colo string` - `HopsCount TestStatOverTime` - `PacketLossPct TracerouteTracerouteStatsByColoPacketLossPct` - `Slots []TracerouteTracerouteStatsByColoPacketLossPctSlot` - `Timestamp string` - `Value float64` - `Avg float64` average observed in the time period - `Max float64` highest observed in the time period - `Min float64` lowest observed in the time period - `RoundTripTimeMs TestStatOverTime` - `UniqueDevicesTotal int64` Count of unique devices that have run this test in the given time period # Rules ## Get DEX Rule `client.ZeroTrust.DEX.Rules.Get(ctx, ruleID, query) (*DEXRuleGetResponse, error)` **get** `/accounts/{account_id}/dex/rules/{rule_id}` Get details for a DEX Rule ### Parameters - `ruleID string` API Resource UUID tag. - `query DEXRuleGetParams` - `AccountID param.Field[string]` unique identifier linked to an account in the API request path ### Returns - `type DEXRuleGetResponse struct{…}` - `ID string` API Resource UUID tag. - `CreatedAt string` - `Match string` - `Name string` - `Description string` - `TargetedTests []DEXRuleGetResponseTargetedTest` - `Data DEXRuleGetResponseTargetedTestsData` The configuration object which contains the details for the WARP client to conduct the test. - `Host string` The desired endpoint to test. - `Kind DEXRuleGetResponseTargetedTestsDataKind` The type of test. - `const DEXRuleGetResponseTargetedTestsDataKindHTTP DEXRuleGetResponseTargetedTestsDataKind = "http"` - `const DEXRuleGetResponseTargetedTestsDataKindTraceroute DEXRuleGetResponseTargetedTestsDataKind = "traceroute"` - `Method DEXRuleGetResponseTargetedTestsDataMethod` The HTTP request method type. - `const DEXRuleGetResponseTargetedTestsDataMethodGet DEXRuleGetResponseTargetedTestsDataMethod = "GET"` - `Enabled bool` - `Name string` - `TestID string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.ZeroTrust.DEX.Rules.Get( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXRuleGetParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, ruleID, body) (*bool, error)` **delete** `/accounts/{account_id}/dex/rules/{rule_id}` Delete a DEX Rule ### Parameters - `ruleID string` API Resource UUID tag. - `body DEXRuleDeleteParams` - `AccountID param.Field[string]` unique identifier linked to an account in the API request path ### Returns - `type DEXRuleDeleteResponseEnvelopeResult bool` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.ZeroTrust.DEX.Rules.Delete( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXRuleDeleteParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, ruleID, params) (*DEXRuleUpdateResponse, error)` **patch** `/accounts/{account_id}/dex/rules/{rule_id}` Update a DEX Rule ### Parameters - `ruleID string` API Resource UUID tag. - `params DEXRuleUpdateParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Description param.Field[string]` Body param - `Match param.Field[string]` Body param: The wirefilter expression to match. - `Name param.Field[string]` Body param: The name of the Rule. ### Returns - `type DEXRuleUpdateResponse struct{…}` - `ID string` API Resource UUID tag. - `CreatedAt string` - `Match string` - `Name string` - `Description string` - `TargetedTests []DEXRuleUpdateResponseTargetedTest` - `Data DEXRuleUpdateResponseTargetedTestsData` The configuration object which contains the details for the WARP client to conduct the test. - `Host string` The desired endpoint to test. - `Kind DEXRuleUpdateResponseTargetedTestsDataKind` The type of test. - `const DEXRuleUpdateResponseTargetedTestsDataKindHTTP DEXRuleUpdateResponseTargetedTestsDataKind = "http"` - `const DEXRuleUpdateResponseTargetedTestsDataKindTraceroute DEXRuleUpdateResponseTargetedTestsDataKind = "traceroute"` - `Method DEXRuleUpdateResponseTargetedTestsDataMethod` The HTTP request method type. - `const DEXRuleUpdateResponseTargetedTestsDataMethodGet DEXRuleUpdateResponseTargetedTestsDataMethod = "GET"` - `Enabled bool` - `Name string` - `TestID string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.ZeroTrust.DEX.Rules.Update( context.TODO(), "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", zero_trust.DEXRuleUpdateParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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.New(ctx, params) (*DEXRuleNewResponse, error)` **post** `/accounts/{account_id}/dex/rules` Create a DEX Rule ### Parameters - `params DEXRuleNewParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Match param.Field[string]` Body param: The wirefilter expression to match. - `Name param.Field[string]` Body param: The name of the Rule. - `Description param.Field[string]` Body param ### Returns - `type DEXRuleNewResponse struct{…}` - `ID string` API Resource UUID tag. - `CreatedAt string` - `Match string` - `Name string` - `Description string` - `TargetedTests []DEXRuleNewResponseTargetedTest` - `Data DEXRuleNewResponseTargetedTestsData` The configuration object which contains the details for the WARP client to conduct the test. - `Host string` The desired endpoint to test. - `Kind DEXRuleNewResponseTargetedTestsDataKind` The type of test. - `const DEXRuleNewResponseTargetedTestsDataKindHTTP DEXRuleNewResponseTargetedTestsDataKind = "http"` - `const DEXRuleNewResponseTargetedTestsDataKindTraceroute DEXRuleNewResponseTargetedTestsDataKind = "traceroute"` - `Method DEXRuleNewResponseTargetedTestsDataMethod` The HTTP request method type. - `const DEXRuleNewResponseTargetedTestsDataMethodGet DEXRuleNewResponseTargetedTestsDataMethod = "GET"` - `Enabled bool` - `Name string` - `TestID string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) rule, err := client.ZeroTrust.DEX.Rules.New(context.TODO(), zero_trust.DEXRuleNewParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Match: cloudflare.F("match"), Name: cloudflare.F("name"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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(ctx, params) (*V4PagePagination[DEXRuleListResponse], error)` **get** `/accounts/{account_id}/dex/rules` List DEX Rules ### Parameters - `params DEXRuleListParams` - `AccountID param.Field[string]` Path param: unique identifier linked to an account in the API request path - `Page param.Field[float64]` Query param: Page number of paginated results - `PerPage param.Field[float64]` Query param: Number of items per page - `Name param.Field[string]` Query param: Filter results by rule name - `SortBy param.Field[DEXRuleListParamsSortBy]` Query param: Which property to sort results by - `const DEXRuleListParamsSortByName DEXRuleListParamsSortBy = "name"` - `const DEXRuleListParamsSortByCreatedAt DEXRuleListParamsSortBy = "created_at"` - `const DEXRuleListParamsSortByUpdatedAt DEXRuleListParamsSortBy = "updated_at"` - `SortOrder param.Field[DEXRuleListParamsSortOrder]` Query param: Sort direction for sort_by property - `const DEXRuleListParamsSortOrderAsc DEXRuleListParamsSortOrder = "ASC"` - `const DEXRuleListParamsSortOrderDesc DEXRuleListParamsSortOrder = "DESC"` ### Returns - `type DEXRuleListResponse struct{…}` - `Rules []DEXRuleListResponseRule` - `ID string` API Resource UUID tag. - `CreatedAt string` - `Match string` - `Name string` - `Description string` - `TargetedTests []DEXRuleListResponseRulesTargetedTest` - `Data DEXRuleListResponseRulesTargetedTestsData` The configuration object which contains the details for the WARP client to conduct the test. - `Host string` The desired endpoint to test. - `Kind DEXRuleListResponseRulesTargetedTestsDataKind` The type of test. - `const DEXRuleListResponseRulesTargetedTestsDataKindHTTP DEXRuleListResponseRulesTargetedTestsDataKind = "http"` - `const DEXRuleListResponseRulesTargetedTestsDataKindTraceroute DEXRuleListResponseRulesTargetedTestsDataKind = "traceroute"` - `Method DEXRuleListResponseRulesTargetedTestsDataMethod` The HTTP request method type. - `const DEXRuleListResponseRulesTargetedTestsDataMethodGet DEXRuleListResponseRulesTargetedTestsDataMethod = "GET"` - `Enabled bool` - `Name string` - `TestID string` - `UpdatedAt string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/zero_trust" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.ZeroTrust.DEX.Rules.List(context.TODO(), zero_trust.DEXRuleListParams{ AccountID: cloudflare.F("01a7362d577a6c3019a474fd6f485823"), Page: cloudflare.F(1.000000), PerPage: cloudflare.F(1.000000), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### 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 } } ```