items
Creates, updates, deletes, gets or lists an items resource.
Overview
| Name | items |
| Type | Resource |
| Id | cloudflare.rules.items |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a list item response.
| Name | Datatype | Description |
|---|---|---|
id | string | Defines the unique ID of the item in the List. (example: 34b12448945f11eaa1b71c4d701ab86e) |
asn | integer | Defines a non-negative 32 bit integer. |
comment | string | Defines an informative summary of the list item. (example: Private IP address) |
created_on | string | The RFC 3339 timestamp of when the list was created. (example: 2020-01-01T08:00:00Z) |
hostname | object | Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-). |
ip | string | An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. (example: 10.0.0.1) |
modified_on | string | The RFC 3339 timestamp of when the list was last modified. (example: 2020-01-10T14:00:00Z) |
redirect | object | The definition of the redirect. |
Get list items response.
| Name | Datatype | Description |
|---|---|---|
id | string | Defines the unique ID of the item in the List. (example: 34b12448945f11eaa1b71c4d701ab86e) |
asn | integer | Defines a non-negative 32 bit integer. |
comment | string | Defines an informative summary of the list item. (example: Private IP address) |
created_on | string | The RFC 3339 timestamp of when the list was created. (example: 2020-01-01T08:00:00Z) |
hostname | object | Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (*), and the hyphen (-). |
ip | string | An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. (example: 10.0.0.1) |
modified_on | string | The RFC 3339 timestamp of when the list was last modified. (example: 2020-01-10T14:00:00Z) |
redirect | object | The definition of the redirect. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | item_id, list_id, account_id | Fetches a list item in the list. | |
list | select | list_id, account_id | cursor, per_page, search | Fetches all the items in the list. |
create | insert | list_id, account_id | Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected. | |
update | replace | list_id, account_id | Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected. | |
delete | delete | list_id, account_id | Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected. |
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. |
item_id | string | |
list_id | string | |
cursor | string | |
per_page | integer | |
search | string |
SELECT examples
- get
- list
Fetches a list item in the list.
SELECT
id,
asn,
comment,
created_on,
hostname,
ip,
modified_on,
redirect
FROM cloudflare.rules.items
WHERE item_id = '{{ item_id }}' -- required
AND list_id = '{{ list_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
Fetches all the items in the list.
SELECT
id,
asn,
comment,
created_on,
hostname,
ip,
modified_on,
redirect
FROM cloudflare.rules.items
WHERE list_id = '{{ list_id }}' -- required
AND account_id = '{{ account_id }}' -- required
AND cursor = '{{ cursor }}'
AND per_page = '{{ per_page }}'
AND search = '{{ search }}'
;
INSERT examples
- create
- Manifest
Appends new items to the list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.
INSERT INTO cloudflare.rules.items (
list_id,
account_id
)
SELECT
'{{ list_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: items
props:
- name: list_id
value: "{{ list_id }}"
description: Required parameter for the items resource.
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the items resource.
REPLACE examples
- update
Removes all existing items from the list and adds the provided items to the list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.
REPLACE cloudflare.rules.items
SET
-- No updatable properties
WHERE
list_id = '{{ list_id }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Removes one or more items from a list. This operation is asynchronous. To get current the operation status, invoke the Get bulk operation status endpoint with the returned operation_id. There is a limit of 1 pending bulk operation per account. If an outstanding bulk operation is in progress, the request will be rejected.
DELETE FROM cloudflare.rules.items
WHERE list_id = '{{ list_id }}' --required
AND account_id = '{{ account_id }}' --required
;