policy_tests
Creates, updates, deletes, gets or lists a policy_tests resource.
Overview
| Name | policy_tests |
| Type | Resource |
| Id | cloudflare.zero_trust.policy_tests |
Fields
The following fields are returned by SELECT queries:
- get
Get an Access policy test update response.
| Name | Datatype | Description |
|---|---|---|
id | string | The UUID of the policy test. (example: f1a8b3c9d4e5f6789a0b1c2d3e4f5678a9b0c1d2e3f4a5b67890c1d2e3f4b5a6) |
percent_approved | integer | The percentage of (processed) users approved based on policy evaluation results. |
percent_blocked | integer | The percentage of (processed) users blocked based on policy evaluation results. |
percent_errored | integer | The percentage of (processed) users errored based on policy evaluation results. |
percent_users_processed | integer | The percentage of users processed so far (of the entire user base). |
status | string | The status of the policy test. (blocked, processing, exceeded time, complete) (example: complete) |
total_users | integer | The total number of users in the user base. |
users_approved | integer | The number of (processed) users approved based on policy evaluation results. |
users_blocked | integer | The number of (processed) users blocked based on policy evaluation results. |
users_errored | integer | The number of (processed) users errored based on policy evaluation results. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, policy_test_id | Fetches the current status of a given Access policy test. | |
create | insert | account_id | Starts an Access policy test. |
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. |
policy_test_id | string |
SELECT examples
- get
Fetches the current status of a given Access policy test.
SELECT
id,
percent_approved,
percent_blocked,
percent_errored,
percent_users_processed,
status,
total_users,
users_approved,
users_blocked,
users_errored
FROM cloudflare.zero_trust.policy_tests
WHERE account_id = '{{ account_id }}' -- required
AND policy_test_id = '{{ policy_test_id }}' -- required
;
INSERT examples
- create
- Manifest
Starts an Access policy test.
INSERT INTO cloudflare.zero_trust.policy_tests (
policies,
account_id
)
SELECT
'{{ policies }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: policy_tests
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the policy_tests resource.
- name: policies
value:
- approval_groups: "{{ approval_groups }}"
approval_required: {{ approval_required }}
connection_rules:
rdp:
allowed_clipboard_local_to_remote_formats:
- "{{ allowed_clipboard_local_to_remote_formats }}"
allowed_clipboard_remote_to_local_formats:
- "{{ allowed_clipboard_remote_to_local_formats }}"
isolation_required: {{ isolation_required }}
mfa_config:
allowed_authenticators:
- "{{ allowed_authenticators }}"
mfa_disabled: {{ mfa_disabled }}
session_duration: "{{ session_duration }}"
purpose_justification_prompt: "{{ purpose_justification_prompt }}"
purpose_justification_required: {{ purpose_justification_required }}
session_duration: "{{ session_duration }}"
decision: "{{ decision }}"
exclude: "{{ exclude }}"
include: "{{ include }}"
name: "{{ name }}"
require: "{{ require }}"