Skip to content
Start here

Get Sink Details

client.Pipelines.Sinks.Get(ctx, sinkID, query) (*SinkGetResponse, error)
GET/accounts/{account_id}/pipelines/v1/sinks/{sink_id}

Get Sink Details.

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)
Pipelines WritePipelines Read
ParametersExpand Collapse
sinkID string

Specifies the publid ID of the sink.

maxLength32
minLength32
query SinkGetParams
AccountID param.Field[string]

Specifies the public ID of the account.

ReturnsExpand Collapse
type SinkGetResponse struct{…}
ID string

Indicates a unique identifier for this sink.

CreatedAt Time
formatdate-time
ModifiedAt Time
formatdate-time
Name string

Defines the name of the Sink.

maxLength128
minLength1
Type SinkGetResponseType

Specifies the type of sink.

One of the following:
const SinkGetResponseTypeR2 SinkGetResponseType = "r2"
const SinkGetResponseTypeR2DataCatalog SinkGetResponseType = "r2_data_catalog"
Config SinkGetResponseConfigoptional

Defines the configuration of the R2 Sink.

One of the following:
type SinkGetResponseConfigCloudflarePipelinesR2TablePublic struct{…}

R2 Sink public configuration.

AccountID string

Cloudflare Account ID for the bucket

Bucket string

R2 Bucket to write to

FileNaming SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingoptional

Controls filename prefix/suffix and strategy.

Prefix stringoptional

The prefix to use in file name. i.e prefix-.parquet

Strategy SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyoptional

Filename generation strategy.

One of the following:
const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategySerial SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "serial"
const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUID SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid"
const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUIDV7 SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid_v7"
const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUlid SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "ulid"
Suffix stringoptional

This will overwrite the default file suffix. i.e .parquet, use with caution

Jurisdiction stringoptional

Jurisdiction this bucket is hosted in

Partitioning SinkGetResponseConfigCloudflarePipelinesR2TablePublicPartitioningoptional

Data-layout partitioning for sinks.

TimePattern stringoptional

The pattern of the date string

Path stringoptional

Subpath within the bucket to write to

RollingPolicy SinkGetResponseConfigCloudflarePipelinesR2TablePublicRollingPolicyoptional

Rolling policy for file sinks (when & why to close a file and open a new one).

FileSizeBytes int64optional

Files will be rolled after reaching this number of bytes

formatuint64
minimum0
InactivitySeconds int64optional

Number of seconds of inactivity to wait before rolling over to a new file

formatuint64
minimum1
IntervalSeconds int64optional

Number of seconds to wait before rolling over to a new file

formatuint64
minimum1
type SinkGetResponseConfigCloudflarePipelinesR2DataCatalogTablePublic struct{…}

R2 Data Catalog Sink public configuration.

AccountID string

Cloudflare Account ID

formaturi
Bucket string

The R2 Bucket that hosts this catalog

TableName string

Table name

Namespace stringoptional

Table namespace

RollingPolicy SinkGetResponseConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicyoptional

Rolling policy for file sinks (when & why to close a file and open a new one).

FileSizeBytes int64optional

Files will be rolled after reaching this number of bytes

formatuint64
minimum0
InactivitySeconds int64optional

Number of seconds of inactivity to wait before rolling over to a new file

formatuint64
minimum1
IntervalSeconds int64optional

Number of seconds to wait before rolling over to a new file

