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:
Accepted Permissions (at least one required)
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"
}
]
}