Skip to content
Start here

Get Workers VPC connectivity service

connectivity.directory.services.get(strservice_id, ServiceGetParams**kwargs) -> ServiceGetResponse
GET/accounts/{account_id}/connectivity/directory/services/{service_id}

Get Workers VPC connectivity service

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
account_id: str
service_id: str
formatuuid
ReturnsExpand Collapse
One of the following:
class InfraHTTPServiceConfig:
host: InfraHTTPServiceConfigHost
One of the following:
class InfraHTTPServiceConfigHostInfraIPv4Host:
ipv4: str
network: InfraHTTPServiceConfigHostInfraIPv4HostNetwork
tunnel_id: str
formatuuid
class InfraHTTPServiceConfigHostInfraIPv6Host:
ipv6: str
network: InfraHTTPServiceConfigHostInfraIPv6HostNetwork
tunnel_id: str
formatuuid
class InfraHTTPServiceConfigHostInfraDualStackHost:
ipv4: str
ipv6: str
network: InfraHTTPServiceConfigHostInfraDualStackHostNetwork
tunnel_id: str
formatuuid
class InfraHTTPServiceConfigHostInfraHostnameHost:
hostname: str
resolver_network: InfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork
tunnel_id: str
formatuuid
resolver_ips: Optional[List[str]]
name: str
type: Literal["tcp", "http"]
One of the following:
"tcp"
"http"
created_at: Optional[datetime]
formatdate-time
http_port: Optional[int]
formatint32
minimum1
https_port: Optional[int]
formatint32
minimum1
service_id: Optional[str]
formatuuid
tls_settings: Optional[InfraHTTPServiceConfigTLSSettings]

TLS settings for a connectivity service.

If omitted, the default mode (verify_full) is used.

cert_verification_mode: str

TLS certificate verification mode for the connection to the origin.

  • "verify_full" — verify certificate chain and hostname (default)
  • "verify_ca" — verify certificate chain only, skip hostname check
  • "disabled" — do not verify the server certificate at all
updated_at: Optional[datetime]
formatdate-time
class InfraTCPServiceConfig:
host: InfraTCPServiceConfigHost
One of the following:
class InfraTCPServiceConfigHostInfraIPv4Host:
ipv4: str
network: InfraTCPServiceConfigHostInfraIPv4HostNetwork
tunnel_id: str
formatuuid
class InfraTCPServiceConfigHostInfraIPv6Host:
ipv6: str
network: InfraTCPServiceConfigHostInfraIPv6HostNetwork
tunnel_id: str
formatuuid
class InfraTCPServiceConfigHostInfraDualStackHost:
ipv4: str
ipv6: str
network: InfraTCPServiceConfigHostInfraDualStackHostNetwork
tunnel_id: str
formatuuid
class InfraTCPServiceConfigHostInfraHostnameHost:
hostname: str
resolver_network: InfraTCPServiceConfigHostInfraHostnameHostResolverNetwork
tunnel_id: str
formatuuid
resolver_ips: Optional[List[str]]
name: str
type: Literal["tcp", "http"]
One of the following:
"tcp"
"http"
app_protocol: Optional[Literal["postgresql", "mysql"]]
One of the following:
"postgresql"
"mysql"
created_at: Optional[datetime]
formatdate-time
service_id: Optional[str]
formatuuid
tcp_port: Optional[int]
formatint32
minimum1
tls_settings: Optional[InfraTCPServiceConfigTLSSettings]

TLS settings for a connectivity service.

If omitted, the default mode (verify_full) is used.

cert_verification_mode: str

TLS certificate verification mode for the connection to the origin.

  • "verify_full" — verify certificate chain and hostname (default)
  • "verify_ca" — verify certificate chain only, skip hostname check
  • "disabled" — do not verify the server certificate at all
updated_at: Optional[datetime]
formatdate-time

Get Workers VPC connectivity service

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
service = client.connectivity.directory.services.get(
    service_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    account_id="account_id",
)
print(service)
{
  "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": {
    "host": {
      "ipv4": "10.0.0.1",
      "network": {
        "tunnel_id": "0191dce4-9ab4-7fce-b660-8e5dec5172da"
      }
    },
    "name": "web-app",
    "type": "http",
    "created_at": "2024-01-15T09:30:00Z",
    "http_port": 8080,
    "https_port": 8443,
    "service_id": "550e8400-e29b-41d4-a716-446655440000",
    "tls_settings": {
      "cert_verification_mode": "verify_full"
    },
    "updated_at": "2024-01-15T10:45:00Z"
  }
}
Returns Examples
{
  "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": {
    "host": {
      "ipv4": "10.0.0.1",
      "network": {
        "tunnel_id": "0191dce4-9ab4-7fce-b660-8e5dec5172da"
      }
    },
    "name": "web-app",
    "type": "http",
    "created_at": "2024-01-15T09:30:00Z",
    "http_port": 8080,
    "https_port": 8443,
    "service_id": "550e8400-e29b-41d4-a716-446655440000",
    "tls_settings": {
      "cert_verification_mode": "verify_full"
    },
    "updated_at": "2024-01-15T10:45:00Z"
  }
}