Skip to content
Start here

Update Stream

client.Pipelines.Streams.Update(ctx, streamID, params) (*StreamUpdateResponse, error)
PATCH/accounts/{account_id}/pipelines/v1/streams/{stream_id}

Update a Stream.

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
ParametersExpand Collapse
streamID string

Specifies the public ID of the stream.

maxLength32
minLength32
params StreamUpdateParams
AccountID param.Field[string]

Path param: Specifies the public ID of the account.

HTTP param.Field[StreamUpdateParamsHTTP]Optional

Body param

Authentication bool

Indicates that authentication is required for the HTTP endpoint.

Enabled bool

Indicates that the HTTP endpoint is enabled.

CORS StreamUpdateParamsHTTPCORSOptional

Specifies the CORS options for the HTTP endpoint.

Origins []stringOptional
WorkerBinding param.Field[StreamUpdateParamsWorkerBinding]Optional

Body param

Enabled bool

Indicates that the worker binding is enabled.

ReturnsExpand Collapse
type StreamUpdateResponse struct{…}
ID string

Indicates a unique identifier for this stream.

CreatedAt Time
formatdate-time
HTTP StreamUpdateResponseHTTP
Authentication bool

Indicates that authentication is required for the HTTP endpoint.

Enabled bool

Indicates that the HTTP endpoint is enabled.

CORS StreamUpdateResponseHTTPCORSOptional

Specifies the CORS options for the HTTP endpoint.

Origins []stringOptional
ModifiedAt Time
formatdate-time
Name string

Indicates the name of the Stream.

maxLength128
minLength1
Version int64

Indicates the current version of this stream.

WorkerBinding StreamUpdateResponseWorkerBinding
Enabled bool

Indicates that the worker binding is enabled.

Endpoint stringOptional

Indicates the endpoint URL of this stream.

formaturi
Format StreamUpdateResponseFormatOptional

Defines the data format of the events.

One of the following:
type StreamUpdateResponseFormatJson struct{…}
Type StreamUpdateResponseFormatJsonType
DecimalEncoding StreamUpdateResponseFormatJsonDecimalEncodingOptional
One of the following:
const StreamUpdateResponseFormatJsonDecimalEncodingNumber StreamUpdateResponseFormatJsonDecimalEncoding = "number"
const StreamUpdateResponseFormatJsonDecimalEncodingString StreamUpdateResponseFormatJsonDecimalEncoding = "string"
const StreamUpdateResponseFormatJsonDecimalEncodingBytes StreamUpdateResponseFormatJsonDecimalEncoding = "bytes"
TimestampFormat StreamUpdateResponseFormatJsonTimestampFormatOptional
One of the following:
const StreamUpdateResponseFormatJsonTimestampFormatRfc3339 StreamUpdateResponseFormatJsonTimestampFormat = "rfc3339"
const StreamUpdateResponseFormatJsonTimestampFormatUnixMillis StreamUpdateResponseFormatJsonTimestampFormat = "unix_millis"
Unstructured boolOptional
type StreamUpdateResponseFormatParquet struct{…}
Type StreamUpdateResponseFormatParquetType
Compression StreamUpdateResponseFormatParquetCompressionOptional
One of the following:
const StreamUpdateResponseFormatParquetCompressionUncompressed StreamUpdateResponseFormatParquetCompression = "uncompressed"
const StreamUpdateResponseFormatParquetCompressionSnappy StreamUpdateResponseFormatParquetCompression = "snappy"
const StreamUpdateResponseFormatParquetCompressionGzip StreamUpdateResponseFormatParquetCompression = "gzip"
const StreamUpdateResponseFormatParquetCompressionZstd StreamUpdateResponseFormatParquetCompression = "zstd"
const StreamUpdateResponseFormatParquetCompressionLz4 StreamUpdateResponseFormatParquetCompression = "lz4"
RowGroupBytes int64Optional
formatint64
minimum0
Schema StreamUpdateResponseSchemaOptional

Defines the schema of the events in the data stream.

Fields []SourceFieldOptional
One of the following:
type SourceFieldInt32 struct{…}
Type SourceFieldInt32Type
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldInt64 struct{…}
Type SourceFieldInt64Type
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldFloat32 struct{…}
Type SourceFieldFloat32Type
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldFloat64 struct{…}
Type SourceFieldFloat64Type
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldBool struct{…}
Type SourceFieldBoolType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldString struct{…}
Type SourceFieldStringType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldBinary struct{…}
Type SourceFieldBinaryType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldTimestamp struct{…}
Type SourceFieldTimestampType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
Unit SourceFieldTimestampUnitOptional
One of the following:
const SourceFieldTimestampUnitSecond SourceFieldTimestampUnit = "second"
const SourceFieldTimestampUnitMillisecond SourceFieldTimestampUnit = "millisecond"
const SourceFieldTimestampUnitMicrosecond SourceFieldTimestampUnit = "microsecond"
const SourceFieldTimestampUnitNanosecond SourceFieldTimestampUnit = "nanosecond"
type SourceFieldJson struct{…}
Type SourceFieldJsonType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldStruct struct{…}
Type SourceFieldStructType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
type SourceFieldList struct{…}
Type SourceFieldListType
MetadataKey stringOptional
Name stringOptional
Required boolOptional
SqlName stringOptional
Inferred boolOptional

Update Stream

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)
}
{
  "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"
        }
      ],
      "inferred": true
    }
  },
  "success": true
}
Returns Examples
{
  "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"
        }
      ],
      "inferred": true
    }
  },
  "success": true
}