Skip to main content

targets

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

Overview

Nametargets
TypeResource
Idcloudflare.zero_trust.targets

Fields

The following fields are returned by SELECT queries:

Successfully retrieved the target

NameDatatypeDescription
idstring (uuid)Target identifier (title: target_id)
created_atstring (date-time)Date and time at which the target was created (example: 2019-08-24T14:15:22Z)
hostnamestringA non-unique field that refers to a target (example: infra-access-target)
ipobjectThe IPv4/IPv6 address that identifies where to reach a target
modified_atstring (date-time)Date and time at which the target was modified (example: 2019-08-24T14:15:22Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, target_id
listselectaccount_idhostname, hostname_contains, virtual_network_id, ip_v4, ip_v6, created_before, created_after, modified_before, modified_after, ips, target_ids, ip_like, ipv4_start, ipv4_end, ipv6_start, ipv6_end, page, per_page, order, directionLists and sorts an account’s targets. Filters are optional and are ANDed together.
updatereplaceaccount_id, target_id, hostname, ip
deletedeleteaccount_id, target_id
bulk_deletedeleteaccount_idRemoves one or more targets.
batchexecaccount_idAdds one or more targets.
batch_deleteexecaccount_id, target_idsRemoves one or more targets.

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.
target_idstring (uuid)
created_afterstring (date-time)Date and time at which the target was created after (inclusive)
created_beforestring (date-time)Date and time at which the target was created before (inclusive)
directionstringThe sorting direction.
hostnamestringHostname of a target
hostname_containsstringPartial match to the hostname of a target
ip_likestringFilters for targets whose IP addresses look like the specified string. Supports * as a wildcard character
ip_v4stringIPv4 address of the target
ip_v6stringIPv6 address of the target
ipsarrayFilters for targets that have any of the following IP addresses. Specify ips multiple times in query parameter to build list of candidates.
ipv4_endstringDefines an IPv4 filter range's ending value (inclusive). Requires ipv4_start to be specified as well.
ipv4_startstringDefines an IPv4 filter range's starting value (inclusive). Requires ipv4_end to be specified as well.
ipv6_endstringDefines an IPv6 filter range's ending value (inclusive). Requires ipv6_start to be specified as well.
ipv6_startstringDefines an IPv6 filter range's starting value (inclusive). Requires ipv6_end to be specified as well.
modified_afterstring (date-time)Date and time at which the target was modified after (inclusive)
modified_beforestring (date-time)Date and time at which the target was modified before (inclusive)
orderstringThe field to sort by.
pageinteger (int32)Current page in the response
per_pageinteger (int32)Max amount of entries returned per page
target_idsarrayFilters for targets that have any of the following UUIDs. Specify target_ids multiple times in query parameter to build list of candidates.
virtual_network_idstring (uuid)Private virtual network identifier of the target

SELECT examples

Successfully retrieved the target

SELECT
id,
created_at,
hostname,
ip,
modified_at
FROM cloudflare.zero_trust.targets
WHERE account_id = '{{ account_id }}' -- required
AND target_id = '{{ target_id }}' -- required
;

REPLACE examples

No description available.

REPLACE cloudflare.zero_trust.targets
SET
hostname = '{{ hostname }}',
ip = '{{ ip }}'
WHERE
account_id = '{{ account_id }}' --required
AND target_id = '{{ target_id }}' --required
AND hostname = '{{ hostname }}' --required
AND ip = '{{ ip }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

No description available.

DELETE FROM cloudflare.zero_trust.targets
WHERE account_id = '{{ account_id }}' --required
AND target_id = '{{ target_id }}' --required
;

Lifecycle Methods

Adds one or more targets.

EXEC cloudflare.zero_trust.targets.batch
@account_id='{{ account_id }}' --required
;