Get list items
rules.lists.items.list(strlist_id, ItemListParams**kwargs) -> SyncCursorPaginationAfter[ItemListResponse]
GET/accounts/{account_id}/rules/lists/{list_id}/items
Fetches all the items in the list.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Parameters
cursor: Optional[str]
The pagination cursor. An opaque string token indicating the position from which to continue when requesting the next/previous set of records. Cursor values are provided under result_info.cursors in the response. You should make no assumptions about a cursor's content or length.
Get list items
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
page = client.rules.lists.items.list(
list_id="2c0fc9fa937b11eaa1b71c4d701ab86e",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page){
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "34b12448945f11eaa1b71c4d701ab86e",
"created_on": "2020-01-01T08:00:00Z",
"ip": "10.0.0.1",
"modified_on": "2020-01-10T14:00:00Z",
"comment": "Private IP address"
}
],
"success": true,
"result_info": {
"cursors": {
"after": "yyy",
"before": "xxx"
}
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"id": "34b12448945f11eaa1b71c4d701ab86e",
"created_on": "2020-01-01T08:00:00Z",
"ip": "10.0.0.1",
"modified_on": "2020-01-10T14:00:00Z",
"comment": "Private IP address"
}
],
"success": true,
"result_info": {
"cursors": {
"after": "yyy",
"before": "xxx"
}
}
}