Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 171 additions & 0 deletions docs/apis/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,25 @@ components:
type: string
description: Optional AWS Session Token (for temporary credentials).
example: "AQoDYXdzEPT//////////wEXAMPLE..."
CloudflareQueuesConfig:
type: object
required: [account_id, queue_id]
properties:
account_id:
type: string
description: Cloudflare Account ID
example: "abc123def456789"
queue_id:
type: string
description: Cloudflare Queue ID
example: "my-queue"
CloudflareQueuesCredentials:
type: object
required: [api_token]
properties:
api_token:
type: string
description: Cloudflare API Token with queues:write permission
RabbitMQConfig:
type: object
required: [server_url, exchange]
Expand Down Expand Up @@ -1094,6 +1113,92 @@ components:
credentials:
service_account_json: '{"type":"service_account","project_id":"my-project-123",...}'

DestinationCloudflareQueues:
type: object
required:
[
id,
type,
topics,
config,
credentials,
created_at,
updated_at,
disabled_at,
]
properties:
id:
type: string
description: Control plane generated ID or user provided ID for the destination.
example: "des_12345"
type:
type: string
description: Type of the destination.
enum: [cloudflare_queues]
example: "cloudflare_queues"
topics:
$ref: "#/components/schemas/Topics"
filter:
$ref: "#/components/schemas/Filter"
disabled_at:
type: string
format: date-time
nullable: true
description: ISO Date when the destination was disabled, or null if enabled.
example: null
created_at:
type: string
format: date-time
description: ISO Date when the destination was created.
example: "2024-01-01T00:00:00Z"
updated_at:
type: string
format: date-time
description: ISO Date when the destination was last updated.
example: "2024-01-01T00:00:00Z"
config:
$ref: "#/components/schemas/CloudflareQueuesConfig"
credentials:
$ref: "#/components/schemas/CloudflareQueuesCredentials"
delivery_metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Static key-value pairs merged into event metadata on every delivery.
example: { "app-id": "my-app", "region": "us-east-1" }
metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Arbitrary contextual information stored with the destination.
example: { "internal-id": "123", "team": "platform" }
target:
type: string
description: A human-readable representation of the destination target (Cloudflare Queue ID). Read-only.
readOnly: true
example: "my-queue"
target_url:
type: string
format: url
nullable: true
description: A URL link to the destination target (Cloudflare Dashboard link to the queue). Read-only.
readOnly: true
example: "https://dash.cloudflare.com/abc123def456789/queues/my-queue"
example:
id: "des_cf_queues_123"
type: "cloudflare_queues"
topics: ["*"]
disabled_at: null
created_at: "2024-03-10T14:30:00Z"
updated_at: "2024-03-10T14:30:00Z"
config:
account_id: "abc123def456789"
queue_id: "my-queue"
credentials:
api_token: "cf_token_..."

# Polymorphic Destination Schema (for Responses)
Destination:
oneOf:
Expand All @@ -1105,6 +1210,7 @@ components:
- $ref: "#/components/schemas/DestinationAzureServiceBus"
- $ref: "#/components/schemas/DestinationAWSS3"
- $ref: "#/components/schemas/DestinationGCPPubSub"
- $ref: "#/components/schemas/DestinationCloudflareQueues"
discriminator:
propertyName: type
mapping:
Expand All @@ -1116,6 +1222,7 @@ components:
azure_servicebus: "#/components/schemas/DestinationAzureServiceBus"
aws_s3: "#/components/schemas/DestinationAWSS3"
gcp_pubsub: "#/components/schemas/DestinationGCPPubSub"
cloudflare_queues: "#/components/schemas/DestinationCloudflareQueues"

DestinationCreateWebhook:
type: object
Expand Down Expand Up @@ -1391,6 +1498,40 @@ components:
nullable: true
description: Arbitrary contextual information stored with the destination.
example: { "internal-id": "123", "team": "platform" }
DestinationCreateCloudflareQueues:
type: object
required: [type, topics, config, credentials]
properties:
id:
type: string
description: Optional user-provided ID. A UUID will be generated if empty.
example: "user-provided-id"
type:
type: string
description: Type of the destination. Must be 'cloudflare_queues'.
enum: [cloudflare_queues]
topics:
$ref: "#/components/schemas/Topics"
filter:
$ref: "#/components/schemas/Filter"
config:
$ref: "#/components/schemas/CloudflareQueuesConfig"
credentials:
$ref: "#/components/schemas/CloudflareQueuesCredentials"
delivery_metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Static key-value pairs merged into event metadata on every delivery.
example: { "app-id": "my-app", "region": "us-east-1" }
metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Arbitrary contextual information stored with the destination.
example: { "internal-id": "123", "team": "platform" }

