commands
Creates, updates, deletes, gets or lists a commands resource.
Overview
| Name | commands |
| Type | Resource |
| Id | cloudflare.zero_trust.commands |
Fields
The following fields are returned by SELECT queries:
- get_downloads
- list
Get command artifacts response
| Name | Datatype | Description |
|---|---|---|
contents | string |
Get commands response
| Name | Datatype | Description |
|---|---|---|
id | string | |
device_id | string | |
registration_id | string | Unique identifier for the device registration |
completed_date | string (date-time) | |
created_date | string (date-time) | |
filename | string | |
status | string | |
type | string | |
user_email | string |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_downloads | select | account_id, command_id, filename | Downloads artifacts for an executed command. Bulk downloads are not supported | |
list | select | account_id | page, per_page, from, to, device_id, user_email, command_type, status | Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters |
create | insert | account_id, commands | Initiate commands for up to 10 devices per account |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
command_id | string | Unique identifier for command |
filename | string | The name of the file to be downloaded, including the .zip extension |
command_type | string | Optionally filter executed commands by command type |
device_id | string | Unique identifier for a device |
from | string (date-time) | Start time for the query in ISO (RFC3339 - ISO 8601) format |
page | number | Page number for pagination |
per_page | number | Number of results per page |
status | string | Optionally filter executed commands by status |
to | string (date-time) | End time for the query in ISO (RFC3339 - ISO 8601) format |
user_email | string | Email tied to the device |
SELECT examples
- get_downloads
- list
Downloads artifacts for an executed command. Bulk downloads are not supported
SELECT
contents
FROM cloudflare.zero_trust.commands
WHERE account_id = '{{ account_id }}' -- required
AND command_id = '{{ command_id }}' -- required
AND filename = '{{ filename }}' -- required
;
Retrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters
SELECT
id,
device_id,
registration_id,
completed_date,
created_date,
filename,
status,
type,
user_email
FROM cloudflare.zero_trust.commands
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND from = '{{ from }}'
AND to = '{{ to }}'
AND device_id = '{{ device_id }}'
AND user_email = '{{ user_email }}'
AND command_type = '{{ command_type }}'
AND status = '{{ status }}'
;
INSERT examples
- create
- Manifest
Initiate commands for up to 10 devices per account
INSERT INTO cloudflare.zero_trust.commands (
commands,
account_id
)
SELECT
'{{ commands }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
result_info,
success
;
# Description fields are for documentation purposes
- name: commands
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the commands resource.
- name: commands
description: |
List of device-level commands to execute
value:
- command_args:
interfaces:
- "{{ interfaces }}"
max-file-size-mb: {{ max-file-size-mb }}
packet-size-bytes: {{ packet-size-bytes }}
test-all-routes: {{ test-all-routes }}
time-limit-min: {{ time-limit-min }}
command_type: "{{ command_type }}"
device_id: "{{ device_id }}"
registration_id: "{{ registration_id }}"
user_email: "{{ user_email }}"