Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure storage blob sink #133

Merged
merged 4 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 70 additions & 0 deletions azure-storage-blob-sink.kamelet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
name: azure-storage-blob-sink
annotations:
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgOTEgODEiIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjx1c2UgeGxpbms6aHJlZj0iI0EiIHg9Ii41IiB5PSIuNSIvPjxzeW1ib2wgaWQ9IkEiIG92ZXJmbG93PSJ2aXNpYmxlIj48cGF0aCBkPSJNNjcuNTU4IDBIMjIuNDQxTDAgNDBsMjIuNDQxIDQwaDQ1LjExN0w5MCA0MCA2Ny41NTggMHptLjIzNCA1Ny45NjRjMCAzLjM1My0yLjgwNSA2LjIyNy02LjA3OCA2LjIyN0gyOC41MmMtMy4yNzMgMC02LjA3OC0yLjg3NC02LjA3OC02LjIyN1YyMi4yNzZjMC0zLjM1MyAyLjgwNS02LjIyOCA2LjA3OC02LjIyOGgyOS45MjJsOS4zNTEgOS41ODF2MzIuMzM1ek00MS42MSA0Ni40NjdjMC0uN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jg3NHptMTAuNTIgMy4zNTN2LjI0czAgLjIzOS0uMjM0LjIzOWgtNy43MTRsLS4yMzQtLjIzOXYtMS40MzdzMC0uMjM5LjIzNC0uMjM5aDIuODA1di04Ljg2MmwtMi4xMDQgMS4xOThjLS4yMzQgMC0uMjM0LjIzOS0uNDY4LjIzOWgtLjIzNHMwLS4yMzktLjIzNC0uMjM5VjQ0Ljc5bC4yMzQtLjI0IDIuODA1LTEuOTE2aDIuNTcydjExLjQ5N2gyLjMzOGwuMjM0LjIzOXYxLjE5OHptLjIzNC0yMi4wMzZjLS4yMzQuOTU4LS40NjggMS42NzctLjkzNSAyLjE1Ni0uNDY4LjcxOC0uOTM1IDEuMTk4LTEuNDAzIDEuNDM3LS43MDEuMjQtMS40MDMuNDc5LTIuMzM4LjQ3OXMtMS42MzYtLjI0LTIuMzM4LS40NzlhMi4xMyAyLjEzIDAgMCAxLTEuNDAzLTEuNDM3Yy0uMjM0LS40NzktLjcwMS0xLjQzNy0uNzAxLTIuMTU2cy0uMjM0LTEuOTE2LS4yMzQtMi44NzRjMC0xLjE5OCAwLTIuMTU2LjIzNC0yLjg3NC4yMzQtLjk1OC40NjgtMS42NzcuOTM1LTIuMTU2LjQ2OC0uNzE4LjkzNS0xLjE5OCAxLjQwMy0xLjQzNy43MDEtLjI0IDEuNDAzLS40NzkgMi4zMzgtLjQ3OXMxLjYzNi4yNCAyLjMzOC40NzlhMi4xMyAyLjEzIDAgMCAxIDEuNDAzIDEuNDM3Yy4yMzQuNzE4LjcwMSAxLjQzNy43MDEgMi4xNTYuMjM0Ljk1OC4yMzQgMS45MTYuMjM0IDIuODc0IDAgMS4xOTgtLjIzNCAyLjE1Ni0uMjM0IDIuODc0eiIgZmlsbD0iIzAwNzhkNyIgc3Ryb2tlPSJub25lIi8+PC9zeW1ib2w+PC9zdmc+"
camel.apache.org/provider: "Apache Software Foundation"
labels:
camel.apache.org/kamelet.type: "sink"
spec:
definition:
title: "Azure Storage Blob Sink"
description: |-
Upload data to Azure Storage Blob.

The Kamelet expects the following headers to be set:

- `file` / `ce-file`: as the file name to upload

If the header won't be set the exchange ID will be used as file name.
required:
- accountName
- containerName
- accessKey
properties:
accountName:
title: Account Name
description: The Azure Storage Blob account name.
type: string
containerName:
title: Container Name
description: The Azure Storage Blob container name.
type: string
accessKey:
title: Access Key
description: The Azure Storage Blob access Key.
type: string
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
operation:
title: Operation name
description: The operation to perform.
type: string
default: uploadBlockBlob
flow:
from:
uri: "kamelet:source"
steps:
- choice:
when:
- simple: "${header[file]}"
steps:
- set-header:
name: CamelAzureStorageBlobBlobName
simple: "${header[file]}"
- simple: "${header[ce-file]}"
steps:
- set-header:
name: CamelAzureStorageBlobBlobName
simple: "${header[ce-file]}"
otherwise:
steps:
- set-header:
name: CamelAzureStorageBlobBlobName
simple: "${exchangeId}"
- to:
uri: "azure-storage-blob://{{accountName}}/{{containerName}}"
parameters:
accessKey: "{{accessKey}}"
operation: "{{operation}}"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* xref:ROOT:aws-sqs-fifo-sink.adoc[image:kamelets/aws-sqs-fifo-sink.svg[] AWS SQS FIFO Sink]
* xref:ROOT:aws-sqs-sink.adoc[image:kamelets/aws-sqs-sink.svg[] AWS SQS Sink]
* xref:ROOT:aws-sqs-source.adoc[image:kamelets/aws-sqs-source.svg[] AWS SQS Source]
* xref:ROOT:azure-storage-blob-sink.adoc[image:kamelets/azure-storage-blob-sink.svg[] Azure Storage Blob Sink]
* xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source]
* xref:ROOT:dropbox-sink.adoc[image:kamelets/dropbox-sink.svg[] Dropbox Sink]
* xref:ROOT:dropbox-source.adoc[image:kamelets/dropbox-source.svg[] Dropbox Source]
Expand Down
71 changes: 71 additions & 0 deletions docs/modules/ROOT/pages/azure-storage-blob-sink.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= image:kamelets/azure-storage-blob-sink.svg[] Azure Storage Blob Sink

*Provided by: "Apache Software Foundation"*

Upload data to Azure Storage Blob.

The Kamelet expects the following headers to be set:

- `file` / `ce-file`: as the file name to upload

If the header won't be set the exchange ID will be used as file name.

== Configuration Options

The following table summarizes the configuration options available for the `azure-storage-blob-sink` Kamelet:
[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
|===
| Property| Name| Description| Type| Default| Example
| *accessKey {empty}* *| Access Key| The Azure Storage Blob access Key.| string| |
| *accountName {empty}* *| Account Name| The Azure Storage Blob account name.| string| |
| *containerName {empty}* *| Container Name| The Azure Storage Blob container name.| string| |
| operation| Operation name| The operation to perform.| string| `"uploadBlockBlob"`|
|===

NOTE: Fields marked with ({empty}*) are mandatory.

== Usage

This section summarizes how the `azure-storage-blob-sink` can be used in various contexts.

=== Knative Sink

The `azure-storage-blob-sink` Kamelet can be used as Knative sink by binding it to a Knative object.

.azure-storage-blob-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: azure-storage-blob-sink-binding
spec:
source:
ref:
kind: InMemoryChannel
apiVersion: messaging.knative.dev/v1
name: mychannel
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: azure-storage-blob-sink
properties:
accessKey: "The Access Key"
accountName: "The Account Name"
containerName: "The Container Name"

----

Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `azure-storage-blob-sink-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the sink using the following command:

[source,shell]
----
kubectl apply -f azure-storage-blob-sink-binding.yaml
----
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT