[DEPRECATED] Update Pipeline
Deprecated
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.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
[DEPRECATED] Update Pipeline
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)
}
{
"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
}Returns Examples
{
"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
}