## [DEPRECATED] Update Pipeline `client.Pipelines.Update(ctx, pipelineName, params) (*PipelineUpdateResponse, error)` **put** `/accounts/{account_id}/pipelines/{pipeline_name}` [DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead. ### Parameters - `pipelineName string` Defines the name of the pipeline. - `params PipelineUpdateParams` - `AccountID param.Field[string]` Path param: Specifies the public ID of the account. - `Destination param.Field[PipelineUpdateParamsDestination]` Body param - `Batch PipelineUpdateParamsDestinationBatch` - `MaxBytes int64` Specifies rough maximum size of files. - `MaxDurationS float64` Specifies duration to wait to aggregate batches files. - `MaxRows int64` Specifies rough maximum number of rows per file. - `Compression PipelineUpdateParamsDestinationCompression` - `Type PipelineUpdateParamsDestinationCompressionType` Specifies the desired compression algorithm and format. - `const PipelineUpdateParamsDestinationCompressionTypeNone PipelineUpdateParamsDestinationCompressionType = "none"` - `const PipelineUpdateParamsDestinationCompressionTypeGzip PipelineUpdateParamsDestinationCompressionType = "gzip"` - `const PipelineUpdateParamsDestinationCompressionTypeDeflate PipelineUpdateParamsDestinationCompressionType = "deflate"` - `Format PipelineUpdateParamsDestinationFormat` Specifies the format of data to deliver. - `const PipelineUpdateParamsDestinationFormatJson PipelineUpdateParamsDestinationFormat = "json"` - `Path PipelineUpdateParamsDestinationPath` - `Bucket string` Specifies the R2 Bucket to store files. - `Filename string` Specifies the name pattern to for individual data files. - `Filepath string` Specifies the name pattern for directory. - `Prefix string` Specifies the base directory within the bucket. - `Type PipelineUpdateParamsDestinationType` Specifies the type of destination. - `const PipelineUpdateParamsDestinationTypeR2 PipelineUpdateParamsDestinationType = "r2"` - `Credentials PipelineUpdateParamsDestinationCredentials` - `AccessKeyID string` Specifies the R2 Bucket Access Key Id. - `Endpoint string` Specifies the R2 Endpoint. - `SecretAccessKey string` Specifies the R2 Bucket Secret Access Key. - `Name param.Field[string]` Body param: Defines the name of the pipeline. - `Source param.Field[[]PipelineUpdateParamsSource]` Body param - `type PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSource struct{…}` [DEPRECATED] HTTP source configuration. Use the new streams API instead. - `Format PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormat` Specifies the format of source data. - `const PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormatJson PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormat = "json"` - `Type string` - `Authentication bool` Specifies whether authentication is required to send to this pipeline via HTTP. - `CORS PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSourceCORS` - `Origins []string` Specifies allowed origins to allow Cross Origin HTTP Requests. - `type PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesBindingSource struct{…}` [DEPRECATED] Worker binding source configuration. Use the new streams API instead. - `Format PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormat` Specifies the format of source data. - `const PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormatJson PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormat = "json"` - `Type string` ### Returns - `type PipelineUpdateResponse struct{…}` [DEPRECATED] Describes the configuration of a pipeline. Use the new streams/sinks/pipelines API instead. - `ID string` Specifies the pipeline identifier. - `Destination PipelineUpdateResponseDestination` - `Batch PipelineUpdateResponseDestinationBatch` - `MaxBytes int64` Specifies rough maximum size of files. - `MaxDurationS float64` Specifies duration to wait to aggregate batches files. - `MaxRows int64` Specifies rough maximum number of rows per file. - `Compression PipelineUpdateResponseDestinationCompression` - `Type PipelineUpdateResponseDestinationCompressionType` Specifies the desired compression algorithm and format. - `const PipelineUpdateResponseDestinationCompressionTypeNone PipelineUpdateResponseDestinationCompressionType = "none"` - `const PipelineUpdateResponseDestinationCompressionTypeGzip PipelineUpdateResponseDestinationCompressionType = "gzip"` - `const PipelineUpdateResponseDestinationCompressionTypeDeflate PipelineUpdateResponseDestinationCompressionType = "deflate"` - `Format PipelineUpdateResponseDestinationFormat` Specifies the format of data to deliver. - `const PipelineUpdateResponseDestinationFormatJson PipelineUpdateResponseDestinationFormat = "json"` - `Path PipelineUpdateResponseDestinationPath` - `Bucket string` Specifies the R2 Bucket to store files. - `Filename string` Specifies the name pattern to for individual data files. - `Filepath string` Specifies the name pattern for directory. - `Prefix string` Specifies the base directory within the bucket. - `Type PipelineUpdateResponseDestinationType` Specifies the type of destination. - `const PipelineUpdateResponseDestinationTypeR2 PipelineUpdateResponseDestinationType = "r2"` - `Endpoint string` Indicates the endpoint URL to send traffic. - `Name string` Defines the name of the pipeline. - `Source []PipelineUpdateResponseSource` - `type PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesHTTPSource struct{…}` [DEPRECATED] HTTP source configuration. Use the new streams API instead. - `Format PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormat` Specifies the format of source data. - `const PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormatJson PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormat = "json"` - `Type string` - `Authentication bool` Specifies whether authentication is required to send to this pipeline via HTTP. - `CORS PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesHTTPSourceCORS` - `Origins []string` Specifies allowed origins to allow Cross Origin HTTP Requests. - `type PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesBindingSource struct{…}` [DEPRECATED] Worker binding source configuration. Use the new streams API instead. - `Format PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormat` Specifies the format of source data. - `const PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormatJson PipelineUpdateResponseSourceCloudflarePipelinesWorkersPipelinesBindingSourceFormat = "json"` - `Type string` - `Version float64` Indicates the version number of last saved configuration. ### 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"), ) pipeline, err := client.Pipelines.Update( context.TODO(), "sample_pipeline", pipelines.PipelineUpdateParams{ AccountID: cloudflare.F("0123105f4ecef8ad9ca31a8372d0c353"), Destination: cloudflare.F(pipelines.PipelineUpdateParamsDestination{ Batch: cloudflare.F(pipelines.PipelineUpdateParamsDestinationBatch{ }), Compression: cloudflare.F(pipelines.PipelineUpdateParamsDestinationCompression{ }), Format: cloudflare.F(pipelines.PipelineUpdateParamsDestinationFormatJson), Path: cloudflare.F(pipelines.PipelineUpdateParamsDestinationPath{ Bucket: cloudflare.F("bucket"), }), Type: cloudflare.F(pipelines.PipelineUpdateParamsDestinationTypeR2), }), Name: cloudflare.F("sample_pipeline"), Source: cloudflare.F([]pipelines.PipelineUpdateParamsSourceUnion{pipelines.PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSource{ Format: cloudflare.F(pipelines.PipelineUpdateParamsSourceCloudflarePipelinesWorkersPipelinesHTTPSourceFormatJson), Type: cloudflare.F("type"), }}), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", pipeline.ID) } ``` #### Response ```json { "result": { "id": "123f8a8258064ed892a347f173372359", "destination": { "batch": { "max_bytes": 1000, "max_duration_s": 0.25, "max_rows": 100 }, "compression": { "type": "gzip" }, "format": "json", "path": { "bucket": "bucket", "filename": "${slug}${extension}", "filepath": "${date}/${hour}", "prefix": "base" }, "type": "r2" }, "endpoint": "https://123f8a8258064ed892a347f173372359.pipelines.cloudflare.com", "name": "sample_pipeline", "source": [ { "format": "json", "type": "type", "authentication": true, "cors": { "origins": [ "*" ] } } ], "version": 2 }, "success": true } ```