Skip to main content

byoip_prefixes

Creates, updates, deletes, gets or lists a byoip_prefixes resource.

Overview

Namebyoip_prefixes
TypeResource
Iddigitalocean.network.byoip_prefixes

Fields

The following fields are returned by SELECT queries:

Details of the requested BYOIP prefix

NameDatatypeDescription
namestringName of the BYOIP prefix (example: )
project_idstringThe ID of the project associated with the BYOIP prefix (example: 12345678-1234-1234-1234-123456789012)
advertisedbooleanWhether the BYOIP prefix is being advertised
failure_reasonstringReason for failure, if applicable (example: )
lockedbooleanWhether the BYOIP prefix is locked
prefixstringThe IP prefix in CIDR notation (example: 203.0.113.0/24)
regionstringRegion where the BYOIP prefix is located (example: nyc3)
statusstringStatus of the BYOIP prefix (example: active)
uuidstringUnique identifier for the BYOIP prefix (example: f47ac10b-58cc-4372-a567-0e02b2c3d479)
validationsarrayList of validation statuses for the BYOIP prefix

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
byoip_prefixes_getselectbyoip_prefix_uuidTo get a BYOIP prefix, send a GET request to /v2/byoip_prefixes/$byoip_prefix_uuid.

A successful response will return the details of the specified BYOIP prefix.
byoip_prefixes_listselectper_page, pageTo list all BYOIP prefixes, send a GET request to /v2/byoip_prefixes.
A successful response will return a list of all BYOIP prefixes associated with the account.
byoip_prefixes_createinsertdata__prefix, data__region, data__signatureTo create a BYOIP prefix, send a POST request to /v2/byoip_prefixes.

A successful request will initiate the process of bringing your BYOIP Prefix into your account.
The response will include the details of the created prefix, including its UUID and status.
byoip_prefixes_patchupdatebyoip_prefix_uuidTo update a BYOIP prefix, send a PATCH request to /v2/byoip_prefixes/$byoip_prefix_uuid.

Currently, you can update the advertisement status of the prefix.
The response will include the updated details of the prefix.
byoip_prefixes_deletedeletebyoip_prefix_uuidTo delete a BYOIP prefix and remove it from your account, send a DELETE request
to /v2/byoip_prefixes/$byoip_prefix_uuid.

A successful request will receive a 202 status code with no body in response.
This indicates that the request was accepted and the prefix is being deleted.

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.

NameDatatypeDescription
byoip_prefix_uuidstring (uuid)The unique identifier for the BYOIP Prefix. (example: f47ac10b-58cc-4372-a567-0e02b2c3d479)
pageintegerWhich 'page' of paginated results to return. (example: 1)
per_pageintegerNumber of items returned per page (example: 2)

SELECT examples

To get a BYOIP prefix, send a GET request to /v2/byoip_prefixes/$byoip_prefix_uuid.

A successful response will return the details of the specified BYOIP prefix.

SELECT
name,
project_id,
advertised,
failure_reason,
locked,
prefix,
region,
status,
uuid,
validations
FROM digitalocean.network.byoip_prefixes
WHERE byoip_prefix_uuid = '{{ byoip_prefix_uuid }}' -- required;

INSERT examples

To create a BYOIP prefix, send a POST request to /v2/byoip_prefixes.

A successful request will initiate the process of bringing your BYOIP Prefix into your account.
The response will include the details of the created prefix, including its UUID and status.

INSERT INTO digitalocean.network.byoip_prefixes (
data__prefix,
data__region,
data__signature
)
SELECT
'{{ prefix }}' --required,
'{{ region }}' --required,
'{{ signature }}' --required
RETURNING
region,
status,
uuid
;

UPDATE examples

To update a BYOIP prefix, send a PATCH request to /v2/byoip_prefixes/$byoip_prefix_uuid.

Currently, you can update the advertisement status of the prefix.
The response will include the updated details of the prefix.

UPDATE digitalocean.network.byoip_prefixes
SET
data__advertise = {{ advertise }}
WHERE
byoip_prefix_uuid = '{{ byoip_prefix_uuid }}' --required
RETURNING
byoip_prefix;

DELETE examples

To delete a BYOIP prefix and remove it from your account, send a DELETE request
to /v2/byoip_prefixes/$byoip_prefix_uuid.

A successful request will receive a 202 status code with no body in response.
This indicates that the request was accepted and the prefix is being deleted.

DELETE FROM digitalocean.network.byoip_prefixes
WHERE byoip_prefix_uuid = '{{ byoip_prefix_uuid }}' --required;