List tagged resources
resource_tagging.list(ResourceTaggingListParams**kwargs) -> SyncCursorPaginationAfter[ResourceTaggingListResponse]
GET/accounts/{account_id}/tags/resources
Lists all tagged resources for an account.
Security
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:
Parameters
Filter resources by tag criteria. This parameter can be repeated multiple times, with AND logic between parameters.
Supported syntax:
- Key-only:
tag=<key>- Resource must have the tag key (e.g.,tag=production) - Key-value:
tag=<key>=<value>- Resource must have the tag with specific value (e.g.,tag=env=prod) - Multiple values (OR):
tag=<key>=<v1>,<v2>- Resource must have tag with any of the values (e.g.,tag=env=prod,staging) - Negate key-only:
tag=!<key>- Resource must not have the tag key (e.g.,tag=!archived) - Negate key-value:
tag=<key>!=<value>- Resource must not have the tag with specific value (e.g.,tag=region!=us-west-1)
Multiple tag parameters are combined with AND logic.
List tagged resources
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_email=os.environ.get("CLOUDFLARE_EMAIL"), # This is the default and can be omitted
api_key=os.environ.get("CLOUDFLARE_API_KEY"), # This is the default and can be omitted
)
page = client.resource_tagging.list(
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"
}
}
],
"success": true,
"result": [
{
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
"name": "my-worker-script",
"tags": {
"environment": "production",
"team": "engineering"
},
"type": "access_application"
}
],
"result_info": {
"count": 20,
"cursor": "eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ"
}
}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"
}
}
],
"success": true,
"result": [
{
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"etag": "v1:RBNvo1WzZ4oRRq0W9-hkng",
"name": "my-worker-script",
"tags": {
"environment": "production",
"team": "engineering"
},
"type": "access_application"
}
],
"result_info": {
"count": 20,
"cursor": "eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ"
}
}