Skip to content
Start here

Get Basin Catalog details

client.BasinCatalog.Get(ctx, bucketName, query) (*BasinCatalogGetResponse, error)
GET/accounts/{account_id}/basin-catalog/{bucket_name}

Retrieve detailed information about a specific Basin Catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.

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)
Workers R2 Data Catalog WriteWorkers R2 Data Catalog Read
ParametersExpand Collapse
bucketName string

Specifies the R2 bucket name.

maxLength63
minLength3
query BasinCatalogGetParams
AccountID param.Field[string]

Use this to identify the account.

ReturnsExpand Collapse
type BasinCatalogGetResponse struct{…}

Contains catalog information.

ID string

Use this to uniquely identify the catalog.

formatuuid
Bucket string

Specifies the associated R2 bucket name.

Name string

Specifies the catalog name (generated from account and bucket name).

Status BasinCatalogGetResponseStatus

Indicates the status of the catalog.

One of the following:
const BasinCatalogGetResponseStatusActive BasinCatalogGetResponseStatus = "active"
const BasinCatalogGetResponseStatusInactive BasinCatalogGetResponseStatus = "inactive"
CredentialStatus BasinCatalogGetResponseCredentialStatusOptional

Shows the credential configuration status.

One of the following:
const BasinCatalogGetResponseCredentialStatusPresent BasinCatalogGetResponseCredentialStatus = "present"
const BasinCatalogGetResponseCredentialStatusAbsent BasinCatalogGetResponseCredentialStatus = "absent"
MaintenanceConfig BasinCatalogGetResponseMaintenanceConfigOptional

Configures maintenance for the catalog.

Compaction BasinCatalogGetResponseMaintenanceConfigCompactionOptional

Configures compaction for catalog maintenance.

State BasinCatalogGetResponseMaintenanceConfigCompactionState

Specifies the state of maintenance operations.

One of the following:
const BasinCatalogGetResponseMaintenanceConfigCompactionStateEnabled BasinCatalogGetResponseMaintenanceConfigCompactionState = "enabled"
const BasinCatalogGetResponseMaintenanceConfigCompactionStateDisabled BasinCatalogGetResponseMaintenanceConfigCompactionState = "disabled"
TargetSizeMB BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB

Sets the target file size for compaction in megabytes. Defaults to “128”.

One of the following:
const BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB64 BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "64"
const BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB128 BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "128"
const BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB256 BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "256"
const BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB512 BasinCatalogGetResponseMaintenanceConfigCompactionTargetSizeMB = "512"
Interval stringOptional

Scheduling interval between normal table maintenance runs.

SnapshotExpiration BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationOptional

Configures snapshot expiration settings.

MaxSnapshotAge string

Specifies the maximum age for snapshots. The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: “7d” (7 days), “48h” (48 hours), “2880m” (2,880 minutes). Defaults to “7d”.

MinSnapshotsToKeep int64

Specifies the minimum number of snapshots to retain. Defaults to 100.

formatint64
minimum1
State BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationState

Specifies the state of maintenance operations.

One of the following:
const BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationStateEnabled BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationState = "enabled"
const BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationStateDisabled BasinCatalogGetResponseMaintenanceConfigSnapshotExpirationState = "disabled"

Get Basin Catalog details

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  basinCatalog, err := client.BasinCatalog.Get(
    context.TODO(),
    "my-data-bucket",
    basin_catalog.BasinCatalogGetParams{
      AccountID: cloudflare.F("0123456789abcdef0123456789abcdef"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", basinCatalog.ID)
}
{
  "errors": [],
  "messages": [],
  "result": {
    "bucket": "analytics-bucket",
    "credential_status": "present",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "maintenance_config": {
      "compaction": {
        "state": "enabled",
        "target_size_mb": "128"
      },
      "snapshot_expiration": {
        "max_snapshot_age": "7d",
        "min_snapshots_to_keep": 100,
        "state": "enabled"
      }
    },
    "name": "account123_analytics-bucket",
    "status": "active"
  },
  "success": true
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": {
    "bucket": "analytics-bucket",
    "credential_status": "present",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "maintenance_config": {
      "compaction": {
        "state": "enabled",
        "target_size_mb": "128"
      },
      "snapshot_expiration": {
        "max_snapshot_age": "7d",
        "min_snapshots_to_keep": 100,
        "state": "enabled"
      }
    },
    "name": "account123_analytics-bucket",
    "status": "active"
  },
  "success": true
}