List Zero Trust Gateway locations
client.ZeroTrust.Gateway.Locations.List(ctx, query) (*SinglePage[Location], error)
GET/accounts/{account_id}/gateway/locations
List Zero Trust Gateway locations for an account.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
List Zero Trust Gateway locations
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/zero_trust"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
page, err := client.ZeroTrust.Gateway.Locations.List(context.TODO(), zero_trust.GatewayLocationListParams{
AccountID: cloudflare.F("699d98642c564d2e855e9661899b7252"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"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": [
{
"id": "ed35569b41ce4d1facfe683550f54086",
"client_default": false,
"created_at": "2014-01-01T05:20:00.12345Z",
"dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6",
"dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83",
"doh_subdomain": "oli3n9zkz5",
"ecs_support": false,
"endpoints": {
"doh": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
],
"require_token": true
},
"dot": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
]
},
"ipv4": {
"enabled": true
},
"ipv6": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
]
}
},
"ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"ipv4_destination": "172.64.36.1",
"ipv4_destination_backup": "172.64.36.2",
"name": "Austin Office Location",
"networks": [
{
"network": "192.0.2.1/32"
}
],
"updated_at": "2014-01-01T05:20:00.12345Z"
}
],
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}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": [
{
"id": "ed35569b41ce4d1facfe683550f54086",
"client_default": false,
"created_at": "2014-01-01T05:20:00.12345Z",
"dns_destination_ips_id": "0e4a32c6-6fb8-4858-9296-98f51631e8e6",
"dns_destination_ipv6_block_id": "b08f7231-d458-495c-98ef-190604c9ee83",
"doh_subdomain": "oli3n9zkz5",
"ecs_support": false,
"endpoints": {
"doh": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
],
"require_token": true
},
"dot": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
]
},
"ipv4": {
"enabled": true
},
"ipv6": {
"enabled": true,
"networks": [
{
"network": "2001:85a3::/64"
}
]
}
},
"ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"ipv4_destination": "172.64.36.1",
"ipv4_destination_backup": "172.64.36.2",
"name": "Austin Office Location",
"networks": [
{
"network": "192.0.2.1/32"
}
],
"updated_at": "2014-01-01T05:20:00.12345Z"
}
],
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000
}
}