# Polymorphic Destination Creation Schema (for Request Bodies)
DestinationCreate:
Expand All @@ -1403,6 +1544,7 @@ components:
- $ref: "#/components/schemas/DestinationCreateAzureServiceBus"
- $ref: "#/components/schemas/DestinationCreateAWSS3"
- $ref: "#/components/schemas/DestinationCreateGCPPubSub"
- $ref: "#/components/schemas/DestinationCreateCloudflareQueues"
discriminator:
propertyName: type
mapping:
Expand All @@ -1414,6 +1556,7 @@ components:
azure_servicebus: "#/components/schemas/DestinationCreateAzureServiceBus"
aws_s3: "#/components/schemas/DestinationCreateAWSS3"
gcp_pubsub: "#/components/schemas/DestinationCreateGCPPubSub"
cloudflare_queues: "#/components/schemas/DestinationCreateCloudflareQueues"

# Type-Specific Destination Update Schemas (for Request Bodies)
WebhookCredentialsUpdate:
Expand Down Expand Up @@ -1640,6 +1783,32 @@ components:
nullable: true
description: Arbitrary contextual information stored with the destination.
example: { "internal-id": "123", "team": "platform" }
DestinationUpdateCloudflareQueues:
type: object
# Properties duplicated from DestinationUpdateBase
properties:
topics:
$ref: "#/components/schemas/Topics"
filter:
$ref: "#/components/schemas/Filter"
config:
$ref: "#/components/schemas/CloudflareQueuesConfig" # account_id/queue_id required here, but PATCH means optional
credentials:
$ref: "#/components/schemas/CloudflareQueuesCredentials" # api_token required here, but PATCH means optional
delivery_metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Static key-value pairs merged into event metadata on every delivery.
example: { "app-id": "my-app", "region": "us-east-1" }
metadata:
type: object
additionalProperties:
type: string
nullable: true
description: Arbitrary contextual information stored with the destination.
example: { "internal-id": "123", "team": "platform" }

# Polymorphic Destination Update Schema (for Request Bodies)
DestinationUpdate:
Expand All @@ -1652,6 +1821,7 @@ components:
- $ref: "#/components/schemas/DestinationUpdateAzureServiceBus"
- $ref: "#/components/schemas/DestinationUpdateAWSS3"
- $ref: "#/components/schemas/DestinationUpdateGCPPubSub"
- $ref: "#/components/schemas/DestinationUpdateCloudflareQueues"
# Event Schemas
PublishRequest:
type: object
Expand Down Expand Up @@ -1908,6 +2078,7 @@ components:
- azure_servicebus
- aws_s3
- gcp_pubsub
- cloudflare_queues
description: Type of destination.
example: "webhook"
DestinationTypeSchema:
Expand Down
1 change: 1 addition & 0 deletions docs/pages/destinations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Outpost supports multiple event destination types. Each tenant can have multiple
| [Azure Service Bus](/docs/destinations/azure-service-bus) | Send events to Azure Service Bus |
| [GCP Pub/Sub](/docs/destinations/gcp-pubsub) | Publish events to Google Cloud Pub/Sub |
| [RabbitMQ](/docs/destinations/rabbitmq) | Send events to a RabbitMQ exchange |
| [Cloudflare Queues](/docs/destinations/cloudflare-queues) | Send events to Cloudflare Queues |

See the [roadmap](/docs/references/roadmap) for planned destination types. To be eligible as a destination type, it must be asynchronous in nature and not run any business logic.

Expand Down
92 changes: 92 additions & 0 deletions docs/pages/destinations/cloudflare-queues.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
title: Cloudflare Queues
---

Send events to Cloudflare Queues.

## Configuration

### Config

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `config.account_id` | string | Yes | Cloudflare Account ID |
| `config.queue_id` | string | Yes | Queue ID |

### Credentials

| Field | Type | Required | Description |
| ----- | ---- | -------- | ----------- |
| `credentials.api_token` | string | Yes | Cloudflare API Token |

### Example

```sh
curl --location 'https://<OUTPOST_API_URL>/api/v1/tenants/<TENANT_ID>/destinations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_KEY>' \
--data '{
"type": "cloudflare_queues",
"topics": ["orders"],
"config": {
"account_id": "<CLOUDFLARE_ACCOUNT_ID>",
"queue_id": "<QUEUE_ID>"
},
"credentials": {
"api_token": "<CLOUDFLARE_API_TOKEN>"
}
}'
```

## Message Format

Events are sent to Cloudflare Queues as JSON messages with the following structure:

```json
{
"data": <event.Data>,
"metadata": <merged_metadata>
}
```

### Example Message

If you publish an event:

```json
{
"topic": "orders",
"data": {
"order_id": "123",
"status": "created"
},
"metadata": {
"source": "checkout-service"
}
}
```

The message sent to Cloudflare Queues will be:

```json
{
"data": {
"order_id": "123",
"status": "created"
},
"metadata": {
"event-id": "evt_123",
"topic": "orders",
"timestamp": "1704067200",
"source": "checkout-service"
}
}
```

The `metadata` field contains system metadata (`event-id`, `topic`, `timestamp`) merged with any custom event metadata.

## Required Permissions

The Cloudflare API Token must have the following permission:

- `queues:write` - Required to send messages to the queue
Loading