# Data Localization Suite # Regions ## List DLS regions for an account `dls.regions.list(RegionListParams**kwargs) -> SyncCursorPagination[RegionListResponse]` **get** `/accounts/{account_id}/dls/regions` List DLS regions for an account ### Parameters - `account_id: int` - `cursor: Optional[str]` Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page. - `per_page: Optional[int]` - `type: Optional[Literal["managed", "custom"]]` Filter regions by type. Omit to return all regions. - `"managed"` - `"custom"` ### Returns - `class RegionListResponse: …` - `id: str` - `created_on: datetime` - `modified_on: datetime` - `name: str` - `region_key: str` - `version: int` - `version_created_on: datetime` ### Example ```python 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.dls.regions.list( account_id=0, ) page = page.result[0] print(page.id) ``` #### Response ```json { "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": "id", "created_on": "2019-12-27T18:11:19.117Z", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "region_key": "x", "version": 0, "version_created_on": "2019-12-27T18:11:19.117Z" } ], "result_info": { "count": 0, "cursor": "cursor", "per_page": 0 }, "success": true } ``` ## Get a DLS region `dls.regions.get(strregion_id, RegionGetParams**kwargs) -> RegionGetResponse` **get** `/accounts/{account_id}/dls/regions/{region_id}` Get a DLS region ### Parameters - `account_id: int` - `region_id: str` UUID of the region (custom or managed) or region_key of a managed region. ### Returns - `class RegionGetResponse: …` - `id: str` - `created_on: datetime` - `modified_on: datetime` - `name: str` - `region_key: str` - `version: int` - `version_created_on: datetime` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) region = client.dls.regions.get( region_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", account_id=0, ) print(region.id) ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "id", "created_on": "2019-12-27T18:11:19.117Z", "modified_on": "2019-12-27T18:11:19.117Z", "name": "name", "region_key": "x", "version": 0, "version_created_on": "2019-12-27T18:11:19.117Z" }, "success": true, "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ] } ``` ## Domain Types ### Region List Response - `class RegionListResponse: …` - `id: str` - `created_on: datetime` - `modified_on: datetime` - `name: str` - `region_key: str` - `version: int` - `version_created_on: datetime` ### Region Get Response - `class RegionGetResponse: …` - `id: str` - `created_on: datetime` - `modified_on: datetime` - `name: str` - `region_key: str` - `version: int` - `version_created_on: datetime` # Regional Services # Prefix Bindings ## List DLS prefix bindings for an account `dls.regional_services.prefix_bindings.list(PrefixBindingListParams**kwargs) -> SyncCursorPagination[PrefixBindingListResponse]` **get** `/accounts/{account_id}/dls/regional_services/prefix_bindings` List DLS prefix bindings for an account ### Parameters - `account_id: int` - `cursor: Optional[str]` Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page. - `per_page: Optional[int]` ### Returns - `class PrefixBindingListResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Example ```python 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.dls.regional_services.prefix_bindings.list( account_id=0, ) page = page.result[0] print(page.id) ``` #### Response ```json { "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": "id", "cidr": "cidr", "prefix_id": "prefix_id", "region_key": "x" } ], "result_info": { "count": 0, "cursor": "cursor", "per_page": 0 }, "success": true } ``` ## Get a DLS prefix binding `dls.regional_services.prefix_bindings.get(strbinding_id, PrefixBindingGetParams**kwargs) -> PrefixBindingGetResponse` **get** `/accounts/{account_id}/dls/regional_services/prefix_bindings/{binding_id}` Get a DLS prefix binding ### Parameters - `account_id: int` - `binding_id: str` Unique identifier for the prefix binding. ### Returns - `class PrefixBindingGetResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) prefix_binding = client.dls.regional_services.prefix_bindings.get( binding_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", account_id=0, ) print(prefix_binding.id) ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "id", "cidr": "cidr", "prefix_id": "prefix_id", "region_key": "x" }, "success": true, "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ] } ``` ## Create a DLS prefix binding `dls.regional_services.prefix_bindings.create(PrefixBindingCreateParams**kwargs) -> PrefixBindingCreateResponse` **post** `/accounts/{account_id}/dls/regional_services/prefix_bindings` Create a DLS prefix binding ### Parameters - `account_id: int` - `cidr: str` IP prefix in CIDR notation to bind. - `prefix_id: str` The ID of the parent IP prefix that contains the CIDR. - `region_key: str` Region key from managed regions (e.g., "us", "eu"). ### Returns - `class PrefixBindingCreateResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) prefix_binding = client.dls.regional_services.prefix_bindings.create( account_id=0, cidr="10.0.1.0/24", prefix_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", region_key="eu", ) print(prefix_binding.id) ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "id", "cidr": "cidr", "prefix_id": "prefix_id", "region_key": "x" }, "success": true, "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ] } ``` ## Update a DLS prefix binding `dls.regional_services.prefix_bindings.edit(strbinding_id, PrefixBindingEditParams**kwargs) -> PrefixBindingEditResponse` **patch** `/accounts/{account_id}/dls/regional_services/prefix_bindings/{binding_id}` Update a DLS prefix binding ### Parameters - `account_id: int` - `binding_id: str` Unique identifier for the prefix binding. - `region_key: str` New region key to assign (e.g., "us", "eu", "cfcanary"). ### Returns - `class PrefixBindingEditResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) response = client.dls.regional_services.prefix_bindings.edit( binding_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", account_id=0, region_key="eu", ) print(response.id) ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "id", "cidr": "cidr", "prefix_id": "prefix_id", "region_key": "x" }, "success": true, "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ] } ``` ## Delete a DLS prefix binding `dls.regional_services.prefix_bindings.delete(strbinding_id, PrefixBindingDeleteParams**kwargs) -> PrefixBindingDeleteResponse` **delete** `/accounts/{account_id}/dls/regional_services/prefix_bindings/{binding_id}` Delete a DLS prefix binding ### Parameters - `account_id: int` - `binding_id: str` Unique identifier for the prefix binding. ### Returns - `class PrefixBindingDeleteResponse: …` - `messages: List[ResponseInfo]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[Source]` - `pointer: Optional[str]` - `success: bool` - `errors: Optional[List[ResponseInfo]]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[Source]` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) prefix_binding = client.dls.regional_services.prefix_bindings.delete( binding_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", account_id=0, ) print(prefix_binding.messages) ``` #### Response ```json { "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ] } ``` ## Domain Types ### Prefix Binding List Response - `class PrefixBindingListResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Prefix Binding Get Response - `class PrefixBindingGetResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Prefix Binding Create Response - `class PrefixBindingCreateResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Prefix Binding Edit Response - `class PrefixBindingEditResponse: …` - `id: str` The ID of the binding. - `cidr: str` The CIDR that is bound. - `prefix_id: str` The ID of the parent prefix. - `region_key: str` The region key used for the binding. ### Prefix Binding Delete Response - `class PrefixBindingDeleteResponse: …` - `messages: List[ResponseInfo]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[Source]` - `pointer: Optional[str]` - `success: bool` - `errors: Optional[List[ResponseInfo]]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[Source]`