Skip to content
Start here

List Hyperdrives

client.Hyperdrive.Configs.List(ctx, query) (*SinglePage[Hyperdrive], error)
GET/accounts/{account_id}/hyperdrive/configs

Returns a list of Hyperdrives.

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
Accepted Permissions (at least one required)
Hyperdrive WriteHyperdrive Read
ParametersExpand Collapse
query ConfigListParams
AccountID param.Field[string]

Define configurations using a unique string identifier.

maxLength32
ReturnsExpand Collapse
type Hyperdrive struct{…}
ID string

Define configurations using a unique string identifier.

maxLength32
Name string

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

Origin HyperdriveOrigin
One of the following:
type HyperdriveOriginPublicDatabase struct{…}
Database string

Set the name of your origin database.

Host string

Defines the host (hostname or IP) of your origin database.

Password string

Set the password needed to access your origin database. The API never returns this write-only value.

Port int64

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

Scheme HyperdriveOriginPublicDatabaseScheme

Specifies the URL scheme used to connect to your origin database.

One of the following:
const HyperdriveOriginPublicDatabaseSchemePostgres HyperdriveOriginPublicDatabaseScheme = "postgres"
const HyperdriveOriginPublicDatabaseSchemePostgresql HyperdriveOriginPublicDatabaseScheme = "postgresql"
const HyperdriveOriginPublicDatabaseSchemeMysql HyperdriveOriginPublicDatabaseScheme = "mysql"
User string

Set the user of your origin database.

type HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnel struct{…}
AccessClientID string

Defines the Client ID of the Access token to use when connecting to the origin database.

AccessClientSecret string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

Database string

Set the name of your origin database.

Host string

Defines the host (hostname or IP) of your origin database.

Password string

Set the password needed to access your origin database. The API never returns this write-only value.

Scheme HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme

Specifies the URL scheme used to connect to your origin database.

One of the following:
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgres HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgres"
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgresql HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgresql"
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemeMysql HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "mysql"
User string

Set the user of your origin database.

Caching HyperdriveCachingoptional
One of the following:
type HyperdriveCachingHyperdriveHyperdriveCachingCommon struct{…}
Disabled booloptional

Set to true to disable caching of SQL responses. Default is false.

type HyperdriveCachingHyperdriveHyperdriveCachingEnabled struct{…}
Disabled booloptional

Set to true to disable caching of SQL responses. Default is false.

MaxAge int64optional

Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.

StaleWhileRevalidate int64optional

Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.

CreatedOn Timeoptional

Defines the creation time of the Hyperdrive configuration.

formatdate-time
ModifiedOn Timeoptional

Defines the last modified time of the Hyperdrive configuration.

formatdate-time
MTLS HyperdriveMTLSoptional
CACertificateID stringoptional

Define CA certificate ID obtained after uploading CA cert.

MTLSCertificateID stringoptional

Define mTLS certificate ID obtained after uploading client cert.

Sslmode stringoptional

Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.

OriginConnectionLimit int64optional

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Contact Cloudflare if you need a higher limit.

maximum100
minimum5

List Hyperdrives

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/hyperdrive"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Hyperdrive.Configs.List(context.TODO(), hyperdrive.ConfigListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  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"
      }
    }
  ],
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "example-hyperdrive",
      "origin": {
        "database": "postgres",
        "host": "database.example.com",
        "port": 5432,
        "scheme": "postgres",
        "user": "postgres"
      },
      "caching": {
        "disabled": true
      },
      "created_on": "2017-01-01T00:00:00Z",
      "modified_on": "2017-01-01T00:00:00Z",
      "mtls": {
        "ca_certificate_id": "00000000-0000-0000-0000-0000000000",
        "mtls_certificate_id": "00000000-0000-0000-0000-0000000000",
        "sslmode": "verify-full"
      },
      "origin_connection_limit": 60
    }
  ],
  "success": true,
  "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"
      }
    }
  ],
  "result": [
    {
      "id": "023e105f4ecef8ad9ca31a8372d0c353",
      "name": "example-hyperdrive",
      "origin": {
        "database": "postgres",
        "host": "database.example.com",
        "port": 5432,
        "scheme": "postgres",
        "user": "postgres"
      },
      "caching": {
        "disabled": true
      },
      "created_on": "2017-01-01T00:00:00Z",
      "modified_on": "2017-01-01T00:00:00Z",
      "mtls": {
        "ca_certificate_id": "00000000-0000-0000-0000-0000000000",
        "mtls_certificate_id": "00000000-0000-0000-0000-0000000000",
        "sslmode": "verify-full"
      },
      "origin_connection_limit": 60
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}