Block List Resource
Description
This resource is for manipulating individual block list entries in a zone. To create block list entries or modify in bulk, see the Zone Block List Revision Resource
GET /block_lists/:ID
Query an individual block list entry.
GET Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the block list entry. | |
| global | No | Query Parameter | When querying the Default Zone (zone ID 0), can be set to true to return global block list entries. By default only normal block list entries will be returned | false |
GET Response Values
| Name | Type | Description |
|---|---|---|
| data | JSON String | The configuration value for this entry, based on its list type: prefix- IPv4 or v6 string, with optional CIDR mask asn- The Autonomous System Number cc- The Country Code shared- The display name of the shared list |
| list_type | JSON String | The type that is being block listed. Each block list entry will only return one of these values: prefix, asn, cc, or shared. |
| count | JSON Number | This is the number of block list prefix resources that are consumed by this block list entry. Individual prefixes will always have a count of 1. ASN, CC, or shared list entries will depend on the size of their respective entities. |
| id | JSON Number | The ID of the block list entry. Should correspond to the :ID used in the GET request. |
| zone_id | JSON Number | The ID of the zone that contains this block list entry. |
| global_list | JSON Boolean | Whether or not this entry is a global block list. Will only be returned true when specifically querying global entries against the Default Zone. |
| excepted | JSON Boolean | Whether or not this entry is a block list exception entry. |
| description | JSON String | A description for this block list entry. May contain information that alters the block list entry's behavior. See the sections on global block lists and block list exceptions for more information. |
| expiry_time | JSON String | The time this entry will expire. If "Infinity", the block list has no set expiration time. |
| block_list_resource | JSON String | The block list resource. Should correspond the resource used in the GET request. |
| zone_resource | JSON String | The zone resource for the zone that contains this block list entry. |
| customer_resource | JSON String | This value is deprecated and should not be used. |
| group_resource | JSON String | The group resource that owns the zone containing this block list entry. |
Example GET Request
GET /block_lists/1921971
Example GET Response
{
"data": "8.8.8.8/32",
"list_type": "prefix",
"count": 1,
"id": 1921971,
"zone_id": 2515,
"global_list": false,
"excepted": false,
"description": "Duplicates testing",
"expiry_time": "Infinity",
"block_list_resource": "/block_lists/1921971",
"zone_resource": "/zones/2515",
"customer_resource": "/customers/545",
"group_resource": "/groups/545"
}
PUT /block_lists/:ID
Update a block list entry. The block list entry must be part of the current zone revision in order to do this.
PUT Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the block list entry to update. | |
| data | Yes | JSON String | The configuration value for this entry, based on its list type: prefix- IPv4 or v6 string, with optional CIDR mask asn- The Autonomous System Number cc- The Country Code | |
| list_type | Yes | JSON String | The type that is being block listed. Entries can only be updated using types 'prefix', 'asn' or 'cc'. | |
| description | No | JSON String | The new description to use. | |
| expiry_time | Yes | JSON String | The new expiration time, in ISO 8601 format (UTC). If you don't want the block list to expire, use "Infinity". |
Example PUT Request
PUT /block_lists/1921971
JSON Body:
{
"data" : {
"data":"65.23.3.0/24",
"list_type":"prefix",
"description" : "Updating description with API.",
"expiry_time" : "Infinity"
}
}
Example PUT Response
HTTP/1.1 200 OK
DELETE /block_lists/:ID
Remove a block list entry. The block list entry must be part of the current zone revision in order to do this.
DELETE Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| :ID | Yes | URL Parameter | The unique numeric ID of the block list entry to be removed. |
Example DELETE Request
DELETE /block_lists/201876
Example DELETE Response
HTTP/1.1 200 OK