Skip to content
Start here

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

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloudflare DEX WriteCloudflare DEX ReadZero Trust ReportZero Trust Read
ParametersExpand Collapse
params DEXCommandListParams
AccountID param.Field[string]

Path param: Unique identifier linked to an account.

maxLength32
Page param.Field[float64]

Query param: Page number of paginated results.

minimum1
PerPage param.Field[float64]

Query param: Number of results per page.

maximum50
minimum1
CommandType param.Field[DEXCommandListParamsCommandType]Optional

Query param: Optionally filter executed commands by command type.

const DEXCommandListParamsCommandTypePCAP DEXCommandListParamsCommandType = "pcap"
const DEXCommandListParamsCommandTypeSpeedTest DEXCommandListParamsCommandType = "speed-test"
const DEXCommandListParamsCommandTypeWARPDiag DEXCommandListParamsCommandType = "warp-diag"
DeviceID param.Field[string]Optional

Query param: Unique identifier for a device.

From param.Field[Time]Optional

Query param: Start time for the query in ISO (RFC3339 - ISO 8601) format.

formatdate-time
Status param.Field[DEXCommandListParamsStatus]Optional

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]Optional

Query param: End time for the query in ISO (RFC3339 - ISO 8601) format.

formatdate-time
UserEmail param.Field[string]Optional

Query param: Email tied to the device.

ReturnsExpand Collapse
type DEXCommandListResponse struct{…}
Commands []DEXCommandListResponseCommandOptional
ID stringOptional
CompletedDate TimeOptional
formatdate-time
CreatedDate TimeOptional
formatdate-time
DeviceID stringOptional
Filename stringOptional
RegistrationID stringOptional

Unique identifier for the device registration

Status stringOptional
Type stringOptional
UserEmail stringOptional

List account commands

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/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(10.000000),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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
  }
}
Returns Examples
{
  "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
  }
}