# Tunnels ## List All Tunnels `zero_trust.tunnels.list(TunnelListParams**kwargs) -> SyncV4PagePaginationArray[TunnelListResponse]` **get** `/accounts/{account_id}/tunnels` Lists and filters all types of Tunnels in an account. ### Parameters - `account_id: str` Cloudflare account ID - `exclude_prefix: Optional[str]` - `existed_at: Optional[str]` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix: Optional[str]` - `is_deleted: Optional[bool]` If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name: Optional[str]` A user-friendly name for the tunnel. - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Number of results to display. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_types: Optional[List[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]]` The types of tunnels to filter by, separated by commas. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `uuid: Optional[str]` UUID of the tunnel. - `was_active_at: Optional[Union[str, datetime]]` - `was_inactive_at: Optional[Union[str, datetime]]` ### Returns - `TunnelListResponse` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `class TunnelWARPConnectorTunnel: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[TunnelWARPConnectorTunnelConnection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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.zero_trust.tunnels.list( account_id="699d98642c564d2e855e9661899b7252", ) page = page.result[0] print(page) ``` #### 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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Connection - `class Connection: …` - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. ### Tunnel List Response - `TunnelListResponse` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` - `class TunnelWARPConnectorTunnel: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[TunnelWARPConnectorTunnelConnection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` # Cloudflared ## List Cloudflare Tunnels `zero_trust.tunnels.cloudflared.list(CloudflaredListParams**kwargs) -> SyncV4PagePaginationArray[CloudflareTunnel]` **get** `/accounts/{account_id}/cfd_tunnel` Lists and filters Cloudflare Tunnels in an account. ### Parameters - `account_id: str` Cloudflare account ID - `exclude_prefix: Optional[str]` - `existed_at: Optional[str]` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix: Optional[str]` - `is_deleted: Optional[bool]` If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name: Optional[str]` A user-friendly name for a tunnel. - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Number of results to display. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `uuid: Optional[str]` UUID of the tunnel. - `was_active_at: Optional[Union[str, datetime]]` - `was_inactive_at: Optional[Union[str, datetime]]` ### Returns - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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.zero_trust.tunnels.cloudflared.list( account_id="699d98642c564d2e855e9661899b7252", ) 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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a Cloudflare Tunnel `zero_trust.tunnels.cloudflared.get(strtunnel_id, CloudflaredGetParams**kwargs) -> CloudflareTunnel` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Fetches a single Cloudflare Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) cloudflare_tunnel = client.zero_trust.tunnels.cloudflared.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(cloudflare_tunnel.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Create a Cloudflare Tunnel `zero_trust.tunnels.cloudflared.create(CloudflaredCreateParams**kwargs) -> CloudflareTunnel` **post** `/accounts/{account_id}/cfd_tunnel` Creates a new Cloudflare Tunnel in an account. ### Parameters - `account_id: str` Cloudflare account ID - `name: str` A user-friendly name for a tunnel. - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_secret: Optional[str]` Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) cloudflare_tunnel = client.zero_trust.tunnels.cloudflared.create( account_id="699d98642c564d2e855e9661899b7252", name="blog", ) print(cloudflare_tunnel.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Update a Cloudflare Tunnel `zero_trust.tunnels.cloudflared.edit(strtunnel_id, CloudflaredEditParams**kwargs) -> CloudflareTunnel` **patch** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Updates an existing Cloudflare Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `tunnel_secret: Optional[str]` Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) cloudflare_tunnel = client.zero_trust.tunnels.cloudflared.edit( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(cloudflare_tunnel.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Delete a Cloudflare Tunnel `zero_trust.tunnels.cloudflared.delete(strtunnel_id, CloudflaredDeleteParams**kwargs) -> CloudflareTunnel` **delete** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}` Deletes a Cloudflare Tunnel from an account. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class CloudflareTunnel: …` A Cloudflare Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `config_src: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `remote_config: Optional[bool]` If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. If `false`, the tunnel must be configured locally on the origin machine. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) cloudflare_tunnel = client.zero_trust.tunnels.cloudflared.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(cloudflare_tunnel.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "config_src": "cloudflare", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "remote_config": true, "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` # Configurations ## Get configuration `zero_trust.tunnels.cloudflared.configurations.get(strtunnel_id, ConfigurationGetParams**kwargs) -> ConfigurationGetResponse` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations` Gets the configuration for a remotely-managed tunnel ### Parameters - `account_id: str` Identifier. - `tunnel_id: str` UUID of the tunnel. ### Returns - `class ConfigurationGetResponse: …` Cloudflare Tunnel configuration - `account_id: Optional[str]` Identifier. - `config: Optional[Config]` The tunnel configuration and ingress rules. - `ingress: Optional[List[ConfigIngress]]` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: str` Public hostname for this service. - `service: str` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `origin_request: Optional[ConfigIngressOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigIngressOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path: Optional[str]` Requests with this path route to this public hostname. - `origin_request: Optional[ConfigOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at: Optional[datetime]` - `source: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id: Optional[str]` UUID of the tunnel. - `version: Optional[int]` The version of the Tunnel Configuration. ### 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 ) configuration = client.zero_trust.tunnels.cloudflared.configurations.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(configuration.account_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" } } ], "success": true, "result": { "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "config": { "ingress": [ { "hostname": "tunnel.example.com", "service": "https://localhost:8001", "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "path": "subpath" } ], "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "warp-routing": { "enabled": true } }, "created_at": "2014-01-01T05:20:00.12345Z", "source": "cloudflare", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "version": 0 } } ``` ## Put configuration `zero_trust.tunnels.cloudflared.configurations.update(strtunnel_id, ConfigurationUpdateParams**kwargs) -> ConfigurationUpdateResponse` **put** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/configurations` Adds or updates the configuration for a remotely-managed tunnel. ### Parameters - `account_id: str` Identifier. - `tunnel_id: str` UUID of the tunnel. - `config: Optional[Config]` The tunnel configuration and ingress rules. - `ingress: Optional[Iterable[ConfigIngress]]` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: str` Public hostname for this service. - `service: str` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `origin_request: Optional[ConfigIngressOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigIngressOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: SequenceNotStr[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path: Optional[str]` Requests with this path route to this public hostname. - `origin_request: Optional[ConfigOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: SequenceNotStr[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. ### Returns - `class ConfigurationUpdateResponse: …` Cloudflare Tunnel configuration - `account_id: Optional[str]` Identifier. - `config: Optional[Config]` The tunnel configuration and ingress rules. - `ingress: Optional[List[ConfigIngress]]` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: str` Public hostname for this service. - `service: str` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `origin_request: Optional[ConfigIngressOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigIngressOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path: Optional[str]` Requests with this path route to this public hostname. - `origin_request: Optional[ConfigOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at: Optional[datetime]` - `source: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id: Optional[str]` UUID of the tunnel. - `version: Optional[int]` The version of the Tunnel Configuration. ### 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 ) configuration = client.zero_trust.tunnels.cloudflared.configurations.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(configuration.account_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" } } ], "success": true, "result": { "account_id": "023e105f4ecef8ad9ca31a8372d0c353", "config": { "ingress": [ { "hostname": "tunnel.example.com", "service": "https://localhost:8001", "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "path": "subpath" } ], "originRequest": { "access": { "audTag": [ "string" ], "teamName": "zero-trust-organization-name", "required": false }, "caPool": "caPool", "connectTimeout": 10, "disableChunkedEncoding": true, "http2Origin": true, "httpHostHeader": "httpHostHeader", "keepAliveConnections": 100, "keepAliveTimeout": 90, "matchSNItoHost": false, "noHappyEyeballs": false, "noTLSVerify": false, "originServerName": "originServerName", "proxyType": "proxyType", "tcpKeepAlive": 30, "tlsTimeout": 10 }, "warp-routing": { "enabled": true } }, "created_at": "2014-01-01T05:20:00.12345Z", "source": "cloudflare", "tunnel_id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "version": 0 } } ``` ## Domain Types ### Configuration Get Response - `class ConfigurationGetResponse: …` Cloudflare Tunnel configuration - `account_id: Optional[str]` Identifier. - `config: Optional[Config]` The tunnel configuration and ingress rules. - `ingress: Optional[List[ConfigIngress]]` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: str` Public hostname for this service. - `service: str` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `origin_request: Optional[ConfigIngressOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigIngressOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path: Optional[str]` Requests with this path route to this public hostname. - `origin_request: Optional[ConfigOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at: Optional[datetime]` - `source: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id: Optional[str]` UUID of the tunnel. - `version: Optional[int]` The version of the Tunnel Configuration. ### Configuration Update Response - `class ConfigurationUpdateResponse: …` Cloudflare Tunnel configuration - `account_id: Optional[str]` Identifier. - `config: Optional[Config]` The tunnel configuration and ingress rules. - `ingress: Optional[List[ConfigIngress]]` List of public hostname definitions. At least one ingress rule needs to be defined for the tunnel. - `hostname: str` Public hostname for this service. - `service: str` Protocol and address of destination server. Supported protocols: http://, https://, unix://, tcp://, ssh://, rdp://, unix+tls://, smb://. Alternatively can return a HTTP status code http_status:[code] e.g. 'http_status:404'. - `origin_request: Optional[ConfigIngressOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigIngressOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `path: Optional[str]` Requests with this path route to this public hostname. - `origin_request: Optional[ConfigOriginRequest]` Configuration parameters for the public hostname specific connection settings between cloudflared and origin server. - `access: Optional[ConfigOriginRequestAccess]` For all L7 requests to this hostname, cloudflared will validate each request's Cf-Access-Jwt-Assertion request header. - `aud_tag: List[str]` Access applications that are allowed to reach this hostname for this Tunnel. Audience tags can be identified in the dashboard or via the List Access policies API. - `team_name: str` - `required: Optional[bool]` Deny traffic that has not fulfilled Access authorization. - `ca_pool: Optional[str]` Path to the certificate authority (CA) for the certificate of your origin. This option should be used only if your certificate is not signed by Cloudflare. - `connect_timeout: Optional[int]` Timeout for establishing a new TCP connection to your origin server. This excludes the time taken to establish TLS, which is controlled by tlsTimeout. - `disable_chunked_encoding: Optional[bool]` Disables chunked transfer encoding. Useful if you are running a WSGI server. - `http2_origin: Optional[bool]` Attempt to connect to origin using HTTP2. Origin must be configured as https. - `http_host_header: Optional[str]` Sets the HTTP Host header on requests sent to the local service. - `keep_alive_connections: Optional[int]` Maximum number of idle keepalive connections between Tunnel and your origin. This does not restrict the total number of concurrent connections. - `keep_alive_timeout: Optional[int]` Timeout after which an idle keepalive connection can be discarded. - `match_sn_ito_host: Optional[bool]` Auto configure the Hostname on the origin server certificate. - `no_happy_eyeballs: Optional[bool]` Disable the “happy eyeballs” algorithm for IPv4/IPv6 fallback if your local network has misconfigured one of the protocols. - `no_tls_verify: Optional[bool]` Disables TLS verification of the certificate presented by your origin. Will allow any certificate from the origin to be accepted. - `origin_server_name: Optional[str]` Hostname that cloudflared should expect from your origin server certificate. - `proxy_type: Optional[str]` cloudflared starts a proxy server to translate HTTP traffic into TCP when proxying, for example, SSH or RDP. This configures what type of proxy will be started. Valid options are: "" for the regular proxy and "socks" for a SOCKS5 proxy. - `tcp_keep_alive: Optional[int]` The timeout after which a TCP keepalive packet is sent on a connection between Tunnel and the origin server. - `tls_timeout: Optional[int]` Timeout for completing a TLS handshake to your origin server, if you have chosen to connect Tunnel to an HTTPS server. - `created_at: Optional[datetime]` - `source: Optional[Literal["local", "cloudflare"]]` Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel's configuration on the Zero Trust dashboard. - `"local"` - `"cloudflare"` - `tunnel_id: Optional[str]` UUID of the tunnel. - `version: Optional[int]` The version of the Tunnel Configuration. # Connections ## List Cloudflare Tunnel connections `zero_trust.tunnels.cloudflared.connections.get(strtunnel_id, ConnectionGetParams**kwargs) -> SyncSinglePage[Client]` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections` Fetches connection details for a Cloudflare Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class Client: …` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `config_version: Optional[int]` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns: Optional[List[Conn]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. ### 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.zero_trust.tunnels.cloudflared.connections.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) 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": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "config_version": 0, "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "features": [ "ha-origin" ], "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Clean up Cloudflare Tunnel connections `zero_trust.tunnels.cloudflared.connections.delete(strtunnel_id, ConnectionDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections` Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel independently of its current state. If no connector id (client_id) is provided all connectors will be removed. We recommend running this command after rotating tokens. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. ### Returns - `object` ### 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 ) connection = client.zero_trust.tunnels.cloudflared.connections.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(connection) ``` #### 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": {}, "success": true } ``` ## Domain Types ### Client - `class Client: …` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `config_version: Optional[int]` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns: Optional[List[Conn]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. # Token ## Get a Cloudflare Tunnel token `zero_trust.tunnels.cloudflared.token.get(strtunnel_id, TokenGetParams**kwargs) -> TokenGetResponse` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/token` Gets the token used to associate cloudflared with a specific tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### 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 ) token = client.zero_trust.tunnels.cloudflared.token.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(token) ``` #### 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": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Token Get Response - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # Connectors ## Get Cloudflare Tunnel connector `zero_trust.tunnels.cloudflared.connectors.get(strconnector_id, ConnectorGetParams**kwargs) -> Client` **get** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connectors/{connector_id}` Fetches connector and connection details for a Cloudflare Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `connector_id: str` UUID of the Cloudflare Tunnel connector. ### Returns - `class Client: …` A client (typically cloudflared) that maintains connections to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `config_version: Optional[int]` The version of the remote tunnel configuration. Used internally to sync cloudflared with the Zero Trust dashboard. - `conns: Optional[List[Conn]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. ### 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 ) client = client.zero_trust.tunnels.cloudflared.connectors.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) print(client.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": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "config_version": 0, "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "features": [ "ha-origin" ], "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" }, "success": true } ``` # Management ## Get a Cloudflare Tunnel management token `zero_trust.tunnels.cloudflared.management.create(strtunnel_id, ManagementCreateParams**kwargs) -> ManagementCreateResponse` **post** `/accounts/{account_id}/cfd_tunnel/{tunnel_id}/management` Gets a management token used to access the management resources (i.e. Streaming Logs) of a tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `resources: List[Literal["logs"]]` - `"logs"` ### Returns - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### 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 ) management = client.zero_trust.tunnels.cloudflared.management.create( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", resources=["logs"], ) print(management) ``` #### 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": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Management Create Response - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # WARP Connector ## List Warp Connector Tunnels `zero_trust.tunnels.warp_connector.list(WARPConnectorListParams**kwargs) -> SyncV4PagePaginationArray[WARPConnectorListResponse]` **get** `/accounts/{account_id}/warp_connector` Lists and filters Warp Connector Tunnels in an account. ### Parameters - `account_id: str` Cloudflare account ID - `exclude_prefix: Optional[str]` - `existed_at: Optional[str]` If provided, include only resources that were created (and not deleted) before this time. URL encoded. - `include_prefix: Optional[str]` - `is_deleted: Optional[bool]` If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included. - `name: Optional[str]` A user-friendly name for the tunnel. - `page: Optional[float]` Page number of paginated results. - `per_page: Optional[float]` Number of results to display. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `uuid: Optional[str]` UUID of the tunnel. - `was_active_at: Optional[Union[str, datetime]]` - `was_inactive_at: Optional[Union[str, datetime]]` ### Returns - `class WARPConnectorListResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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.zero_trust.tunnels.warp_connector.list( account_id="699d98642c564d2e855e9661899b7252", ) 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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Get a Warp Connector Tunnel `zero_trust.tunnels.warp_connector.get(strtunnel_id, WARPConnectorGetParams**kwargs) -> WARPConnectorGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}` Fetches a single Warp Connector Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class WARPConnectorGetResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) warp_connector = client.zero_trust.tunnels.warp_connector.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(warp_connector.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Create a Warp Connector Tunnel `zero_trust.tunnels.warp_connector.create(WARPConnectorCreateParams**kwargs) -> WARPConnectorCreateResponse` **post** `/accounts/{account_id}/warp_connector` Creates a new Warp Connector Tunnel in an account. ### Parameters - `account_id: str` Cloudflare account ID - `name: str` A user-friendly name for a tunnel. - `ha: Optional[bool]` Indicates that the tunnel will be created to be highly available. If omitted, defaults to false. ### Returns - `class WARPConnectorCreateResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) warp_connector = client.zero_trust.tunnels.warp_connector.create( account_id="699d98642c564d2e855e9661899b7252", name="blog", ) print(warp_connector.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Update a Warp Connector Tunnel `zero_trust.tunnels.warp_connector.edit(strtunnel_id, WARPConnectorEditParams**kwargs) -> WARPConnectorEditResponse` **patch** `/accounts/{account_id}/warp_connector/{tunnel_id}` Updates an existing Warp Connector Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `tunnel_secret: Optional[str]` Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string. ### Returns - `class WARPConnectorEditResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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.zero_trust.tunnels.warp_connector.edit( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(response.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Delete a Warp Connector Tunnel `zero_trust.tunnels.warp_connector.delete(strtunnel_id, WARPConnectorDeleteParams**kwargs) -> WARPConnectorDeleteResponse` **delete** `/accounts/{account_id}/warp_connector/{tunnel_id}` Deletes a Warp Connector Tunnel from an account. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class WARPConnectorDeleteResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### 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 ) warp_connector = client.zero_trust.tunnels.warp_connector.delete( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(warp_connector.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": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", "account_tag": "699d98642c564d2e855e9661899b7252", "connections": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "is_pending_reconnect": false, "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137", "uuid": "1bedc50d-42b3-473c-b108-ff3d10c0d925" } ], "conns_active_at": "2009-11-10T23:00:00Z", "conns_inactive_at": "2009-11-10T23:00:00Z", "created_at": "2021-01-25T18:22:34.317854Z", "deleted_at": "2009-11-10T23:00:00.000000Z", "metadata": {}, "name": "blog", "status": "healthy", "tun_type": "cfd_tunnel" }, "success": true } ``` ## Domain Types ### WARP Connector List Response - `class WARPConnectorListResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Get Response - `class WARPConnectorGetResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Create Response - `class WARPConnectorCreateResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Edit Response - `class WARPConnectorEditResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` ### WARP Connector Delete Response - `class WARPConnectorDeleteResponse: …` A Warp Connector Tunnel that connects your origin to Cloudflare's edge. - `id: Optional[str]` UUID of the tunnel. - `account_tag: Optional[str]` Cloudflare account ID - `connections: Optional[List[Connection]]` The Cloudflare Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `is_pending_reconnect: Optional[bool]` Cloudflare continues to track connections for several minutes after they disconnect. This is an optimization to improve latency and reliability of reconnecting. If `true`, the connection has disconnected but is still being tracked. If `false`, the connection is actively serving traffic. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running cloudflared. - `uuid: Optional[str]` UUID of the Cloudflare Tunnel connection. - `conns_active_at: Optional[datetime]` Timestamp of when the tunnel established at least one connection to Cloudflare's edge. If `null`, the tunnel is inactive. - `conns_inactive_at: Optional[datetime]` Timestamp of when the tunnel became inactive (no connections to Cloudflare's edge). If `null`, the tunnel is active. - `created_at: Optional[datetime]` Timestamp of when the resource was created. - `deleted_at: Optional[datetime]` Timestamp of when the resource was deleted. If `null`, the resource has not been deleted. - `metadata: Optional[object]` Metadata associated with the tunnel. - `name: Optional[str]` A user-friendly name for a tunnel. - `status: Optional[Literal["inactive", "degraded", "healthy", "down"]]` The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge). - `"inactive"` - `"degraded"` - `"healthy"` - `"down"` - `tun_type: Optional[Literal["cfd_tunnel", "warp_connector", "warp", 4 more]]` The type of tunnel. - `"cfd_tunnel"` - `"warp_connector"` - `"warp"` - `"magic"` - `"ip_sec"` - `"gre"` - `"cni"` # Token ## Get a Warp Connector Tunnel token `zero_trust.tunnels.warp_connector.token.get(strtunnel_id, TokenGetParams**kwargs) -> TokenGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/token` Gets the token used to associate warp device with a specific Warp Connector tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. ### 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 ) token = client.zero_trust.tunnels.warp_connector.token.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) print(token) ``` #### 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": "eyJhIjoiNWFiNGU5Z...", "success": true } ``` ## Domain Types ### Token Get Response - `str` The Tunnel Token is used as a mechanism to authenticate the operation of a tunnel. # Connections ## List WARP Connector Tunnel connections `zero_trust.tunnels.warp_connector.connections.get(strtunnel_id, ConnectionGetParams**kwargs) -> SyncSinglePage[ConnectionGetResponse]` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/connections` Fetches connection details for a WARP Connector Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. ### Returns - `class ConnectionGetResponse: …` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `conns: Optional[List[Conn]]` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running WARP Connector. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `ha_status: Optional[Literal["offline", "passive", "active"]]` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. ### 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.zero_trust.tunnels.warp_connector.connections.get( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) 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": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137" } ], "features": [ "ha-origin" ], "ha_status": "offline", "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Connection Get Response - `class ConnectionGetResponse: …` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `conns: Optional[List[Conn]]` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running WARP Connector. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `ha_status: Optional[Literal["offline", "passive", "active"]]` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. # Connectors ## Get WARP Connector Tunnel connector `zero_trust.tunnels.warp_connector.connectors.get(strconnector_id, ConnectorGetParams**kwargs) -> ConnectorGetResponse` **get** `/accounts/{account_id}/warp_connector/{tunnel_id}/connectors/{connector_id}` Fetches connector and connection details for a WARP Connector Tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `connector_id: str` UUID of the Cloudflare Tunnel connector. ### Returns - `class ConnectorGetResponse: …` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `conns: Optional[List[Conn]]` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running WARP Connector. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `ha_status: Optional[Literal["offline", "passive", "active"]]` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. ### 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 ) connector = client.zero_trust.tunnels.warp_connector.connectors.get( connector_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", account_id="699d98642c564d2e855e9661899b7252", tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) print(connector.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": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "arch": "linux_amd64", "conns": [ { "id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_id": "1bedc50d-42b3-473c-b108-ff3d10c0d925", "client_version": "2022.7.1", "colo_name": "DFW", "opened_at": "2021-01-25T18:22:34.317854Z", "origin_ip": "10.1.0.137" } ], "features": [ "ha-origin" ], "ha_status": "offline", "run_at": "2009-11-10T23:00:00Z", "version": "2022.7.1" }, "success": true } ``` ## Domain Types ### Connector Get Response - `class ConnectorGetResponse: …` A WARP Connector client that maintains a connection to a Cloudflare data center. - `id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `arch: Optional[str]` The cloudflared OS architecture used to establish this connection. - `conns: Optional[List[Conn]]` The WARP Connector Tunnel connections between your origin and Cloudflare's edge. - `id: Optional[str]` UUID of the Cloudflare Tunnel connection. - `client_id: Optional[str]` UUID of the Cloudflare Tunnel connector. - `client_version: Optional[str]` The cloudflared version used to establish this connection. - `colo_name: Optional[str]` The Cloudflare data center used for this connection. - `opened_at: Optional[datetime]` Timestamp of when the connection was established. - `origin_ip: Optional[str]` The public IP address of the host running WARP Connector. - `features: Optional[List[str]]` Features enabled for the Cloudflare Tunnel. - `ha_status: Optional[Literal["offline", "passive", "active"]]` The HA status of a WARP Connector client. - `"offline"` - `"passive"` - `"active"` - `run_at: Optional[datetime]` Timestamp of when the tunnel connection was started. - `version: Optional[str]` The cloudflared version used to establish this connection. # Failover ## Trigger a manual failover for a WARP Connector Tunnel `zero_trust.tunnels.warp_connector.failover.update(strtunnel_id, FailoverUpdateParams**kwargs) -> object` **put** `/accounts/{account_id}/warp_connector/{tunnel_id}/failover` Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel. ### Parameters - `account_id: str` Cloudflare account ID - `tunnel_id: str` UUID of the tunnel. - `client_id: str` UUID of the Cloudflare Tunnel connector. ### Returns - `object` ### 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 ) failover = client.zero_trust.tunnels.warp_connector.failover.update( tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", client_id="1bedc50d-42b3-473c-b108-ff3d10c0d925", ) print(failover) ``` #### 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": {}, "success": true } ```