formatuint64
minimum1
Format SinkGetResponseFormatoptional
One of the following:
type SinkGetResponseFormatJson struct{…}
Type SinkGetResponseFormatJsonType
DecimalEncoding SinkGetResponseFormatJsonDecimalEncodingoptional
One of the following:
const SinkGetResponseFormatJsonDecimalEncodingNumber SinkGetResponseFormatJsonDecimalEncoding = "number"
const SinkGetResponseFormatJsonDecimalEncodingString SinkGetResponseFormatJsonDecimalEncoding = "string"
const SinkGetResponseFormatJsonDecimalEncodingBytes SinkGetResponseFormatJsonDecimalEncoding = "bytes"
TimestampFormat SinkGetResponseFormatJsonTimestampFormatoptional
One of the following:
const SinkGetResponseFormatJsonTimestampFormatRfc3339 SinkGetResponseFormatJsonTimestampFormat = "rfc3339"
const SinkGetResponseFormatJsonTimestampFormatUnixMillis SinkGetResponseFormatJsonTimestampFormat = "unix_millis"
Unstructured booloptional
type SinkGetResponseFormatParquet struct{…}
Type SinkGetResponseFormatParquetType
Compression SinkGetResponseFormatParquetCompressionoptional
One of the following:
const SinkGetResponseFormatParquetCompressionUncompressed SinkGetResponseFormatParquetCompression = "uncompressed"
const SinkGetResponseFormatParquetCompressionSnappy SinkGetResponseFormatParquetCompression = "snappy"
const SinkGetResponseFormatParquetCompressionGzip SinkGetResponseFormatParquetCompression = "gzip"
const SinkGetResponseFormatParquetCompressionZstd SinkGetResponseFormatParquetCompression = "zstd"
const SinkGetResponseFormatParquetCompressionLz4 SinkGetResponseFormatParquetCompression = "lz4"
RowGroupBytes int64optional
formatint64
minimum0
Schema SinkGetResponseSchemaoptional
Fields []SinkGetResponseSchemaFieldoptional
One of the following:
type SinkGetResponseSchemaFieldsInt32 struct{…}
Type SinkGetResponseSchemaFieldsInt32Type
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsInt64 struct{…}
Type SinkGetResponseSchemaFieldsInt64Type
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsFloat32 struct{…}
Type SinkGetResponseSchemaFieldsFloat32Type
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsFloat64 struct{…}
Type SinkGetResponseSchemaFieldsFloat64Type
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsBool struct{…}
Type SinkGetResponseSchemaFieldsBoolType
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsString struct{…}
Type SinkGetResponseSchemaFieldsStringType
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsBinary struct{…}
Type SinkGetResponseSchemaFieldsBinaryType
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsTimestamp struct{…}
Type SinkGetResponseSchemaFieldsTimestampType
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
Unit SinkGetResponseSchemaFieldsTimestampUnitoptional
One of the following:
const SinkGetResponseSchemaFieldsTimestampUnitSecond SinkGetResponseSchemaFieldsTimestampUnit = "second"
const SinkGetResponseSchemaFieldsTimestampUnitMillisecond SinkGetResponseSchemaFieldsTimestampUnit = "millisecond"
const SinkGetResponseSchemaFieldsTimestampUnitMicrosecond SinkGetResponseSchemaFieldsTimestampUnit = "microsecond"
const SinkGetResponseSchemaFieldsTimestampUnitNanosecond SinkGetResponseSchemaFieldsTimestampUnit = "nanosecond"
type SinkGetResponseSchemaFieldsJson struct{…}
Type SinkGetResponseSchemaFieldsJsonType
MetadataKey stringoptional
Name stringoptional
Required booloptional
SqlName stringoptional
type SinkGetResponseSchemaFieldsStruct struct{…}
type SinkGetResponseSchemaFieldsList struct{…}
Format SinkGetResponseSchemaFormatoptional
One of the following:
type SinkGetResponseSchemaFormatJson struct{…}
Type SinkGetResponseSchemaFormatJsonType
DecimalEncoding SinkGetResponseSchemaFormatJsonDecimalEncodingoptional
One of the following:
const SinkGetResponseSchemaFormatJsonDecimalEncodingNumber SinkGetResponseSchemaFormatJsonDecimalEncoding = "number"
const SinkGetResponseSchemaFormatJsonDecimalEncodingString SinkGetResponseSchemaFormatJsonDecimalEncoding = "string"
const SinkGetResponseSchemaFormatJsonDecimalEncodingBytes SinkGetResponseSchemaFormatJsonDecimalEncoding = "bytes"
TimestampFormat SinkGetResponseSchemaFormatJsonTimestampFormatoptional
One of the following:
const SinkGetResponseSchemaFormatJsonTimestampFormatRfc3339 SinkGetResponseSchemaFormatJsonTimestampFormat = "rfc3339"
const SinkGetResponseSchemaFormatJsonTimestampFormatUnixMillis SinkGetResponseSchemaFormatJsonTimestampFormat = "unix_millis"
Unstructured booloptional
type SinkGetResponseSchemaFormatParquet struct{…}
Type SinkGetResponseSchemaFormatParquetType
Compression SinkGetResponseSchemaFormatParquetCompressionoptional
One of the following:
const SinkGetResponseSchemaFormatParquetCompressionUncompressed SinkGetResponseSchemaFormatParquetCompression = "uncompressed"
const SinkGetResponseSchemaFormatParquetCompressionSnappy SinkGetResponseSchemaFormatParquetCompression = "snappy"
const SinkGetResponseSchemaFormatParquetCompressionGzip SinkGetResponseSchemaFormatParquetCompression = "gzip"
const SinkGetResponseSchemaFormatParquetCompressionZstd SinkGetResponseSchemaFormatParquetCompression = "zstd"
const SinkGetResponseSchemaFormatParquetCompressionLz4 SinkGetResponseSchemaFormatParquetCompression = "lz4"
RowGroupBytes int64optional
formatint64
minimum0
Inferred booloptional

