# Sinks ## List Sinks `client.Pipelines.Sinks.List(ctx, params) (*V4PagePaginationArray[SinkListResponse], error)` **get** `/accounts/{account_id}/pipelines/v1/sinks` List/Filter Sinks in Account. ### Parameters - `params SinkListParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Page param.Field[float64]` Query param - `PerPage param.Field[float64]` Query param - `PipelineID param.Field[string]` Query param ### Returns - `type SinkListResponse struct{…}` - `ID string` Indicates a unique identifier for this sink. - `CreatedAt Time` - `ModifiedAt Time` - `Name string` Defines the name of the Sink. - `Type SinkListResponseType` Specifies the type of sink. - `const SinkListResponseTypeR2 SinkListResponseType = "r2"` - `const SinkListResponseTypeR2DataCatalog SinkListResponseType = "r2_data_catalog"` - `Config SinkListResponseConfig` Defines the configuration of the R2 Sink. - `type SinkListResponseConfigCloudflarePipelinesR2TablePublic struct{…}` R2 Sink public configuration. - `AccountID string` Cloudflare Account ID for the bucket - `Bucket string` R2 Bucket to write to - `FileNaming SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNaming` Controls filename prefix/suffix and strategy. - `Prefix string` The prefix to use in file name. i.e prefix-.parquet - `Strategy SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy` Filename generation strategy. - `const SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategySerial SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "serial"` - `const SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUID SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid"` - `const SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUIDV7 SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid_v7"` - `const SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUlid SinkListResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "ulid"` - `Suffix string` This will overwrite the default file suffix. i.e .parquet, use with caution - `Jurisdiction string` Jurisdiction this bucket is hosted in - `Partitioning SinkListResponseConfigCloudflarePipelinesR2TablePublicPartitioning` Data-layout partitioning for sinks. - `TimePattern string` The pattern of the date string - `Path string` Subpath within the bucket to write to - `RollingPolicy SinkListResponseConfigCloudflarePipelinesR2TablePublicRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `type SinkListResponseConfigCloudflarePipelinesR2DataCatalogTablePublic struct{…}` R2 Data Catalog Sink public configuration. - `AccountID string` Cloudflare Account ID - `Bucket string` The R2 Bucket that hosts this catalog - `TableName string` Table name - `Namespace string` Table namespace - `RollingPolicy SinkListResponseConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `Format SinkListResponseFormat` - `type SinkListResponseFormatJson struct{…}` - `Type SinkListResponseFormatJsonType` - `const SinkListResponseFormatJsonTypeJson SinkListResponseFormatJsonType = "json"` - `DecimalEncoding SinkListResponseFormatJsonDecimalEncoding` - `const SinkListResponseFormatJsonDecimalEncodingNumber SinkListResponseFormatJsonDecimalEncoding = "number"` - `const SinkListResponseFormatJsonDecimalEncodingString SinkListResponseFormatJsonDecimalEncoding = "string"` - `const SinkListResponseFormatJsonDecimalEncodingBytes SinkListResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkListResponseFormatJsonTimestampFormat` - `const SinkListResponseFormatJsonTimestampFormatRfc3339 SinkListResponseFormatJsonTimestampFormat = "rfc3339"` - `const SinkListResponseFormatJsonTimestampFormatUnixMillis SinkListResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkListResponseFormatParquet struct{…}` - `Type SinkListResponseFormatParquetType` - `const SinkListResponseFormatParquetTypeParquet SinkListResponseFormatParquetType = "parquet"` - `Compression SinkListResponseFormatParquetCompression` - `const SinkListResponseFormatParquetCompressionUncompressed SinkListResponseFormatParquetCompression = "uncompressed"` - `const SinkListResponseFormatParquetCompressionSnappy SinkListResponseFormatParquetCompression = "snappy"` - `const SinkListResponseFormatParquetCompressionGzip SinkListResponseFormatParquetCompression = "gzip"` - `const SinkListResponseFormatParquetCompressionZstd SinkListResponseFormatParquetCompression = "zstd"` - `const SinkListResponseFormatParquetCompressionLz4 SinkListResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema SinkListResponseSchema` - `Fields []SinkListResponseSchemaField` - `type SinkListResponseSchemaFieldsInt32 struct{…}` - `Type SinkListResponseSchemaFieldsInt32Type` - `const SinkListResponseSchemaFieldsInt32TypeInt32 SinkListResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsInt64 struct{…}` - `Type SinkListResponseSchemaFieldsInt64Type` - `const SinkListResponseSchemaFieldsInt64TypeInt64 SinkListResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsFloat32 struct{…}` - `Type SinkListResponseSchemaFieldsFloat32Type` - `const SinkListResponseSchemaFieldsFloat32TypeFloat32 SinkListResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsFloat64 struct{…}` - `Type SinkListResponseSchemaFieldsFloat64Type` - `const SinkListResponseSchemaFieldsFloat64TypeFloat64 SinkListResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsBool struct{…}` - `Type SinkListResponseSchemaFieldsBoolType` - `const SinkListResponseSchemaFieldsBoolTypeBool SinkListResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsString struct{…}` - `Type SinkListResponseSchemaFieldsStringType` - `const SinkListResponseSchemaFieldsStringTypeString SinkListResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsBinary struct{…}` - `Type SinkListResponseSchemaFieldsBinaryType` - `const SinkListResponseSchemaFieldsBinaryTypeBinary SinkListResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsTimestamp struct{…}` - `Type SinkListResponseSchemaFieldsTimestampType` - `const SinkListResponseSchemaFieldsTimestampTypeTimestamp SinkListResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit SinkListResponseSchemaFieldsTimestampUnit` - `const SinkListResponseSchemaFieldsTimestampUnitSecond SinkListResponseSchemaFieldsTimestampUnit = "second"` - `const SinkListResponseSchemaFieldsTimestampUnitMillisecond SinkListResponseSchemaFieldsTimestampUnit = "millisecond"` - `const SinkListResponseSchemaFieldsTimestampUnitMicrosecond SinkListResponseSchemaFieldsTimestampUnit = "microsecond"` - `const SinkListResponseSchemaFieldsTimestampUnitNanosecond SinkListResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type SinkListResponseSchemaFieldsJson struct{…}` - `Type SinkListResponseSchemaFieldsJsonType` - `const SinkListResponseSchemaFieldsJsonTypeJson SinkListResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkListResponseSchemaFieldsStruct struct{…}` - `type SinkListResponseSchemaFieldsList struct{…}` - `Format SinkListResponseSchemaFormat` - `type SinkListResponseSchemaFormatJson struct{…}` - `Type SinkListResponseSchemaFormatJsonType` - `const SinkListResponseSchemaFormatJsonTypeJson SinkListResponseSchemaFormatJsonType = "json"` - `DecimalEncoding SinkListResponseSchemaFormatJsonDecimalEncoding` - `const SinkListResponseSchemaFormatJsonDecimalEncodingNumber SinkListResponseSchemaFormatJsonDecimalEncoding = "number"` - `const SinkListResponseSchemaFormatJsonDecimalEncodingString SinkListResponseSchemaFormatJsonDecimalEncoding = "string"` - `const SinkListResponseSchemaFormatJsonDecimalEncodingBytes SinkListResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkListResponseSchemaFormatJsonTimestampFormat` - `const SinkListResponseSchemaFormatJsonTimestampFormatRfc3339 SinkListResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const SinkListResponseSchemaFormatJsonTimestampFormatUnixMillis SinkListResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkListResponseSchemaFormatParquet struct{…}` - `Type SinkListResponseSchemaFormatParquetType` - `const SinkListResponseSchemaFormatParquetTypeParquet SinkListResponseSchemaFormatParquetType = "parquet"` - `Compression SinkListResponseSchemaFormatParquetCompression` - `const SinkListResponseSchemaFormatParquetCompressionUncompressed SinkListResponseSchemaFormatParquetCompression = "uncompressed"` - `const SinkListResponseSchemaFormatParquetCompressionSnappy SinkListResponseSchemaFormatParquetCompression = "snappy"` - `const SinkListResponseSchemaFormatParquetCompressionGzip SinkListResponseSchemaFormatParquetCompression = "gzip"` - `const SinkListResponseSchemaFormatParquetCompressionZstd SinkListResponseSchemaFormatParquetCompression = "zstd"` - `const SinkListResponseSchemaFormatParquetCompressionLz4 SinkListResponseSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` ### Example ```go 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"), ) page, err := client.Pipelines.Sinks.List(context.TODO(), pipelines.SinkListParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "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 } } ], "result_info": { "count": 1, "page": 0, "per_page": 10, "total_count": 1 }, "success": true } ``` ## Get Sink Details `client.Pipelines.Sinks.Get(ctx, sinkID, query) (*SinkGetResponse, error)` **get** `/accounts/{account_id}/pipelines/v1/sinks/{sink_id}` Get Sink Details. ### Parameters - `sinkID string` Specifies the publid ID of the sink. - `query SinkGetParams` - `AccountID param.Field[string]` Specifies the public ID of the account. ### Returns - `type SinkGetResponse struct{…}` - `ID string` Indicates a unique identifier for this sink. - `CreatedAt Time` - `ModifiedAt Time` - `Name string` Defines the name of the Sink. - `Type SinkGetResponseType` Specifies the type of sink. - `const SinkGetResponseTypeR2 SinkGetResponseType = "r2"` - `const SinkGetResponseTypeR2DataCatalog SinkGetResponseType = "r2_data_catalog"` - `Config SinkGetResponseConfig` Defines the configuration of the R2 Sink. - `type SinkGetResponseConfigCloudflarePipelinesR2TablePublic struct{…}` R2 Sink public configuration. - `AccountID string` Cloudflare Account ID for the bucket - `Bucket string` R2 Bucket to write to - `FileNaming SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNaming` Controls filename prefix/suffix and strategy. - `Prefix string` The prefix to use in file name. i.e prefix-.parquet - `Strategy SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy` Filename generation strategy. - `const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategySerial SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "serial"` - `const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUID SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid"` - `const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUUIDV7 SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "uuid_v7"` - `const SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategyUlid SinkGetResponseConfigCloudflarePipelinesR2TablePublicFileNamingStrategy = "ulid"` - `Suffix string` This will overwrite the default file suffix. i.e .parquet, use with caution - `Jurisdiction string` Jurisdiction this bucket is hosted in - `Partitioning SinkGetResponseConfigCloudflarePipelinesR2TablePublicPartitioning` Data-layout partitioning for sinks. - `TimePattern string` The pattern of the date string - `Path string` Subpath within the bucket to write to - `RollingPolicy SinkGetResponseConfigCloudflarePipelinesR2TablePublicRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `type SinkGetResponseConfigCloudflarePipelinesR2DataCatalogTablePublic struct{…}` R2 Data Catalog Sink public configuration. - `AccountID string` Cloudflare Account ID - `Bucket string` The R2 Bucket that hosts this catalog - `TableName string` Table name - `Namespace string` Table namespace - `RollingPolicy SinkGetResponseConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `Format SinkGetResponseFormat` - `type SinkGetResponseFormatJson struct{…}` - `Type SinkGetResponseFormatJsonType` - `const SinkGetResponseFormatJsonTypeJson SinkGetResponseFormatJsonType = "json"` - `DecimalEncoding SinkGetResponseFormatJsonDecimalEncoding` - `const SinkGetResponseFormatJsonDecimalEncodingNumber SinkGetResponseFormatJsonDecimalEncoding = "number"` - `const SinkGetResponseFormatJsonDecimalEncodingString SinkGetResponseFormatJsonDecimalEncoding = "string"` - `const SinkGetResponseFormatJsonDecimalEncodingBytes SinkGetResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkGetResponseFormatJsonTimestampFormat` - `const SinkGetResponseFormatJsonTimestampFormatRfc3339 SinkGetResponseFormatJsonTimestampFormat = "rfc3339"` - `const SinkGetResponseFormatJsonTimestampFormatUnixMillis SinkGetResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkGetResponseFormatParquet struct{…}` - `Type SinkGetResponseFormatParquetType` - `const SinkGetResponseFormatParquetTypeParquet SinkGetResponseFormatParquetType = "parquet"` - `Compression SinkGetResponseFormatParquetCompression` - `const SinkGetResponseFormatParquetCompressionUncompressed SinkGetResponseFormatParquetCompression = "uncompressed"` - `const SinkGetResponseFormatParquetCompressionSnappy SinkGetResponseFormatParquetCompression = "snappy"` - `const SinkGetResponseFormatParquetCompressionGzip SinkGetResponseFormatParquetCompression = "gzip"` - `const SinkGetResponseFormatParquetCompressionZstd SinkGetResponseFormatParquetCompression = "zstd"` - `const SinkGetResponseFormatParquetCompressionLz4 SinkGetResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema SinkGetResponseSchema` - `Fields []SinkGetResponseSchemaField` - `type SinkGetResponseSchemaFieldsInt32 struct{…}` - `Type SinkGetResponseSchemaFieldsInt32Type` - `const SinkGetResponseSchemaFieldsInt32TypeInt32 SinkGetResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsInt64 struct{…}` - `Type SinkGetResponseSchemaFieldsInt64Type` - `const SinkGetResponseSchemaFieldsInt64TypeInt64 SinkGetResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsFloat32 struct{…}` - `Type SinkGetResponseSchemaFieldsFloat32Type` - `const SinkGetResponseSchemaFieldsFloat32TypeFloat32 SinkGetResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsFloat64 struct{…}` - `Type SinkGetResponseSchemaFieldsFloat64Type` - `const SinkGetResponseSchemaFieldsFloat64TypeFloat64 SinkGetResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsBool struct{…}` - `Type SinkGetResponseSchemaFieldsBoolType` - `const SinkGetResponseSchemaFieldsBoolTypeBool SinkGetResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsString struct{…}` - `Type SinkGetResponseSchemaFieldsStringType` - `const SinkGetResponseSchemaFieldsStringTypeString SinkGetResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsBinary struct{…}` - `Type SinkGetResponseSchemaFieldsBinaryType` - `const SinkGetResponseSchemaFieldsBinaryTypeBinary SinkGetResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsTimestamp struct{…}` - `Type SinkGetResponseSchemaFieldsTimestampType` - `const SinkGetResponseSchemaFieldsTimestampTypeTimestamp SinkGetResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit SinkGetResponseSchemaFieldsTimestampUnit` - `const SinkGetResponseSchemaFieldsTimestampUnitSecond SinkGetResponseSchemaFieldsTimestampUnit = "second"` - `const SinkGetResponseSchemaFieldsTimestampUnitMillisecond SinkGetResponseSchemaFieldsTimestampUnit = "millisecond"` - `const SinkGetResponseSchemaFieldsTimestampUnitMicrosecond SinkGetResponseSchemaFieldsTimestampUnit = "microsecond"` - `const SinkGetResponseSchemaFieldsTimestampUnitNanosecond SinkGetResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type SinkGetResponseSchemaFieldsJson struct{…}` - `Type SinkGetResponseSchemaFieldsJsonType` - `const SinkGetResponseSchemaFieldsJsonTypeJson SinkGetResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkGetResponseSchemaFieldsStruct struct{…}` - `type SinkGetResponseSchemaFieldsList struct{…}` - `Format SinkGetResponseSchemaFormat` - `type SinkGetResponseSchemaFormatJson struct{…}` - `Type SinkGetResponseSchemaFormatJsonType` - `const SinkGetResponseSchemaFormatJsonTypeJson SinkGetResponseSchemaFormatJsonType = "json"` - `DecimalEncoding SinkGetResponseSchemaFormatJsonDecimalEncoding` - `const SinkGetResponseSchemaFormatJsonDecimalEncodingNumber SinkGetResponseSchemaFormatJsonDecimalEncoding = "number"` - `const SinkGetResponseSchemaFormatJsonDecimalEncodingString SinkGetResponseSchemaFormatJsonDecimalEncoding = "string"` - `const SinkGetResponseSchemaFormatJsonDecimalEncodingBytes SinkGetResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkGetResponseSchemaFormatJsonTimestampFormat` - `const SinkGetResponseSchemaFormatJsonTimestampFormatRfc3339 SinkGetResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const SinkGetResponseSchemaFormatJsonTimestampFormatUnixMillis SinkGetResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkGetResponseSchemaFormatParquet struct{…}` - `Type SinkGetResponseSchemaFormatParquetType` - `const SinkGetResponseSchemaFormatParquetTypeParquet SinkGetResponseSchemaFormatParquetType = "parquet"` - `Compression SinkGetResponseSchemaFormatParquetCompression` - `const SinkGetResponseSchemaFormatParquetCompressionUncompressed SinkGetResponseSchemaFormatParquetCompression = "uncompressed"` - `const SinkGetResponseSchemaFormatParquetCompressionSnappy SinkGetResponseSchemaFormatParquetCompression = "snappy"` - `const SinkGetResponseSchemaFormatParquetCompressionGzip SinkGetResponseSchemaFormatParquetCompression = "gzip"` - `const SinkGetResponseSchemaFormatParquetCompressionZstd SinkGetResponseSchemaFormatParquetCompression = "zstd"` - `const SinkGetResponseSchemaFormatParquetCompressionLz4 SinkGetResponseSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` ### Example ```go 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) } ``` #### Response ```json { "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 } ``` ## Create Sink `client.Pipelines.Sinks.New(ctx, params) (*SinkNewResponse, error)` **post** `/accounts/{account_id}/pipelines/v1/sinks` Create a new Sink. ### Parameters - `params SinkNewParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Name param.Field[string]` Body param: Defines the name of the Sink. - `Type param.Field[SinkNewParamsType]` Body param: Specifies the type of sink. - `const SinkNewParamsTypeR2 SinkNewParamsType = "r2"` - `const SinkNewParamsTypeR2DataCatalog SinkNewParamsType = "r2_data_catalog"` - `Config param.Field[SinkNewParamsConfig]` Body param: Defines the configuration of the R2 Sink. - `type SinkNewParamsConfigCloudflarePipelinesR2Table struct{…}` - `AccountID string` Cloudflare Account ID for the bucket - `Bucket string` R2 Bucket to write to - `Credentials SinkNewParamsConfigCloudflarePipelinesR2TableCredentials` - `AccessKeyID string` Cloudflare Account ID for the bucket - `SecretAccessKey string` Cloudflare Account ID for the bucket - `FileNaming SinkNewParamsConfigCloudflarePipelinesR2TableFileNaming` Controls filename prefix/suffix and strategy. - `Prefix string` The prefix to use in file name. i.e prefix-.parquet - `Strategy SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategy` Filename generation strategy. - `const SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategySerial SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategy = "serial"` - `const SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategyUUID SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategy = "uuid"` - `const SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategyUUIDV7 SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategy = "uuid_v7"` - `const SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategyUlid SinkNewParamsConfigCloudflarePipelinesR2TableFileNamingStrategy = "ulid"` - `Suffix string` This will overwrite the default file suffix. i.e .parquet, use with caution - `Jurisdiction string` Jurisdiction this bucket is hosted in - `Partitioning SinkNewParamsConfigCloudflarePipelinesR2TablePartitioning` Data-layout partitioning for sinks. - `TimePattern string` The pattern of the date string - `Path string` Subpath within the bucket to write to - `RollingPolicy SinkNewParamsConfigCloudflarePipelinesR2TableRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `type SinkNewParamsConfigCloudflarePipelinesR2DataCatalogTable struct{…}` R2 Data Catalog Sink - `Token string` Authentication token - `AccountID string` Cloudflare Account ID - `Bucket string` The R2 Bucket that hosts this catalog - `TableName string` Table name - `Namespace string` Table namespace - `RollingPolicy SinkNewParamsConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `Format param.Field[SinkNewParamsFormat]` Body param - `type SinkNewParamsFormatJson struct{…}` - `Type SinkNewParamsFormatJsonType` - `const SinkNewParamsFormatJsonTypeJson SinkNewParamsFormatJsonType = "json"` - `DecimalEncoding SinkNewParamsFormatJsonDecimalEncoding` - `const SinkNewParamsFormatJsonDecimalEncodingNumber SinkNewParamsFormatJsonDecimalEncoding = "number"` - `const SinkNewParamsFormatJsonDecimalEncodingString SinkNewParamsFormatJsonDecimalEncoding = "string"` - `const SinkNewParamsFormatJsonDecimalEncodingBytes SinkNewParamsFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkNewParamsFormatJsonTimestampFormat` - `const SinkNewParamsFormatJsonTimestampFormatRfc3339 SinkNewParamsFormatJsonTimestampFormat = "rfc3339"` - `const SinkNewParamsFormatJsonTimestampFormatUnixMillis SinkNewParamsFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkNewParamsFormatParquet struct{…}` - `Type SinkNewParamsFormatParquetType` - `const SinkNewParamsFormatParquetTypeParquet SinkNewParamsFormatParquetType = "parquet"` - `Compression SinkNewParamsFormatParquetCompression` - `const SinkNewParamsFormatParquetCompressionUncompressed SinkNewParamsFormatParquetCompression = "uncompressed"` - `const SinkNewParamsFormatParquetCompressionSnappy SinkNewParamsFormatParquetCompression = "snappy"` - `const SinkNewParamsFormatParquetCompressionGzip SinkNewParamsFormatParquetCompression = "gzip"` - `const SinkNewParamsFormatParquetCompressionZstd SinkNewParamsFormatParquetCompression = "zstd"` - `const SinkNewParamsFormatParquetCompressionLz4 SinkNewParamsFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema param.Field[SinkNewParamsSchema]` Body param - `Fields []SinkNewParamsSchemaField` - `type SinkNewParamsSchemaFieldsInt32 struct{…}` - `Type SinkNewParamsSchemaFieldsInt32Type` - `const SinkNewParamsSchemaFieldsInt32TypeInt32 SinkNewParamsSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsInt64 struct{…}` - `Type SinkNewParamsSchemaFieldsInt64Type` - `const SinkNewParamsSchemaFieldsInt64TypeInt64 SinkNewParamsSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsFloat32 struct{…}` - `Type SinkNewParamsSchemaFieldsFloat32Type` - `const SinkNewParamsSchemaFieldsFloat32TypeFloat32 SinkNewParamsSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsFloat64 struct{…}` - `Type SinkNewParamsSchemaFieldsFloat64Type` - `const SinkNewParamsSchemaFieldsFloat64TypeFloat64 SinkNewParamsSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsBool struct{…}` - `Type SinkNewParamsSchemaFieldsBoolType` - `const SinkNewParamsSchemaFieldsBoolTypeBool SinkNewParamsSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsString struct{…}` - `Type SinkNewParamsSchemaFieldsStringType` - `const SinkNewParamsSchemaFieldsStringTypeString SinkNewParamsSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsBinary struct{…}` - `Type SinkNewParamsSchemaFieldsBinaryType` - `const SinkNewParamsSchemaFieldsBinaryTypeBinary SinkNewParamsSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsTimestamp struct{…}` - `Type SinkNewParamsSchemaFieldsTimestampType` - `const SinkNewParamsSchemaFieldsTimestampTypeTimestamp SinkNewParamsSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit SinkNewParamsSchemaFieldsTimestampUnit` - `const SinkNewParamsSchemaFieldsTimestampUnitSecond SinkNewParamsSchemaFieldsTimestampUnit = "second"` - `const SinkNewParamsSchemaFieldsTimestampUnitMillisecond SinkNewParamsSchemaFieldsTimestampUnit = "millisecond"` - `const SinkNewParamsSchemaFieldsTimestampUnitMicrosecond SinkNewParamsSchemaFieldsTimestampUnit = "microsecond"` - `const SinkNewParamsSchemaFieldsTimestampUnitNanosecond SinkNewParamsSchemaFieldsTimestampUnit = "nanosecond"` - `type SinkNewParamsSchemaFieldsJson struct{…}` - `Type SinkNewParamsSchemaFieldsJsonType` - `const SinkNewParamsSchemaFieldsJsonTypeJson SinkNewParamsSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewParamsSchemaFieldsStruct struct{…}` - `type SinkNewParamsSchemaFieldsList struct{…}` - `Format SinkNewParamsSchemaFormat` - `type SinkNewParamsSchemaFormatJson struct{…}` - `Type SinkNewParamsSchemaFormatJsonType` - `const SinkNewParamsSchemaFormatJsonTypeJson SinkNewParamsSchemaFormatJsonType = "json"` - `DecimalEncoding SinkNewParamsSchemaFormatJsonDecimalEncoding` - `const SinkNewParamsSchemaFormatJsonDecimalEncodingNumber SinkNewParamsSchemaFormatJsonDecimalEncoding = "number"` - `const SinkNewParamsSchemaFormatJsonDecimalEncodingString SinkNewParamsSchemaFormatJsonDecimalEncoding = "string"` - `const SinkNewParamsSchemaFormatJsonDecimalEncodingBytes SinkNewParamsSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkNewParamsSchemaFormatJsonTimestampFormat` - `const SinkNewParamsSchemaFormatJsonTimestampFormatRfc3339 SinkNewParamsSchemaFormatJsonTimestampFormat = "rfc3339"` - `const SinkNewParamsSchemaFormatJsonTimestampFormatUnixMillis SinkNewParamsSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkNewParamsSchemaFormatParquet struct{…}` - `Type SinkNewParamsSchemaFormatParquetType` - `const SinkNewParamsSchemaFormatParquetTypeParquet SinkNewParamsSchemaFormatParquetType = "parquet"` - `Compression SinkNewParamsSchemaFormatParquetCompression` - `const SinkNewParamsSchemaFormatParquetCompressionUncompressed SinkNewParamsSchemaFormatParquetCompression = "uncompressed"` - `const SinkNewParamsSchemaFormatParquetCompressionSnappy SinkNewParamsSchemaFormatParquetCompression = "snappy"` - `const SinkNewParamsSchemaFormatParquetCompressionGzip SinkNewParamsSchemaFormatParquetCompression = "gzip"` - `const SinkNewParamsSchemaFormatParquetCompressionZstd SinkNewParamsSchemaFormatParquetCompression = "zstd"` - `const SinkNewParamsSchemaFormatParquetCompressionLz4 SinkNewParamsSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` ### Returns - `type SinkNewResponse struct{…}` - `ID string` Indicates a unique identifier for this sink. - `CreatedAt Time` - `ModifiedAt Time` - `Name string` Defines the name of the Sink. - `Type SinkNewResponseType` Specifies the type of sink. - `const SinkNewResponseTypeR2 SinkNewResponseType = "r2"` - `const SinkNewResponseTypeR2DataCatalog SinkNewResponseType = "r2_data_catalog"` - `Config SinkNewResponseConfig` R2 Data Catalog Sink - `type SinkNewResponseConfigCloudflarePipelinesR2Table struct{…}` - `AccountID string` Cloudflare Account ID for the bucket - `Bucket string` R2 Bucket to write to - `Credentials SinkNewResponseConfigCloudflarePipelinesR2TableCredentials` - `AccessKeyID string` Cloudflare Account ID for the bucket - `SecretAccessKey string` Cloudflare Account ID for the bucket - `FileNaming SinkNewResponseConfigCloudflarePipelinesR2TableFileNaming` Controls filename prefix/suffix and strategy. - `Prefix string` The prefix to use in file name. i.e prefix-.parquet - `Strategy SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategy` Filename generation strategy. - `const SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategySerial SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategy = "serial"` - `const SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategyUUID SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategy = "uuid"` - `const SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategyUUIDV7 SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategy = "uuid_v7"` - `const SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategyUlid SinkNewResponseConfigCloudflarePipelinesR2TableFileNamingStrategy = "ulid"` - `Suffix string` This will overwrite the default file suffix. i.e .parquet, use with caution - `Jurisdiction string` Jurisdiction this bucket is hosted in - `Partitioning SinkNewResponseConfigCloudflarePipelinesR2TablePartitioning` Data-layout partitioning for sinks. - `TimePattern string` The pattern of the date string - `Path string` Subpath within the bucket to write to - `RollingPolicy SinkNewResponseConfigCloudflarePipelinesR2TableRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `type SinkNewResponseConfigCloudflarePipelinesR2DataCatalogTable struct{…}` R2 Data Catalog Sink - `Token string` Authentication token - `AccountID string` Cloudflare Account ID - `Bucket string` The R2 Bucket that hosts this catalog - `TableName string` Table name - `Namespace string` Table namespace - `RollingPolicy SinkNewResponseConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy` Rolling policy for file sinks (when & why to close a file and open a new one). - `FileSizeBytes int64` Files will be rolled after reaching this number of bytes - `InactivitySeconds int64` Number of seconds of inactivity to wait before rolling over to a new file - `IntervalSeconds int64` Number of seconds to wait before rolling over to a new file - `Format SinkNewResponseFormat` - `type SinkNewResponseFormatJson struct{…}` - `Type SinkNewResponseFormatJsonType` - `const SinkNewResponseFormatJsonTypeJson SinkNewResponseFormatJsonType = "json"` - `DecimalEncoding SinkNewResponseFormatJsonDecimalEncoding` - `const SinkNewResponseFormatJsonDecimalEncodingNumber SinkNewResponseFormatJsonDecimalEncoding = "number"` - `const SinkNewResponseFormatJsonDecimalEncodingString SinkNewResponseFormatJsonDecimalEncoding = "string"` - `const SinkNewResponseFormatJsonDecimalEncodingBytes SinkNewResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkNewResponseFormatJsonTimestampFormat` - `const SinkNewResponseFormatJsonTimestampFormatRfc3339 SinkNewResponseFormatJsonTimestampFormat = "rfc3339"` - `const SinkNewResponseFormatJsonTimestampFormatUnixMillis SinkNewResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkNewResponseFormatParquet struct{…}` - `Type SinkNewResponseFormatParquetType` - `const SinkNewResponseFormatParquetTypeParquet SinkNewResponseFormatParquetType = "parquet"` - `Compression SinkNewResponseFormatParquetCompression` - `const SinkNewResponseFormatParquetCompressionUncompressed SinkNewResponseFormatParquetCompression = "uncompressed"` - `const SinkNewResponseFormatParquetCompressionSnappy SinkNewResponseFormatParquetCompression = "snappy"` - `const SinkNewResponseFormatParquetCompressionGzip SinkNewResponseFormatParquetCompression = "gzip"` - `const SinkNewResponseFormatParquetCompressionZstd SinkNewResponseFormatParquetCompression = "zstd"` - `const SinkNewResponseFormatParquetCompressionLz4 SinkNewResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema SinkNewResponseSchema` - `Fields []SinkNewResponseSchemaField` - `type SinkNewResponseSchemaFieldsInt32 struct{…}` - `Type SinkNewResponseSchemaFieldsInt32Type` - `const SinkNewResponseSchemaFieldsInt32TypeInt32 SinkNewResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsInt64 struct{…}` - `Type SinkNewResponseSchemaFieldsInt64Type` - `const SinkNewResponseSchemaFieldsInt64TypeInt64 SinkNewResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsFloat32 struct{…}` - `Type SinkNewResponseSchemaFieldsFloat32Type` - `const SinkNewResponseSchemaFieldsFloat32TypeFloat32 SinkNewResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsFloat64 struct{…}` - `Type SinkNewResponseSchemaFieldsFloat64Type` - `const SinkNewResponseSchemaFieldsFloat64TypeFloat64 SinkNewResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsBool struct{…}` - `Type SinkNewResponseSchemaFieldsBoolType` - `const SinkNewResponseSchemaFieldsBoolTypeBool SinkNewResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsString struct{…}` - `Type SinkNewResponseSchemaFieldsStringType` - `const SinkNewResponseSchemaFieldsStringTypeString SinkNewResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsBinary struct{…}` - `Type SinkNewResponseSchemaFieldsBinaryType` - `const SinkNewResponseSchemaFieldsBinaryTypeBinary SinkNewResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsTimestamp struct{…}` - `Type SinkNewResponseSchemaFieldsTimestampType` - `const SinkNewResponseSchemaFieldsTimestampTypeTimestamp SinkNewResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit SinkNewResponseSchemaFieldsTimestampUnit` - `const SinkNewResponseSchemaFieldsTimestampUnitSecond SinkNewResponseSchemaFieldsTimestampUnit = "second"` - `const SinkNewResponseSchemaFieldsTimestampUnitMillisecond SinkNewResponseSchemaFieldsTimestampUnit = "millisecond"` - `const SinkNewResponseSchemaFieldsTimestampUnitMicrosecond SinkNewResponseSchemaFieldsTimestampUnit = "microsecond"` - `const SinkNewResponseSchemaFieldsTimestampUnitNanosecond SinkNewResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type SinkNewResponseSchemaFieldsJson struct{…}` - `Type SinkNewResponseSchemaFieldsJsonType` - `const SinkNewResponseSchemaFieldsJsonTypeJson SinkNewResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type SinkNewResponseSchemaFieldsStruct struct{…}` - `type SinkNewResponseSchemaFieldsList struct{…}` - `Format SinkNewResponseSchemaFormat` - `type SinkNewResponseSchemaFormatJson struct{…}` - `Type SinkNewResponseSchemaFormatJsonType` - `const SinkNewResponseSchemaFormatJsonTypeJson SinkNewResponseSchemaFormatJsonType = "json"` - `DecimalEncoding SinkNewResponseSchemaFormatJsonDecimalEncoding` - `const SinkNewResponseSchemaFormatJsonDecimalEncodingNumber SinkNewResponseSchemaFormatJsonDecimalEncoding = "number"` - `const SinkNewResponseSchemaFormatJsonDecimalEncodingString SinkNewResponseSchemaFormatJsonDecimalEncoding = "string"` - `const SinkNewResponseSchemaFormatJsonDecimalEncodingBytes SinkNewResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat SinkNewResponseSchemaFormatJsonTimestampFormat` - `const SinkNewResponseSchemaFormatJsonTimestampFormatRfc3339 SinkNewResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const SinkNewResponseSchemaFormatJsonTimestampFormatUnixMillis SinkNewResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type SinkNewResponseSchemaFormatParquet struct{…}` - `Type SinkNewResponseSchemaFormatParquetType` - `const SinkNewResponseSchemaFormatParquetTypeParquet SinkNewResponseSchemaFormatParquetType = "parquet"` - `Compression SinkNewResponseSchemaFormatParquetCompression` - `const SinkNewResponseSchemaFormatParquetCompressionUncompressed SinkNewResponseSchemaFormatParquetCompression = "uncompressed"` - `const SinkNewResponseSchemaFormatParquetCompressionSnappy SinkNewResponseSchemaFormatParquetCompression = "snappy"` - `const SinkNewResponseSchemaFormatParquetCompressionGzip SinkNewResponseSchemaFormatParquetCompression = "gzip"` - `const SinkNewResponseSchemaFormatParquetCompressionZstd SinkNewResponseSchemaFormatParquetCompression = "zstd"` - `const SinkNewResponseSchemaFormatParquetCompressionLz4 SinkNewResponseSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` ### Example ```go 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.New(context.TODO(), pipelines.SinkNewParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), Name: cloudflare.F("my_sink"), Type: cloudflare.F(pipelines.SinkNewParamsTypeR2), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", sink.ID) } ``` #### Response ```json { "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", "credentials": { "access_key_id": "access_key_id", "secret_access_key": "secret_access_key" }, "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 } ``` ## Delete Sink `client.Pipelines.Sinks.Delete(ctx, sinkID, params) error` **delete** `/accounts/{account_id}/pipelines/v1/sinks/{sink_id}` Delete Pipeline in Account. ### Parameters - `sinkID string` Specifies the publid ID of the sink. - `params SinkDeleteParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Force param.Field[string]` Query param: Delete sink forcefully, including deleting any dependent pipelines. ### Example ```go package main import ( "context" "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"), ) err := client.Pipelines.Sinks.Delete( context.TODO(), "0223105f4ecef8ad9ca31a8372d0c353", pipelines.SinkDeleteParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } } ```