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
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

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
    }
  },
  "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
    }
  },
  "success": true
}