Skip to content
Start here

List available account or zone datasets

client.Logs.LogExplorer.Datasets.Available.List(ctx, query) (*SinglePage[AvailableDataset], error)
GET/{accounts_or_zones}/{account_or_zone_id}/logs/explorer/datasets/available

Returns all dataset types that this account or zone can create. Each entry includes the dataset schema and timestamp field.

The schema shows all possible fields for a dataset. However, not all fields may be available for your account or zone. When creating or updating a dataset, only fields available to your account or zone can be enabled. If you request a field that is not available, you will receive an error.

Security

API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Logs WriteLogs Read
ParametersExpand Collapse
query LogExplorerDatasetAvailableListParams
AccountID param.Field[string]Optional

The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

ZoneID param.Field[string]Optional

The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

ReturnsExpand Collapse
type AvailableDataset struct{…}

A dataset type that the account or zone can create.

Dataset string

Dataset type name (e.g. http_requests).

ObjectType AvailableDatasetObjectType

Whether this dataset type is account-scoped or zone-scoped.

One of the following:
const AvailableDatasetObjectTypeAccount AvailableDatasetObjectType = "account"
const AvailableDatasetObjectTypeZone AvailableDatasetObjectType = "zone"
Schema AvailableDatasetSchema

JSON Schema that describes the fields this dataset exposes.

Properties map[string, unknown]Optional
Required []stringOptional
Type AvailableDatasetSchemaTypeOptional
TimestampField string

The primary timestamp field name for this dataset.

List available account or zone datasets

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/logs"
  "github.com/stainless-sdks/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Logs.LogExplorer.Datasets.Available.List(context.TODO(), logs.LogExplorerDatasetAvailableListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": [
    {
      "dataset": "dataset",
      "object_type": "account",
      "schema": {
        "properties": {
          "foo": "bar"
        },
        "required": [
          "string"
        ],
        "type": "object"
      },
      "timestamp_field": "timestamp_field"
    }
  ]
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    "string"
  ],
  "success": true,
  "result": [
    {
      "dataset": "dataset",
      "object_type": "account",
      "schema": {
        "properties": {
          "foo": "bar"
        },
        "required": [
          "string"
        ],
        "type": "object"
      },
      "timestamp_field": "timestamp_field"
    }
  ]
}