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 Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB #1850

Merged
merged 6 commits into from
Jan 25, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions kamelets/azure-cosmosdb-sink.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ spec:
In the headers, you can optionally set the `itemPartitionKey` / `ce-itemPartitionKey` property to specify the partition key for a specific item.

If you do not set the property in the header, you'll need to use the static property itemPartitonKey.

There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed.

In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell.
required:
- databaseName
- containerName
- accountKey
- databaseEndpoint
type: object
properties:
Expand All @@ -67,6 +70,12 @@ spec:
title: Item Partition Key
description: Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in.
type: string
credentialType:
title: Credential Type
description: Determines the credential strategy to adopt.
type: string
enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"]
default: "SHARED_ACCOUNT_KEY"
types:
in:
mediaType: application/json
Expand Down Expand Up @@ -102,8 +111,9 @@ spec:
- to:
uri: "azure-cosmosdb:{{databaseName}}/{{containerName}}"
parameters:
accountKey: "{{accountKey}}"
accountKey: "{{?accountKey}}"
databaseEndpoint: "{{databaseEndpoint}}"
itemPartitionKey: "{{?itemPartitionKey}}"
operation: createItem
credentialType: "{{credentialType}}"

16 changes: 13 additions & 3 deletions kamelets/azure-cosmosdb-source.kamelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ spec:
definition:
title: "Azure CosmosDB Source"
description: |-
Consume Changes from a CosmosDB instance
Consume Changes from a CosmosDB instance.

There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed.

In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell.
required:
- databaseName
- containerName
- accountKey
- databaseEndpoint
type: object
properties:
Expand Down Expand Up @@ -77,6 +80,12 @@ spec:
title: Database Endpoint
description: Sets the Azure Cosmos database endpoint the component will connect to.
type: string
credentialType:
title: Credential Type
description: Determines the credential strategy to adopt.
type: string
enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"]
default: "SHARED_ACCOUNT_KEY"
types:
out:
mediaType: application/json
Expand All @@ -90,10 +99,11 @@ spec:
parameters:
leaseDatabaseName: "{{?leaseDatabaseName}}"
leaseContainerName: "{{?leaseContainerName}}"
accountKey: "{{accountKey}}"
accountKey: "{{?accountKey}}"
createLeaseDatabaseIfNotExists: "{{createLeaseDatabaseIfNotExists}}"
createLeaseContainerIfNotExists: "{{createLeaseContainerIfNotExists}}"
databaseEndpoint: "{{databaseEndpoint}}"
credentialType: "{{credentialType}}"
steps:
- marshal:
json: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void testAllKameletDependencies() throws Exception {
void testSupportedHeaders() throws Exception {
verifyHeaders("aws-s3-source", 20);
verifyHeaders("aws-s3-sink", 27);
verifyHeaders("aws-cloudtrail-source", 0);
verifyHeaders("aws-cloudtrail-source", 4);
verifyHeaders("aws-redshift-source", 0);
verifyHeaders("aws-not-exists", 0);
verifyHeaders("azure-eventhubs-sink", 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ spec:
In the headers, you can optionally set the `itemPartitionKey` / `ce-itemPartitionKey` property to specify the partition key for a specific item.

If you do not set the property in the header, you'll need to use the static property itemPartitonKey.

There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed.

In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell.
required:
- databaseName
- containerName
- accountKey
- databaseEndpoint
type: object
properties:
Expand All @@ -67,6 +70,12 @@ spec:
title: Item Partition Key
description: Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in.
type: string
credentialType:
title: Credential Type
description: Determines the credential strategy to adopt.
type: string
enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"]
default: "SHARED_ACCOUNT_KEY"
types:
in:
mediaType: application/json
Expand Down Expand Up @@ -102,8 +111,9 @@ spec:
- to:
uri: "azure-cosmosdb:{{databaseName}}/{{containerName}}"
parameters:
accountKey: "{{accountKey}}"
accountKey: "{{?accountKey}}"
databaseEndpoint: "{{databaseEndpoint}}"
itemPartitionKey: "{{?itemPartitionKey}}"
operation: createItem
credentialType: "{{credentialType}}"

Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ spec:
definition:
title: "Azure CosmosDB Source"
description: |-
Consume Changes from a CosmosDB instance
Consume Changes from a CosmosDB instance.

There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed.

In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell.
required:
- databaseName
- containerName
- accountKey
- databaseEndpoint
type: object
properties:
Expand Down Expand Up @@ -77,6 +80,12 @@ spec:
title: Database Endpoint
description: Sets the Azure Cosmos database endpoint the component will connect to.
type: string
credentialType:
title: Credential Type
description: Determines the credential strategy to adopt.
type: string
enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"]
default: "SHARED_ACCOUNT_KEY"
types:
out:
mediaType: application/json
Expand All @@ -90,10 +99,11 @@ spec:
parameters:
leaseDatabaseName: "{{?leaseDatabaseName}}"
leaseContainerName: "{{?leaseContainerName}}"
accountKey: "{{accountKey}}"
accountKey: "{{?accountKey}}"
createLeaseDatabaseIfNotExists: "{{createLeaseDatabaseIfNotExists}}"
createLeaseContainerIfNotExists: "{{createLeaseContainerIfNotExists}}"
databaseEndpoint: "{{databaseEndpoint}}"
credentialType: "{{credentialType}}"
steps:
- marshal:
json: {}
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>camel-dependencies</artifactId>
<version>4.3.0</version>
<version>4.4.0-SNAPSHOT</version>
</parent>

<groupId>org.apache.camel.kamelets</groupId>
Expand Down Expand Up @@ -62,7 +62,7 @@
<apache-rat-plugin.version>0.16</apache-rat-plugin.version>
<cyclonedx-maven-plugin-version>2.7.11</cyclonedx-maven-plugin-version>

<camel.version>4.3.0</camel.version>
<camel.version>4.4.0-SNAPSHOT</camel.version>
<camel.k.crds.version>2.2.0</camel.k.crds.version>

<citrus.version>4.1.0</citrus.version>
Expand Down
Loading