Update Queue
client.Queues.Update(ctx, queueID, params) (*Queue, error)
PUT/accounts/{account_id}/queues/{queue_id}
Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.
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)
Update Queue
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/queues"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
queue, err := client.Queues.Update(
context.TODO(),
"023e105f4ecef8ad9ca31a8372d0c353",
queues.QueueUpdateParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", queue.QueueID)
}
{
"errors": [
{
"code": 7003,
"message": "No route for the URI",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"consumers": [
{
"consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2019-12-27T18:11:19.117Z",
"dead_letter_queue": "dead_letter_queue",
"queue_name": "example-queue",
"script_name": "my-consumer-worker",
"settings": {
"batch_size": 50,
"max_concurrency": 10,
"max_retries": 3,
"max_wait_time_ms": 5000,
"retry_delay": 10
},
"type": "worker"
}
],
"consumers_total_count": 0,
"created_on": "created_on",
"modified_on": "modified_on",
"producers": [
{
"script": "script",
"type": "worker"
}
],
"producers_total_count": 0,
"queue_id": "queue_id",
"queue_name": "example-queue",
"settings": {
"delivery_delay": 5,
"delivery_paused": true,
"message_retention_period": 345600
}
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 7003,
"message": "No route for the URI",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"consumers": [
{
"consumer_id": "023e105f4ecef8ad9ca31a8372d0c353",
"created_on": "2019-12-27T18:11:19.117Z",
"dead_letter_queue": "dead_letter_queue",
"queue_name": "example-queue",
"script_name": "my-consumer-worker",
"settings": {
"batch_size": 50,
"max_concurrency": 10,
"max_retries": 3,
"max_wait_time_ms": 5000,
"retry_delay": 10
},
"type": "worker"
}
],
"consumers_total_count": 0,
"created_on": "created_on",
"modified_on": "modified_on",
"producers": [
{
"script": "script",
"type": "worker"
}
],
"producers_total_count": 0,
"queue_id": "queue_id",
"queue_name": "example-queue",
"settings": {
"delivery_delay": 5,
"delivery_paused": true,
"message_retention_period": 345600
}
},
"success": true
}