Skip to main content

target_environments

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

Overview

Nametarget_environments
TypeResource
Idcloudflare.vulnerability_scanner.target_environments

Fields

The following fields are returned by SELECT queries:

Successful response.

NameDatatypeDescription
idstring (uuid)Target environment identifier.
namestringHuman-readable name. (example: Production Zone)
descriptionstringOptional description providing additional context. (example: Main production environment)
targetobjectIdentifies the Cloudflare asset to scan. Uses a type discriminator. Currently the service supports only zone targets.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, target_environment_idReturns a single target environment by ID.
listselectaccount_idpage, per_pageReturns all target environments for the account.
createinsertaccount_id, name, targetCreates a new target environment for the account.
editupdateaccount_id, target_environment_idUpdates a target environment with only the provided fields; omitted fields remain unchanged.
updatereplaceaccount_id, target_environment_id, name, targetReplaces a target environment. All fields must be provided.
deletedeleteaccount_id, target_environment_idRemoves a target environment.

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_environment_idstring (uuid)Target environment identifier.
pageintegerPage number of paginated results.
per_pageintegerNumber of results per page.

SELECT examples

Returns a single target environment by ID.

SELECT
id,
name,
description,
target
FROM cloudflare.vulnerability_scanner.target_environments
WHERE account_id = '{{ account_id }}' -- required
AND target_environment_id = '{{ target_environment_id }}' -- required
;

INSERT examples

Creates a new target environment for the account.

INSERT INTO cloudflare.vulnerability_scanner.target_environments (
description,
name,
target,
account_id
)
SELECT
'{{ description }}',
'{{ name }}' /* required */,
'{{ target }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
result_info,
success
;

UPDATE examples

Updates a target environment with only the provided fields; omitted fields remain unchanged.

UPDATE cloudflare.vulnerability_scanner.target_environments
SET
description = '{{ description }}',
name = '{{ name }}',
target = '{{ target }}'
WHERE
account_id = '{{ account_id }}' --required
AND target_environment_id = '{{ target_environment_id }}' --required
RETURNING
errors,
messages,
result,
result_info,
success;

REPLACE examples

Replaces a target environment. All fields must be provided.

REPLACE cloudflare.vulnerability_scanner.target_environments
SET
description = '{{ description }}',
name = '{{ name }}',
target = '{{ target }}'
WHERE
account_id = '{{ account_id }}' --required
AND target_environment_id = '{{ target_environment_id }}' --required
AND name = '{{ name }}' --required
AND target = '{{ target }}' --required
RETURNING
errors,
messages,
result,
result_info,
success;

DELETE examples

Removes a target environment.

DELETE FROM cloudflare.vulnerability_scanner.target_environments
WHERE account_id = '{{ account_id }}' --required
AND target_environment_id = '{{ target_environment_id }}' --required
;