Skip to main content

commands

Creates, updates, deletes, gets or lists a commands resource.

Overview

Namecommands
TypeResource
Idcloudflare.zero_trust.commands

Fields

The following fields are returned by SELECT queries:

Get command artifacts response

NameDatatypeDescription
contentsstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_downloadsselectaccount_id, command_id, filenameDownloads artifacts for an executed command. Bulk downloads are not supported
listselectaccount_idpage, per_page, from, to, device_id, user_email, command_type, statusRetrieves a paginated list of commands issued to devices under the specified account, optionally filtered by time range, device, or other parameters
createinsertaccount_id, commandsInitiate 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
command_idstringUnique identifier for command
filenamestringThe name of the file to be downloaded, including the .zip extension
command_typestringOptionally filter executed commands by command type
device_idstringUnique identifier for a device
fromstring (date-time)Start time for the query in ISO (RFC3339 - ISO 8601) format
pagenumberPage number for pagination
per_pagenumberNumber of results per page
statusstringOptionally filter executed commands by status
tostring (date-time)End time for the query in ISO (RFC3339 - ISO 8601) format
user_emailstringEmail tied to the device

SELECT examples

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
;

INSERT examples

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
;