Get Sink Details

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  sink, err := client.Pipelines.Sinks.Get(
    context.TODO(),
    "0223105f4ecef8ad9ca31a8372d0c353",
    pipelines.SinkGetParams{
      AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", sink.ID)
}
{
  "result": {
    "id": "01234567890123457689012345678901",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "my_sink",
    "type": "r2",
    "config": {
      "account_id": "account_id",
      "bucket": "bucket",
      "file_naming": {
        "prefix": "prefix",
        "strategy": "serial",
        "suffix": "suffix"
      },
      "jurisdiction": "jurisdiction",
      "partitioning": {
        "time_pattern": "year=%Y/month=%m/day=%d/hour=%H"
      },
      "path": "path",
      "rolling_policy": {
        "file_size_bytes": 0,
        "inactivity_seconds": 1,
        "interval_seconds": 1
      }
    },
    "format": {
      "type": "json",
      "decimal_encoding": "number",
      "timestamp_format": "rfc3339",
      "unstructured": true
    },
    "schema": {
      "fields": [
        {
          "type": "int32",
          "metadata_key": "metadata_key",
          "name": "name",
          "required": true,
          "sql_name": "sql_name"
        }
      ],
      "format": {
        "type": "json",
        "decimal_encoding": "number",
        "timestamp_format": "rfc3339",
        "unstructured": true
      },
      "inferred": true
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "01234567890123457689012345678901",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "name": "my_sink",
    "type": "r2",
    "config": {
      "account_id": "account_id",
      "bucket": "bucket",
      "file_naming": {
        "prefix": "prefix",
        "strategy": "serial",
        "suffix": "suffix"
      },
      "jurisdiction": "jurisdiction",
      "partitioning": {
        "time_pattern": "year=%Y/month=%m/day=%d/hour=%H"
      },
      "path": "path",
      "rolling_policy": {
        "file_size_bytes": 0,
        "inactivity_seconds": 1,
        "interval_seconds": 1
      }
    },
    "format": {
      "type": "json",
      "decimal_encoding": "number",
      "timestamp_format": "rfc3339",
      "unstructured": true
    },
    "schema": {
      "fields": [
        {
          "type": "int32",
          "metadata_key": "metadata_key",
          "name": "name",
          "required": true,
          "sql_name": "sql_name"
        }
      ],
      "format": {
        "type": "json",
        "decimal_encoding": "number",
        "timestamp_format": "rfc3339",
        "unstructured": true
      },
      "inferred": true
    }
  },
  "success": true
}