# Streams ## List Streams `client.Pipelines.Streams.List(ctx, params) (*V4PagePaginationArray[StreamListResponse], error)` **get** `/accounts/{account_id}/pipelines/v1/streams` List/Filter Streams in Account. ### Parameters - `params StreamListParams` - `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: Specifies the public ID of the pipeline. ### Returns - `type StreamListResponse struct{…}` - `ID string` Indicates a unique identifier for this stream. - `CreatedAt Time` - `HTTP StreamListResponseHTTP` - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamListResponseHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `ModifiedAt Time` - `Name string` Indicates the name of the Stream. - `Version int64` Indicates the current version of this stream. - `WorkerBinding StreamListResponseWorkerBinding` - `Enabled bool` Indicates that the worker binding is enabled. - `Endpoint string` Indicates the endpoint URL of this stream. - `Format StreamListResponseFormat` - `type StreamListResponseFormatJson struct{…}` - `Type StreamListResponseFormatJsonType` - `const StreamListResponseFormatJsonTypeJson StreamListResponseFormatJsonType = "json"` - `DecimalEncoding StreamListResponseFormatJsonDecimalEncoding` - `const StreamListResponseFormatJsonDecimalEncodingNumber StreamListResponseFormatJsonDecimalEncoding = "number"` - `const StreamListResponseFormatJsonDecimalEncodingString StreamListResponseFormatJsonDecimalEncoding = "string"` - `const StreamListResponseFormatJsonDecimalEncodingBytes StreamListResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamListResponseFormatJsonTimestampFormat` - `const StreamListResponseFormatJsonTimestampFormatRfc3339 StreamListResponseFormatJsonTimestampFormat = "rfc3339"` - `const StreamListResponseFormatJsonTimestampFormatUnixMillis StreamListResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamListResponseFormatParquet struct{…}` - `Type StreamListResponseFormatParquetType` - `const StreamListResponseFormatParquetTypeParquet StreamListResponseFormatParquetType = "parquet"` - `Compression StreamListResponseFormatParquetCompression` - `const StreamListResponseFormatParquetCompressionUncompressed StreamListResponseFormatParquetCompression = "uncompressed"` - `const StreamListResponseFormatParquetCompressionSnappy StreamListResponseFormatParquetCompression = "snappy"` - `const StreamListResponseFormatParquetCompressionGzip StreamListResponseFormatParquetCompression = "gzip"` - `const StreamListResponseFormatParquetCompressionZstd StreamListResponseFormatParquetCompression = "zstd"` - `const StreamListResponseFormatParquetCompressionLz4 StreamListResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema StreamListResponseSchema` - `Fields []StreamListResponseSchemaField` - `type StreamListResponseSchemaFieldsInt32 struct{…}` - `Type StreamListResponseSchemaFieldsInt32Type` - `const StreamListResponseSchemaFieldsInt32TypeInt32 StreamListResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsInt64 struct{…}` - `Type StreamListResponseSchemaFieldsInt64Type` - `const StreamListResponseSchemaFieldsInt64TypeInt64 StreamListResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsFloat32 struct{…}` - `Type StreamListResponseSchemaFieldsFloat32Type` - `const StreamListResponseSchemaFieldsFloat32TypeFloat32 StreamListResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsFloat64 struct{…}` - `Type StreamListResponseSchemaFieldsFloat64Type` - `const StreamListResponseSchemaFieldsFloat64TypeFloat64 StreamListResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsBool struct{…}` - `Type StreamListResponseSchemaFieldsBoolType` - `const StreamListResponseSchemaFieldsBoolTypeBool StreamListResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsString struct{…}` - `Type StreamListResponseSchemaFieldsStringType` - `const StreamListResponseSchemaFieldsStringTypeString StreamListResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsBinary struct{…}` - `Type StreamListResponseSchemaFieldsBinaryType` - `const StreamListResponseSchemaFieldsBinaryTypeBinary StreamListResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsTimestamp struct{…}` - `Type StreamListResponseSchemaFieldsTimestampType` - `const StreamListResponseSchemaFieldsTimestampTypeTimestamp StreamListResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamListResponseSchemaFieldsTimestampUnit` - `const StreamListResponseSchemaFieldsTimestampUnitSecond StreamListResponseSchemaFieldsTimestampUnit = "second"` - `const StreamListResponseSchemaFieldsTimestampUnitMillisecond StreamListResponseSchemaFieldsTimestampUnit = "millisecond"` - `const StreamListResponseSchemaFieldsTimestampUnitMicrosecond StreamListResponseSchemaFieldsTimestampUnit = "microsecond"` - `const StreamListResponseSchemaFieldsTimestampUnitNanosecond StreamListResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamListResponseSchemaFieldsJson struct{…}` - `Type StreamListResponseSchemaFieldsJsonType` - `const StreamListResponseSchemaFieldsJsonTypeJson StreamListResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamListResponseSchemaFieldsStruct struct{…}` - `type StreamListResponseSchemaFieldsList struct{…}` - `Format StreamListResponseSchemaFormat` - `type StreamListResponseSchemaFormatJson struct{…}` - `Type StreamListResponseSchemaFormatJsonType` - `const StreamListResponseSchemaFormatJsonTypeJson StreamListResponseSchemaFormatJsonType = "json"` - `DecimalEncoding StreamListResponseSchemaFormatJsonDecimalEncoding` - `const StreamListResponseSchemaFormatJsonDecimalEncodingNumber StreamListResponseSchemaFormatJsonDecimalEncoding = "number"` - `const StreamListResponseSchemaFormatJsonDecimalEncodingString StreamListResponseSchemaFormatJsonDecimalEncoding = "string"` - `const StreamListResponseSchemaFormatJsonDecimalEncodingBytes StreamListResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamListResponseSchemaFormatJsonTimestampFormat` - `const StreamListResponseSchemaFormatJsonTimestampFormatRfc3339 StreamListResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamListResponseSchemaFormatJsonTimestampFormatUnixMillis StreamListResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamListResponseSchemaFormatParquet struct{…}` - `Type StreamListResponseSchemaFormatParquetType` - `const StreamListResponseSchemaFormatParquetTypeParquet StreamListResponseSchemaFormatParquetType = "parquet"` - `Compression StreamListResponseSchemaFormatParquetCompression` - `const StreamListResponseSchemaFormatParquetCompressionUncompressed StreamListResponseSchemaFormatParquetCompression = "uncompressed"` - `const StreamListResponseSchemaFormatParquetCompressionSnappy StreamListResponseSchemaFormatParquetCompression = "snappy"` - `const StreamListResponseSchemaFormatParquetCompressionGzip StreamListResponseSchemaFormatParquetCompression = "gzip"` - `const StreamListResponseSchemaFormatParquetCompressionZstd StreamListResponseSchemaFormatParquetCompression = "zstd"` - `const StreamListResponseSchemaFormatParquetCompressionLz4 StreamListResponseSchemaFormatParquetCompression = "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.Streams.List(context.TODO(), pipelines.StreamListParams{ 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", "http": { "authentication": false, "enabled": true, "cors": { "origins": [ "string" ] } }, "modified_at": "2019-12-27T18:11:19.117Z", "name": "my_stream", "version": 3, "worker_binding": { "enabled": true }, "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1", "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 Stream Details `client.Pipelines.Streams.Get(ctx, streamID, query) (*StreamGetResponse, error)` **get** `/accounts/{account_id}/pipelines/v1/streams/{stream_id}` Get Stream Details. ### Parameters - `streamID string` Specifies the public ID of the stream. - `query StreamGetParams` - `AccountID param.Field[string]` Specifies the public ID of the account. ### Returns - `type StreamGetResponse struct{…}` - `ID string` Indicates a unique identifier for this stream. - `CreatedAt Time` - `HTTP StreamGetResponseHTTP` - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamGetResponseHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `ModifiedAt Time` - `Name string` Indicates the name of the Stream. - `Version int64` Indicates the current version of this stream. - `WorkerBinding StreamGetResponseWorkerBinding` - `Enabled bool` Indicates that the worker binding is enabled. - `Endpoint string` Indicates the endpoint URL of this stream. - `Format StreamGetResponseFormat` - `type StreamGetResponseFormatJson struct{…}` - `Type StreamGetResponseFormatJsonType` - `const StreamGetResponseFormatJsonTypeJson StreamGetResponseFormatJsonType = "json"` - `DecimalEncoding StreamGetResponseFormatJsonDecimalEncoding` - `const StreamGetResponseFormatJsonDecimalEncodingNumber StreamGetResponseFormatJsonDecimalEncoding = "number"` - `const StreamGetResponseFormatJsonDecimalEncodingString StreamGetResponseFormatJsonDecimalEncoding = "string"` - `const StreamGetResponseFormatJsonDecimalEncodingBytes StreamGetResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamGetResponseFormatJsonTimestampFormat` - `const StreamGetResponseFormatJsonTimestampFormatRfc3339 StreamGetResponseFormatJsonTimestampFormat = "rfc3339"` - `const StreamGetResponseFormatJsonTimestampFormatUnixMillis StreamGetResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamGetResponseFormatParquet struct{…}` - `Type StreamGetResponseFormatParquetType` - `const StreamGetResponseFormatParquetTypeParquet StreamGetResponseFormatParquetType = "parquet"` - `Compression StreamGetResponseFormatParquetCompression` - `const StreamGetResponseFormatParquetCompressionUncompressed StreamGetResponseFormatParquetCompression = "uncompressed"` - `const StreamGetResponseFormatParquetCompressionSnappy StreamGetResponseFormatParquetCompression = "snappy"` - `const StreamGetResponseFormatParquetCompressionGzip StreamGetResponseFormatParquetCompression = "gzip"` - `const StreamGetResponseFormatParquetCompressionZstd StreamGetResponseFormatParquetCompression = "zstd"` - `const StreamGetResponseFormatParquetCompressionLz4 StreamGetResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema StreamGetResponseSchema` - `Fields []StreamGetResponseSchemaField` - `type StreamGetResponseSchemaFieldsInt32 struct{…}` - `Type StreamGetResponseSchemaFieldsInt32Type` - `const StreamGetResponseSchemaFieldsInt32TypeInt32 StreamGetResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsInt64 struct{…}` - `Type StreamGetResponseSchemaFieldsInt64Type` - `const StreamGetResponseSchemaFieldsInt64TypeInt64 StreamGetResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsFloat32 struct{…}` - `Type StreamGetResponseSchemaFieldsFloat32Type` - `const StreamGetResponseSchemaFieldsFloat32TypeFloat32 StreamGetResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsFloat64 struct{…}` - `Type StreamGetResponseSchemaFieldsFloat64Type` - `const StreamGetResponseSchemaFieldsFloat64TypeFloat64 StreamGetResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsBool struct{…}` - `Type StreamGetResponseSchemaFieldsBoolType` - `const StreamGetResponseSchemaFieldsBoolTypeBool StreamGetResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsString struct{…}` - `Type StreamGetResponseSchemaFieldsStringType` - `const StreamGetResponseSchemaFieldsStringTypeString StreamGetResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsBinary struct{…}` - `Type StreamGetResponseSchemaFieldsBinaryType` - `const StreamGetResponseSchemaFieldsBinaryTypeBinary StreamGetResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsTimestamp struct{…}` - `Type StreamGetResponseSchemaFieldsTimestampType` - `const StreamGetResponseSchemaFieldsTimestampTypeTimestamp StreamGetResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamGetResponseSchemaFieldsTimestampUnit` - `const StreamGetResponseSchemaFieldsTimestampUnitSecond StreamGetResponseSchemaFieldsTimestampUnit = "second"` - `const StreamGetResponseSchemaFieldsTimestampUnitMillisecond StreamGetResponseSchemaFieldsTimestampUnit = "millisecond"` - `const StreamGetResponseSchemaFieldsTimestampUnitMicrosecond StreamGetResponseSchemaFieldsTimestampUnit = "microsecond"` - `const StreamGetResponseSchemaFieldsTimestampUnitNanosecond StreamGetResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamGetResponseSchemaFieldsJson struct{…}` - `Type StreamGetResponseSchemaFieldsJsonType` - `const StreamGetResponseSchemaFieldsJsonTypeJson StreamGetResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamGetResponseSchemaFieldsStruct struct{…}` - `type StreamGetResponseSchemaFieldsList struct{…}` - `Format StreamGetResponseSchemaFormat` - `type StreamGetResponseSchemaFormatJson struct{…}` - `Type StreamGetResponseSchemaFormatJsonType` - `const StreamGetResponseSchemaFormatJsonTypeJson StreamGetResponseSchemaFormatJsonType = "json"` - `DecimalEncoding StreamGetResponseSchemaFormatJsonDecimalEncoding` - `const StreamGetResponseSchemaFormatJsonDecimalEncodingNumber StreamGetResponseSchemaFormatJsonDecimalEncoding = "number"` - `const StreamGetResponseSchemaFormatJsonDecimalEncodingString StreamGetResponseSchemaFormatJsonDecimalEncoding = "string"` - `const StreamGetResponseSchemaFormatJsonDecimalEncodingBytes StreamGetResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamGetResponseSchemaFormatJsonTimestampFormat` - `const StreamGetResponseSchemaFormatJsonTimestampFormatRfc3339 StreamGetResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamGetResponseSchemaFormatJsonTimestampFormatUnixMillis StreamGetResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamGetResponseSchemaFormatParquet struct{…}` - `Type StreamGetResponseSchemaFormatParquetType` - `const StreamGetResponseSchemaFormatParquetTypeParquet StreamGetResponseSchemaFormatParquetType = "parquet"` - `Compression StreamGetResponseSchemaFormatParquetCompression` - `const StreamGetResponseSchemaFormatParquetCompressionUncompressed StreamGetResponseSchemaFormatParquetCompression = "uncompressed"` - `const StreamGetResponseSchemaFormatParquetCompressionSnappy StreamGetResponseSchemaFormatParquetCompression = "snappy"` - `const StreamGetResponseSchemaFormatParquetCompressionGzip StreamGetResponseSchemaFormatParquetCompression = "gzip"` - `const StreamGetResponseSchemaFormatParquetCompressionZstd StreamGetResponseSchemaFormatParquetCompression = "zstd"` - `const StreamGetResponseSchemaFormatParquetCompressionLz4 StreamGetResponseSchemaFormatParquetCompression = "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"), ) stream, err := client.Pipelines.Streams.Get( context.TODO(), "033e105f4ecef8ad9ca31a8372d0c353", pipelines.StreamGetParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", stream.ID) } ``` #### Response ```json { "result": { "id": "01234567890123457689012345678901", "created_at": "2019-12-27T18:11:19.117Z", "http": { "authentication": false, "enabled": true, "cors": { "origins": [ "string" ] } }, "modified_at": "2019-12-27T18:11:19.117Z", "name": "my_stream", "version": 3, "worker_binding": { "enabled": true }, "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1", "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 Stream `client.Pipelines.Streams.New(ctx, params) (*StreamNewResponse, error)` **post** `/accounts/{account_id}/pipelines/v1/streams` Create a new Stream. ### Parameters - `params StreamNewParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Name param.Field[string]` Body param: Specifies the name of the Stream. - `Format param.Field[StreamNewParamsFormat]` Body param - `type StreamNewParamsFormatJson struct{…}` - `Type StreamNewParamsFormatJsonType` - `const StreamNewParamsFormatJsonTypeJson StreamNewParamsFormatJsonType = "json"` - `DecimalEncoding StreamNewParamsFormatJsonDecimalEncoding` - `const StreamNewParamsFormatJsonDecimalEncodingNumber StreamNewParamsFormatJsonDecimalEncoding = "number"` - `const StreamNewParamsFormatJsonDecimalEncodingString StreamNewParamsFormatJsonDecimalEncoding = "string"` - `const StreamNewParamsFormatJsonDecimalEncodingBytes StreamNewParamsFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewParamsFormatJsonTimestampFormat` - `const StreamNewParamsFormatJsonTimestampFormatRfc3339 StreamNewParamsFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewParamsFormatJsonTimestampFormatUnixMillis StreamNewParamsFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewParamsFormatParquet struct{…}` - `Type StreamNewParamsFormatParquetType` - `const StreamNewParamsFormatParquetTypeParquet StreamNewParamsFormatParquetType = "parquet"` - `Compression StreamNewParamsFormatParquetCompression` - `const StreamNewParamsFormatParquetCompressionUncompressed StreamNewParamsFormatParquetCompression = "uncompressed"` - `const StreamNewParamsFormatParquetCompressionSnappy StreamNewParamsFormatParquetCompression = "snappy"` - `const StreamNewParamsFormatParquetCompressionGzip StreamNewParamsFormatParquetCompression = "gzip"` - `const StreamNewParamsFormatParquetCompressionZstd StreamNewParamsFormatParquetCompression = "zstd"` - `const StreamNewParamsFormatParquetCompressionLz4 StreamNewParamsFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `HTTP param.Field[StreamNewParamsHTTP]` Body param - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamNewParamsHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `Schema param.Field[StreamNewParamsSchema]` Body param - `Fields []StreamNewParamsSchemaField` - `type StreamNewParamsSchemaFieldsInt32 struct{…}` - `Type StreamNewParamsSchemaFieldsInt32Type` - `const StreamNewParamsSchemaFieldsInt32TypeInt32 StreamNewParamsSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsInt64 struct{…}` - `Type StreamNewParamsSchemaFieldsInt64Type` - `const StreamNewParamsSchemaFieldsInt64TypeInt64 StreamNewParamsSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsFloat32 struct{…}` - `Type StreamNewParamsSchemaFieldsFloat32Type` - `const StreamNewParamsSchemaFieldsFloat32TypeFloat32 StreamNewParamsSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsFloat64 struct{…}` - `Type StreamNewParamsSchemaFieldsFloat64Type` - `const StreamNewParamsSchemaFieldsFloat64TypeFloat64 StreamNewParamsSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsBool struct{…}` - `Type StreamNewParamsSchemaFieldsBoolType` - `const StreamNewParamsSchemaFieldsBoolTypeBool StreamNewParamsSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsString struct{…}` - `Type StreamNewParamsSchemaFieldsStringType` - `const StreamNewParamsSchemaFieldsStringTypeString StreamNewParamsSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsBinary struct{…}` - `Type StreamNewParamsSchemaFieldsBinaryType` - `const StreamNewParamsSchemaFieldsBinaryTypeBinary StreamNewParamsSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsTimestamp struct{…}` - `Type StreamNewParamsSchemaFieldsTimestampType` - `const StreamNewParamsSchemaFieldsTimestampTypeTimestamp StreamNewParamsSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamNewParamsSchemaFieldsTimestampUnit` - `const StreamNewParamsSchemaFieldsTimestampUnitSecond StreamNewParamsSchemaFieldsTimestampUnit = "second"` - `const StreamNewParamsSchemaFieldsTimestampUnitMillisecond StreamNewParamsSchemaFieldsTimestampUnit = "millisecond"` - `const StreamNewParamsSchemaFieldsTimestampUnitMicrosecond StreamNewParamsSchemaFieldsTimestampUnit = "microsecond"` - `const StreamNewParamsSchemaFieldsTimestampUnitNanosecond StreamNewParamsSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamNewParamsSchemaFieldsJson struct{…}` - `Type StreamNewParamsSchemaFieldsJsonType` - `const StreamNewParamsSchemaFieldsJsonTypeJson StreamNewParamsSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewParamsSchemaFieldsStruct struct{…}` - `type StreamNewParamsSchemaFieldsList struct{…}` - `Format StreamNewParamsSchemaFormat` - `type StreamNewParamsSchemaFormatJson struct{…}` - `Type StreamNewParamsSchemaFormatJsonType` - `const StreamNewParamsSchemaFormatJsonTypeJson StreamNewParamsSchemaFormatJsonType = "json"` - `DecimalEncoding StreamNewParamsSchemaFormatJsonDecimalEncoding` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingNumber StreamNewParamsSchemaFormatJsonDecimalEncoding = "number"` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingString StreamNewParamsSchemaFormatJsonDecimalEncoding = "string"` - `const StreamNewParamsSchemaFormatJsonDecimalEncodingBytes StreamNewParamsSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewParamsSchemaFormatJsonTimestampFormat` - `const StreamNewParamsSchemaFormatJsonTimestampFormatRfc3339 StreamNewParamsSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewParamsSchemaFormatJsonTimestampFormatUnixMillis StreamNewParamsSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewParamsSchemaFormatParquet struct{…}` - `Type StreamNewParamsSchemaFormatParquetType` - `const StreamNewParamsSchemaFormatParquetTypeParquet StreamNewParamsSchemaFormatParquetType = "parquet"` - `Compression StreamNewParamsSchemaFormatParquetCompression` - `const StreamNewParamsSchemaFormatParquetCompressionUncompressed StreamNewParamsSchemaFormatParquetCompression = "uncompressed"` - `const StreamNewParamsSchemaFormatParquetCompressionSnappy StreamNewParamsSchemaFormatParquetCompression = "snappy"` - `const StreamNewParamsSchemaFormatParquetCompressionGzip StreamNewParamsSchemaFormatParquetCompression = "gzip"` - `const StreamNewParamsSchemaFormatParquetCompressionZstd StreamNewParamsSchemaFormatParquetCompression = "zstd"` - `const StreamNewParamsSchemaFormatParquetCompressionLz4 StreamNewParamsSchemaFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Inferred bool` - `WorkerBinding param.Field[StreamNewParamsWorkerBinding]` Body param - `Enabled bool` Indicates that the worker binding is enabled. ### Returns - `type StreamNewResponse struct{…}` - `ID string` Indicates a unique identifier for this stream. - `CreatedAt Time` - `HTTP StreamNewResponseHTTP` - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamNewResponseHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `ModifiedAt Time` - `Name string` Indicates the name of the Stream. - `Version int64` Indicates the current version of this stream. - `WorkerBinding StreamNewResponseWorkerBinding` - `Enabled bool` Indicates that the worker binding is enabled. - `Endpoint string` Indicates the endpoint URL of this stream. - `Format StreamNewResponseFormat` - `type StreamNewResponseFormatJson struct{…}` - `Type StreamNewResponseFormatJsonType` - `const StreamNewResponseFormatJsonTypeJson StreamNewResponseFormatJsonType = "json"` - `DecimalEncoding StreamNewResponseFormatJsonDecimalEncoding` - `const StreamNewResponseFormatJsonDecimalEncodingNumber StreamNewResponseFormatJsonDecimalEncoding = "number"` - `const StreamNewResponseFormatJsonDecimalEncodingString StreamNewResponseFormatJsonDecimalEncoding = "string"` - `const StreamNewResponseFormatJsonDecimalEncodingBytes StreamNewResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewResponseFormatJsonTimestampFormat` - `const StreamNewResponseFormatJsonTimestampFormatRfc3339 StreamNewResponseFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewResponseFormatJsonTimestampFormatUnixMillis StreamNewResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewResponseFormatParquet struct{…}` - `Type StreamNewResponseFormatParquetType` - `const StreamNewResponseFormatParquetTypeParquet StreamNewResponseFormatParquetType = "parquet"` - `Compression StreamNewResponseFormatParquetCompression` - `const StreamNewResponseFormatParquetCompressionUncompressed StreamNewResponseFormatParquetCompression = "uncompressed"` - `const StreamNewResponseFormatParquetCompressionSnappy StreamNewResponseFormatParquetCompression = "snappy"` - `const StreamNewResponseFormatParquetCompressionGzip StreamNewResponseFormatParquetCompression = "gzip"` - `const StreamNewResponseFormatParquetCompressionZstd StreamNewResponseFormatParquetCompression = "zstd"` - `const StreamNewResponseFormatParquetCompressionLz4 StreamNewResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` - `Schema StreamNewResponseSchema` - `Fields []StreamNewResponseSchemaField` - `type StreamNewResponseSchemaFieldsInt32 struct{…}` - `Type StreamNewResponseSchemaFieldsInt32Type` - `const StreamNewResponseSchemaFieldsInt32TypeInt32 StreamNewResponseSchemaFieldsInt32Type = "int32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsInt64 struct{…}` - `Type StreamNewResponseSchemaFieldsInt64Type` - `const StreamNewResponseSchemaFieldsInt64TypeInt64 StreamNewResponseSchemaFieldsInt64Type = "int64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsFloat32 struct{…}` - `Type StreamNewResponseSchemaFieldsFloat32Type` - `const StreamNewResponseSchemaFieldsFloat32TypeFloat32 StreamNewResponseSchemaFieldsFloat32Type = "float32"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsFloat64 struct{…}` - `Type StreamNewResponseSchemaFieldsFloat64Type` - `const StreamNewResponseSchemaFieldsFloat64TypeFloat64 StreamNewResponseSchemaFieldsFloat64Type = "float64"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsBool struct{…}` - `Type StreamNewResponseSchemaFieldsBoolType` - `const StreamNewResponseSchemaFieldsBoolTypeBool StreamNewResponseSchemaFieldsBoolType = "bool"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsString struct{…}` - `Type StreamNewResponseSchemaFieldsStringType` - `const StreamNewResponseSchemaFieldsStringTypeString StreamNewResponseSchemaFieldsStringType = "string"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsBinary struct{…}` - `Type StreamNewResponseSchemaFieldsBinaryType` - `const StreamNewResponseSchemaFieldsBinaryTypeBinary StreamNewResponseSchemaFieldsBinaryType = "binary"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsTimestamp struct{…}` - `Type StreamNewResponseSchemaFieldsTimestampType` - `const StreamNewResponseSchemaFieldsTimestampTypeTimestamp StreamNewResponseSchemaFieldsTimestampType = "timestamp"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `Unit StreamNewResponseSchemaFieldsTimestampUnit` - `const StreamNewResponseSchemaFieldsTimestampUnitSecond StreamNewResponseSchemaFieldsTimestampUnit = "second"` - `const StreamNewResponseSchemaFieldsTimestampUnitMillisecond StreamNewResponseSchemaFieldsTimestampUnit = "millisecond"` - `const StreamNewResponseSchemaFieldsTimestampUnitMicrosecond StreamNewResponseSchemaFieldsTimestampUnit = "microsecond"` - `const StreamNewResponseSchemaFieldsTimestampUnitNanosecond StreamNewResponseSchemaFieldsTimestampUnit = "nanosecond"` - `type StreamNewResponseSchemaFieldsJson struct{…}` - `Type StreamNewResponseSchemaFieldsJsonType` - `const StreamNewResponseSchemaFieldsJsonTypeJson StreamNewResponseSchemaFieldsJsonType = "json"` - `MetadataKey string` - `Name string` - `Required bool` - `SqlName string` - `type StreamNewResponseSchemaFieldsStruct struct{…}` - `type StreamNewResponseSchemaFieldsList struct{…}` - `Format StreamNewResponseSchemaFormat` - `type StreamNewResponseSchemaFormatJson struct{…}` - `Type StreamNewResponseSchemaFormatJsonType` - `const StreamNewResponseSchemaFormatJsonTypeJson StreamNewResponseSchemaFormatJsonType = "json"` - `DecimalEncoding StreamNewResponseSchemaFormatJsonDecimalEncoding` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingNumber StreamNewResponseSchemaFormatJsonDecimalEncoding = "number"` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingString StreamNewResponseSchemaFormatJsonDecimalEncoding = "string"` - `const StreamNewResponseSchemaFormatJsonDecimalEncodingBytes StreamNewResponseSchemaFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamNewResponseSchemaFormatJsonTimestampFormat` - `const StreamNewResponseSchemaFormatJsonTimestampFormatRfc3339 StreamNewResponseSchemaFormatJsonTimestampFormat = "rfc3339"` - `const StreamNewResponseSchemaFormatJsonTimestampFormatUnixMillis StreamNewResponseSchemaFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamNewResponseSchemaFormatParquet struct{…}` - `Type StreamNewResponseSchemaFormatParquetType` - `const StreamNewResponseSchemaFormatParquetTypeParquet StreamNewResponseSchemaFormatParquetType = "parquet"` - `Compression StreamNewResponseSchemaFormatParquetCompression` - `const StreamNewResponseSchemaFormatParquetCompressionUncompressed StreamNewResponseSchemaFormatParquetCompression = "uncompressed"` - `const StreamNewResponseSchemaFormatParquetCompressionSnappy StreamNewResponseSchemaFormatParquetCompression = "snappy"` - `const StreamNewResponseSchemaFormatParquetCompressionGzip StreamNewResponseSchemaFormatParquetCompression = "gzip"` - `const StreamNewResponseSchemaFormatParquetCompressionZstd StreamNewResponseSchemaFormatParquetCompression = "zstd"` - `const StreamNewResponseSchemaFormatParquetCompressionLz4 StreamNewResponseSchemaFormatParquetCompression = "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"), ) stream, err := client.Pipelines.Streams.New(context.TODO(), pipelines.StreamNewParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), Name: cloudflare.F("my_stream"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", stream.ID) } ``` #### Response ```json { "result": { "id": "01234567890123457689012345678901", "created_at": "2019-12-27T18:11:19.117Z", "http": { "authentication": false, "enabled": true, "cors": { "origins": [ "string" ] } }, "modified_at": "2019-12-27T18:11:19.117Z", "name": "my_stream", "version": 3, "worker_binding": { "enabled": true }, "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1", "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 } ``` ## Update Stream `client.Pipelines.Streams.Update(ctx, streamID, params) (*StreamUpdateResponse, error)` **patch** `/accounts/{account_id}/pipelines/v1/streams/{stream_id}` Update a Stream. ### Parameters - `streamID string` Specifies the public ID of the stream. - `params StreamUpdateParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `HTTP param.Field[StreamUpdateParamsHTTP]` Body param - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamUpdateParamsHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `WorkerBinding param.Field[StreamUpdateParamsWorkerBinding]` Body param - `Enabled bool` Indicates that the worker binding is enabled. ### Returns - `type StreamUpdateResponse struct{…}` - `ID string` Indicates a unique identifier for this stream. - `CreatedAt Time` - `HTTP StreamUpdateResponseHTTP` - `Authentication bool` Indicates that authentication is required for the HTTP endpoint. - `Enabled bool` Indicates that the HTTP endpoint is enabled. - `CORS StreamUpdateResponseHTTPCORS` Specifies the CORS options for the HTTP endpoint. - `Origins []string` - `ModifiedAt Time` - `Name string` Indicates the name of the Stream. - `Version int64` Indicates the current version of this stream. - `WorkerBinding StreamUpdateResponseWorkerBinding` - `Enabled bool` Indicates that the worker binding is enabled. - `Endpoint string` Indicates the endpoint URL of this stream. - `Format StreamUpdateResponseFormat` - `type StreamUpdateResponseFormatJson struct{…}` - `Type StreamUpdateResponseFormatJsonType` - `const StreamUpdateResponseFormatJsonTypeJson StreamUpdateResponseFormatJsonType = "json"` - `DecimalEncoding StreamUpdateResponseFormatJsonDecimalEncoding` - `const StreamUpdateResponseFormatJsonDecimalEncodingNumber StreamUpdateResponseFormatJsonDecimalEncoding = "number"` - `const StreamUpdateResponseFormatJsonDecimalEncodingString StreamUpdateResponseFormatJsonDecimalEncoding = "string"` - `const StreamUpdateResponseFormatJsonDecimalEncodingBytes StreamUpdateResponseFormatJsonDecimalEncoding = "bytes"` - `TimestampFormat StreamUpdateResponseFormatJsonTimestampFormat` - `const StreamUpdateResponseFormatJsonTimestampFormatRfc3339 StreamUpdateResponseFormatJsonTimestampFormat = "rfc3339"` - `const StreamUpdateResponseFormatJsonTimestampFormatUnixMillis StreamUpdateResponseFormatJsonTimestampFormat = "unix_millis"` - `Unstructured bool` - `type StreamUpdateResponseFormatParquet struct{…}` - `Type StreamUpdateResponseFormatParquetType` - `const StreamUpdateResponseFormatParquetTypeParquet StreamUpdateResponseFormatParquetType = "parquet"` - `Compression StreamUpdateResponseFormatParquetCompression` - `const StreamUpdateResponseFormatParquetCompressionUncompressed StreamUpdateResponseFormatParquetCompression = "uncompressed"` - `const StreamUpdateResponseFormatParquetCompressionSnappy StreamUpdateResponseFormatParquetCompression = "snappy"` - `const StreamUpdateResponseFormatParquetCompressionGzip StreamUpdateResponseFormatParquetCompression = "gzip"` - `const StreamUpdateResponseFormatParquetCompressionZstd StreamUpdateResponseFormatParquetCompression = "zstd"` - `const StreamUpdateResponseFormatParquetCompressionLz4 StreamUpdateResponseFormatParquetCompression = "lz4"` - `RowGroupBytes int64` ### 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"), ) stream, err := client.Pipelines.Streams.Update( context.TODO(), "033e105f4ecef8ad9ca31a8372d0c353", pipelines.StreamUpdateParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", stream.ID) } ``` #### Response ```json { "result": { "id": "01234567890123457689012345678901", "created_at": "2019-12-27T18:11:19.117Z", "http": { "authentication": false, "enabled": true, "cors": { "origins": [ "string" ] } }, "modified_at": "2019-12-27T18:11:19.117Z", "name": "my_stream", "version": 3, "worker_binding": { "enabled": true }, "endpoint": "https://01234567890123457689012345678901.ingest.cloudflare.com/v1", "format": { "type": "json", "decimal_encoding": "number", "timestamp_format": "rfc3339", "unstructured": true } }, "success": true } ``` ## Delete Stream `client.Pipelines.Streams.Delete(ctx, streamID, params) error` **delete** `/accounts/{account_id}/pipelines/v1/streams/{stream_id}` Delete Stream in Account. ### Parameters - `streamID string` Specifies the public ID of the stream. - `params StreamDeleteParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Force param.Field[string]` Query param: Delete stream 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.Streams.Delete( context.TODO(), "033e105f4ecef8ad9ca31a8372d0c353", pipelines.StreamDeleteParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } } ```