# Directory # Services ## List Workers VPC connectivity services `client.Connectivity.Directory.Services.List(ctx, params) (*V4PagePaginationArray[DirectoryServiceListResponse], error)` **get** `/accounts/{account_id}/connectivity/directory/services` List Workers VPC connectivity services ### Parameters - `params DirectoryServiceListParams` - `AccountID param.Field[string]` Path param: Account identifier - `Page param.Field[int64]` Query param: Current page in the response - `PerPage param.Field[int64]` Query param: Max amount of entries returned per page - `Type param.Field[DirectoryServiceListParamsType]` Query param - `const DirectoryServiceListParamsTypeTCP DirectoryServiceListParamsType = "tcp"` - `const DirectoryServiceListParamsTypeHTTP DirectoryServiceListParamsType = "http"` ### Returns - `type DirectoryServiceListResponse interface{…}` - `type DirectoryServiceListResponseInfraHTTPServiceConfig struct{…}` - `Host DirectoryServiceListResponseInfraHTTPServiceConfigHost` - `type DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceListResponseInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceListResponseInfraHTTPServiceConfigType` - `const DirectoryServiceListResponseInfraHTTPServiceConfigTypeTCP DirectoryServiceListResponseInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceListResponseInfraHTTPServiceConfigTypeHTTP DirectoryServiceListResponseInfraHTTPServiceConfigType = "http"` - `CreatedAt Time` - `HTTPPort int64` - `HTTPSPort int64` - `ServiceID string` - `TLSSettings DirectoryServiceListResponseInfraHTTPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` - `type DirectoryServiceListResponseInfraTCPServiceConfig struct{…}` - `Host DirectoryServiceListResponseInfraTCPServiceConfigHost` - `type DirectoryServiceListResponseInfraTCPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceListResponseInfraTCPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraTCPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceListResponseInfraTCPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraTCPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceListResponseInfraTCPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceListResponseInfraTCPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceListResponseInfraTCPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceListResponseInfraTCPServiceConfigType` - `const DirectoryServiceListResponseInfraTCPServiceConfigTypeTCP DirectoryServiceListResponseInfraTCPServiceConfigType = "tcp"` - `const DirectoryServiceListResponseInfraTCPServiceConfigTypeHTTP DirectoryServiceListResponseInfraTCPServiceConfigType = "http"` - `AppProtocol DirectoryServiceListResponseInfraTCPServiceConfigAppProtocol` - `const DirectoryServiceListResponseInfraTCPServiceConfigAppProtocolPostgresql DirectoryServiceListResponseInfraTCPServiceConfigAppProtocol = "postgresql"` - `const DirectoryServiceListResponseInfraTCPServiceConfigAppProtocolMysql DirectoryServiceListResponseInfraTCPServiceConfigAppProtocol = "mysql"` - `CreatedAt Time` - `ServiceID string` - `TCPPort int64` - `TLSSettings DirectoryServiceListResponseInfraTCPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/connectivity" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.Connectivity.Directory.Services.List(context.TODO(), connectivity.DirectoryServiceListParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", 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" } } ], "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" } ], "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000, "total_pages": 100 } } ``` ## Create Workers VPC connectivity service `client.Connectivity.Directory.Services.New(ctx, params) (*DirectoryServiceNewResponse, error)` **post** `/accounts/{account_id}/connectivity/directory/services` Create Workers VPC connectivity service ### Parameters - `params DirectoryServiceNewParams` - `AccountID param.Field[string]` Path param: Account identifier - `Host param.Field[DirectoryServiceNewParamsInfraHTTPServiceConfigHost]` Body param - `DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraIPv4Host` - `IPV4 string` - `Network DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraIPv6Host` - `IPV6 string` - `Network DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraDualStackHost` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraHostnameHost` - `Hostname string` - `ResolverNetwork DirectoryServiceNewParamsInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name param.Field[string]` Body param - `Type param.Field[DirectoryServiceNewParamsInfraHTTPServiceConfigType]` Body param - `const DirectoryServiceNewParamsInfraHTTPServiceConfigTypeTCP DirectoryServiceNewParamsInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceNewParamsInfraHTTPServiceConfigTypeHTTP DirectoryServiceNewParamsInfraHTTPServiceConfigType = "http"` - `HTTPPort param.Field[int64]` Body param - `HTTPSPort param.Field[int64]` Body param - `TLSSettings param.Field[DirectoryServiceNewParamsInfraHTTPServiceConfigTLSSettings]` Body param: TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 ### Returns - `type DirectoryServiceNewResponse interface{…}` - `type DirectoryServiceNewResponseInfraHTTPServiceConfig struct{…}` - `Host DirectoryServiceNewResponseInfraHTTPServiceConfigHost` - `type DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceNewResponseInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceNewResponseInfraHTTPServiceConfigType` - `const DirectoryServiceNewResponseInfraHTTPServiceConfigTypeTCP DirectoryServiceNewResponseInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceNewResponseInfraHTTPServiceConfigTypeHTTP DirectoryServiceNewResponseInfraHTTPServiceConfigType = "http"` - `CreatedAt Time` - `HTTPPort int64` - `HTTPSPort int64` - `ServiceID string` - `TLSSettings DirectoryServiceNewResponseInfraHTTPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` - `type DirectoryServiceNewResponseInfraTCPServiceConfig struct{…}` - `Host DirectoryServiceNewResponseInfraTCPServiceConfigHost` - `type DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceNewResponseInfraTCPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceNewResponseInfraTCPServiceConfigType` - `const DirectoryServiceNewResponseInfraTCPServiceConfigTypeTCP DirectoryServiceNewResponseInfraTCPServiceConfigType = "tcp"` - `const DirectoryServiceNewResponseInfraTCPServiceConfigTypeHTTP DirectoryServiceNewResponseInfraTCPServiceConfigType = "http"` - `AppProtocol DirectoryServiceNewResponseInfraTCPServiceConfigAppProtocol` - `const DirectoryServiceNewResponseInfraTCPServiceConfigAppProtocolPostgresql DirectoryServiceNewResponseInfraTCPServiceConfigAppProtocol = "postgresql"` - `const DirectoryServiceNewResponseInfraTCPServiceConfigAppProtocolMysql DirectoryServiceNewResponseInfraTCPServiceConfigAppProtocol = "mysql"` - `CreatedAt Time` - `ServiceID string` - `TCPPort int64` - `TLSSettings DirectoryServiceNewResponseInfraTCPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/connectivity" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) service, err := client.Connectivity.Directory.Services.New(context.TODO(), connectivity.DirectoryServiceNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: connectivity.DirectoryServiceNewParamsBodyInfraHTTPServiceConfig{ Host: cloudflare.F[connectivity.DirectoryServiceNewParamsBodyInfraHTTPServiceConfigHostUnion](connectivity.DirectoryServiceNewParamsBodyInfraHTTPServiceConfigHostInfraHostnameHost{ Hostname: cloudflare.F("api.example.com"), ResolverNetwork: cloudflare.F(connectivity.DirectoryServiceNewParamsBodyInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork{ TunnelID: cloudflare.F("0191dce4-9ab4-7fce-b660-8e5dec5172da"), }), }), Name: cloudflare.F("web-server"), Type: cloudflare.F(connectivity.DirectoryServiceNewParamsBodyInfraHTTPServiceConfigTypeHTTP), }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", service) } ``` #### Response ```json { "errors": [], "messages": [], "result": { "created_at": "2024-01-15T09:30:00Z", "host": { "hostname": "api.example.com", "resolver_network": { "tunnel_id": "0191dce4-9ab4-7fce-b660-8e5dec5172da" } }, "name": "web-server", "service_id": "550e8400-e29b-41d4-a716-446655440000", "type": "http", "updated_at": "2024-01-15T09:30:00Z" }, "success": true } ``` ## Get Workers VPC connectivity service `client.Connectivity.Directory.Services.Get(ctx, serviceID, query) (*DirectoryServiceGetResponse, error)` **get** `/accounts/{account_id}/connectivity/directory/services/{service_id}` Get Workers VPC connectivity service ### Parameters - `serviceID string` - `query DirectoryServiceGetParams` - `AccountID param.Field[string]` ### Returns - `type DirectoryServiceGetResponse interface{…}` - `type DirectoryServiceGetResponseInfraHTTPServiceConfig struct{…}` - `Host DirectoryServiceGetResponseInfraHTTPServiceConfigHost` - `type DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceGetResponseInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceGetResponseInfraHTTPServiceConfigType` - `const DirectoryServiceGetResponseInfraHTTPServiceConfigTypeTCP DirectoryServiceGetResponseInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceGetResponseInfraHTTPServiceConfigTypeHTTP DirectoryServiceGetResponseInfraHTTPServiceConfigType = "http"` - `CreatedAt Time` - `HTTPPort int64` - `HTTPSPort int64` - `ServiceID string` - `TLSSettings DirectoryServiceGetResponseInfraHTTPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` - `type DirectoryServiceGetResponseInfraTCPServiceConfig struct{…}` - `Host DirectoryServiceGetResponseInfraTCPServiceConfigHost` - `type DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceGetResponseInfraTCPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceGetResponseInfraTCPServiceConfigType` - `const DirectoryServiceGetResponseInfraTCPServiceConfigTypeTCP DirectoryServiceGetResponseInfraTCPServiceConfigType = "tcp"` - `const DirectoryServiceGetResponseInfraTCPServiceConfigTypeHTTP DirectoryServiceGetResponseInfraTCPServiceConfigType = "http"` - `AppProtocol DirectoryServiceGetResponseInfraTCPServiceConfigAppProtocol` - `const DirectoryServiceGetResponseInfraTCPServiceConfigAppProtocolPostgresql DirectoryServiceGetResponseInfraTCPServiceConfigAppProtocol = "postgresql"` - `const DirectoryServiceGetResponseInfraTCPServiceConfigAppProtocolMysql DirectoryServiceGetResponseInfraTCPServiceConfigAppProtocol = "mysql"` - `CreatedAt Time` - `ServiceID string` - `TCPPort int64` - `TLSSettings DirectoryServiceGetResponseInfraTCPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/connectivity" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) service, err := client.Connectivity.Directory.Services.Get( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connectivity.DirectoryServiceGetParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", service) } ``` #### 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": { "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" } } ``` ## Update Workers VPC connectivity service `client.Connectivity.Directory.Services.Update(ctx, serviceID, params) (*DirectoryServiceUpdateResponse, error)` **put** `/accounts/{account_id}/connectivity/directory/services/{service_id}` Update Workers VPC connectivity service ### Parameters - `serviceID string` - `params DirectoryServiceUpdateParams` - `AccountID param.Field[string]` Path param - `Host param.Field[DirectoryServiceUpdateParamsInfraHTTPServiceConfigHost]` Body param - `DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraIPv4Host` - `IPV4 string` - `Network DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraIPv6Host` - `IPV6 string` - `Network DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraDualStackHost` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraHostnameHost` - `Hostname string` - `ResolverNetwork DirectoryServiceUpdateParamsInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name param.Field[string]` Body param - `Type param.Field[DirectoryServiceUpdateParamsInfraHTTPServiceConfigType]` Body param - `const DirectoryServiceUpdateParamsInfraHTTPServiceConfigTypeTCP DirectoryServiceUpdateParamsInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceUpdateParamsInfraHTTPServiceConfigTypeHTTP DirectoryServiceUpdateParamsInfraHTTPServiceConfigType = "http"` - `HTTPPort param.Field[int64]` Body param - `HTTPSPort param.Field[int64]` Body param - `TLSSettings param.Field[DirectoryServiceUpdateParamsInfraHTTPServiceConfigTLSSettings]` Body param: TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 ### Returns - `type DirectoryServiceUpdateResponse interface{…}` - `type DirectoryServiceUpdateResponseInfraHTTPServiceConfig struct{…}` - `Host DirectoryServiceUpdateResponseInfraHTTPServiceConfigHost` - `type DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceUpdateResponseInfraHTTPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceUpdateResponseInfraHTTPServiceConfigType` - `const DirectoryServiceUpdateResponseInfraHTTPServiceConfigTypeTCP DirectoryServiceUpdateResponseInfraHTTPServiceConfigType = "tcp"` - `const DirectoryServiceUpdateResponseInfraHTTPServiceConfigTypeHTTP DirectoryServiceUpdateResponseInfraHTTPServiceConfigType = "http"` - `CreatedAt Time` - `HTTPPort int64` - `HTTPSPort int64` - `ServiceID string` - `TLSSettings DirectoryServiceUpdateResponseInfraHTTPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` - `type DirectoryServiceUpdateResponseInfraTCPServiceConfig struct{…}` - `Host DirectoryServiceUpdateResponseInfraTCPServiceConfigHost` - `type DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraIPv4Host struct{…}` - `IPV4 string` - `Network DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraIPv4HostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraIPv6Host struct{…}` - `IPV6 string` - `Network DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraIPv6HostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraDualStackHost struct{…}` - `IPV4 string` - `IPV6 string` - `Network DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraDualStackHostNetwork` - `TunnelID string` - `type DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraHostnameHost struct{…}` - `Hostname string` - `ResolverNetwork DirectoryServiceUpdateResponseInfraTCPServiceConfigHostInfraHostnameHostResolverNetwork` - `TunnelID string` - `ResolverIPs []string` - `Name string` - `Type DirectoryServiceUpdateResponseInfraTCPServiceConfigType` - `const DirectoryServiceUpdateResponseInfraTCPServiceConfigTypeTCP DirectoryServiceUpdateResponseInfraTCPServiceConfigType = "tcp"` - `const DirectoryServiceUpdateResponseInfraTCPServiceConfigTypeHTTP DirectoryServiceUpdateResponseInfraTCPServiceConfigType = "http"` - `AppProtocol DirectoryServiceUpdateResponseInfraTCPServiceConfigAppProtocol` - `const DirectoryServiceUpdateResponseInfraTCPServiceConfigAppProtocolPostgresql DirectoryServiceUpdateResponseInfraTCPServiceConfigAppProtocol = "postgresql"` - `const DirectoryServiceUpdateResponseInfraTCPServiceConfigAppProtocolMysql DirectoryServiceUpdateResponseInfraTCPServiceConfigAppProtocol = "mysql"` - `CreatedAt Time` - `ServiceID string` - `TCPPort int64` - `TLSSettings DirectoryServiceUpdateResponseInfraTCPServiceConfigTLSSettings` TLS settings for a connectivity service. If omitted, the default mode (`verify_full`) is used. - `CERTVerificationMode string` 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 - `UpdatedAt Time` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/connectivity" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) service, err := client.Connectivity.Directory.Services.Update( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connectivity.DirectoryServiceUpdateParams{ AccountID: cloudflare.F("account_id"), Body: connectivity.DirectoryServiceUpdateParamsBodyInfraHTTPServiceConfig{ Host: cloudflare.F[connectivity.DirectoryServiceUpdateParamsBodyInfraHTTPServiceConfigHostUnion](connectivity.DirectoryServiceUpdateParamsBodyInfraHTTPServiceConfigHostInfraIPv4Host{ IPV4: cloudflare.F("10.0.0.1"), Network: cloudflare.F(connectivity.DirectoryServiceUpdateParamsBodyInfraHTTPServiceConfigHostInfraIPv4HostNetwork{ TunnelID: cloudflare.F("0191dce4-9ab4-7fce-b660-8e5dec5172da"), }), }), Name: cloudflare.F("postgres-db"), Type: cloudflare.F(connectivity.DirectoryServiceUpdateParamsBodyInfraHTTPServiceConfigTypeTCP), }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", service) } ``` #### 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": { "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" } } ``` ## Delete Workers VPC connectivity service `client.Connectivity.Directory.Services.Delete(ctx, serviceID, body) error` **delete** `/accounts/{account_id}/connectivity/directory/services/{service_id}` Delete Workers VPC connectivity service ### Parameters - `serviceID string` - `body DirectoryServiceDeleteParams` - `AccountID param.Field[string]` ### Example ```go package main import ( "context" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/connectivity" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) err := client.Connectivity.Directory.Services.Delete( context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", connectivity.DirectoryServiceDeleteParams{ AccountID: cloudflare.F("account_id"), }, ) if err != nil { panic(err.Error()) } } ```