Skip to main content
Version: 10.0

Zone Block List Revision Resource

Description​

This resource is for manipulating zone block list entries by revision number. Any changes made to a zone's block list configuration increment the revision number. You can check the current revision of a zone with the current revision resource.

GET /zones/:ZONEID/revisions/:REVISIONID/block_lists​

Query all the block list entries for a zone at a particular revision. This is a paged query that uses the "sort_list" functionality.

GET Parameters​

NameRequiredTypeDescriptionDefault Value
:ZONEIDYesURL ParameterThe unique numeric ID of the zone.
:REVISIONIDYesURL ParameterThe revision number of the block list set.
qNoQuery ParameterFilter returned entries in the revision by their ip, asn, cc or description
expiry_timeNoQuery ParameterMust be in ISO 8601 format (UTC). If present, return only entries that expire at or before this time.

GET Response Values​

Each element in the data array will be an object representation of the block list resource that is used in the zone. In addition to this and the paged query elements, it will return "total_subnet_count", which is the total number of block list prefix resources that are consumed by all entries.

Example GET Request​

GET /zones/2031/revisions/22/block_lists

Example GET Response​

{
"data": [
{
"data": "120.40.60.0/24",
"list_type": "prefix",
"count": 1,
"id": 1922038,
"zone_id": 2031,
"description": "Bad actor test",
"expiry_time": "Infinity",
"block_list_resource": "/block_lists/1922038",
"zone_resource": "/zones/2031",
"customer_resource": "/customers/279",
"group_resource": "/groups/279"
}
],
"rows": 1,
"total_subnet_count": 1
}

POST /zones/:ZONEID/revisions/:REVISIONID/block_lists​

Create a new set of block list entries to use in the zone. Any entries created will be in addition to existing block list entries in the zone. The POST will only be accepted if the :REVISIONID is the current block list revision for the zone.

If more than 20 entries are being created at one time, this will be run as a "bulk import" background job. For consistency, the imported parameter can be used to force this behavior even when inserting 20 or less entries.

POST Parameters​

NameRequiredTypeDescriptionDefault Value
:ZONEIDYesURL ParameterThe unique numeric ID of the zone you want to add block list entries.
:REVISIONIDYesURL ParameterThe revision number of the block list set. In order to successfully perform the POST, this must be the zone's current block list revision number.
importedNoJSON BooleanIf present, always run this create as a background job.
arrayYesJSON ArrayAn array containing an object for each individual block list you want to add. The following entries in this table detail the block list object, see also the requirements to update an individual block list entry.
dataYesJSON StringThe 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_typeYesJSON StringThe type that is being block listed. Entries can only be created using one of these values: 'prefix', 'asn', or 'cc'.
descriptionNoJSON StringAn optional description to use.
expiry_timeNoJSON StringThe expiration time, in ISO 8601 format (UTC). If you don't want the block list to expire, use "Infinity"."Infinity"
global_listNoJSON BooleanIf and only if :ZONEID is 0 (the Default Zone) and the user has the correct permissions, you can set this to true to make this a Global Block List entry.false

Example POST Request​

POST /zones/2031/revisions/22/block_lists

JSON Body:
{
"data": {
"array": [
{
"data": "AS7922",
"list_type": "asn",
"expiry_time": "2019-06-30T12:00:00.000Z",
"description": "API block listing"
},
{
"data": "165.39.48.6/30",
"list_type": "prefix",
"expiry_time": "2019-06-30T12:00:00.000Z",
"description": "API block listing"
}
]
}
}

Example POST Response​

 HTTP/1.1 201 Created

DELETE /zones/:ZONEID/revisions/:REVISIONID/block_lists​

Remove block list entries from the zone. If using the query parameter, this will only delete entries that match the query, otherwise all entries will be removed.

DELETE Parameters​

NameRequiredTypeDescriptionDefault Value
:ZONEIDYesURL ParameterThe unique numeric ID of the zone.
:REVISIONIDYesURL ParameterThe revision number of the block list set. In order to successfully perform the DELETE, this must be the zone's current block list revision number.
qNoQuery ParameterDelete entries in the revision by matching "ip", "asn", "cc" or "description".
expiry_timeNoQuery ParameterAs of rWeb 9.7.0. Must be in ISO 8601 format (UTC). If present, delete only entries that expire at or before this time.

Example DELETE Request​

 DELETE /zones/2031/revisions/23/block_lists

Example DELETE Response​

 HTTP/1.1 200 OK