All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kamelets.postgresql-sink.kamelet.yaml Maven / Gradle / Ivy

The newest version!
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
  name: postgresql-sink
  annotations:
    camel.apache.org/kamelet.support.level: "Stable"
    camel.apache.org/catalog.version: "4.8.0"
    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+UG9zdGdyZVNRTCBpY29uPC90aXRsZT48cGF0aCBkPSJNMTcuMTI4IDBhMTAuMTM0IDEwLjEzNCAwIDAgMC0yLjc1NS40MDNsLS4wNjMuMDJBMTAuOTIyIDEwLjkyMiAwIDAgMCAxMi42LjI1OEMxMS40MjIuMjM4IDEwLjQxLjUyNCA5LjU5NCAxIDguNzkuNzIxIDcuMTIyLjI0IDUuMzY0LjMzNiA0LjE0LjQwMyAyLjgwNC43NzUgMS44MTQgMS44Mi44MjcgMi44NjUuMzA1IDQuNDgyLjQxNSA2LjY4MmMuMDMuNjA3LjIwMyAxLjU5Ny40OSAyLjg3OXMuNjkgMi43ODMgMS4xOTMgNC4xNTJjLjUwMyAxLjM3IDEuMDU0IDIuNiAxLjkxNSAzLjQzNi40My40MTkgMS4wMjIuNzcxIDEuNzIu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1NyAxLjYwNy0xLjA0LjA4NC0uMTE4LjA5My0uMjkyLjAyNC0uNDc5LS4wNy0uMTg3LS4yMjMtLjM0OC0uMzMxLS4zOTNhLjY1My42NTMgMCAwIDAtLjIwNC0uMDZ6Ii8+PC9zdmc+"
    camel.apache.org/provider: "Apache Software Foundation"
    camel.apache.org/kamelet.group: "SQL"
    camel.apache.org/kamelet.namespace: "Database"
  labels:
    camel.apache.org/kamelet.type: "sink"
spec:
  definition:
    title: "PostgreSQL Sink"
    description: |-
      Send data to a PostgreSQL Database.

      This Kamelet expects a JSON-formatted body. Use key:value pairs to map the JSON fields and parameters. For example, here is a query:

      'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'

      Here is example input for the example query:

      '{ "username":"oscerd", "city":"Rome"}'
    required:
      - serverName
      - username
      - password
      - query
      - databaseName
    type: object
    properties:
      serverName:
        title: Server Name
        description: The server name for the data source.
        type: string
        example: localhost
      serverPort:
        title: Server Port
        description: The server port for the data source.
        type: string
        default: 5432
      username:
        title: Username
        description: The username to access a secured PostgreSQL Database.
        type: string
        x-descriptors:
        - urn:camel:group:credentials
      password:
        title: Password
        description: The password to access a secured PostgreSQL Database.
        type: string
        format: password
        x-descriptors:
        - urn:camel:group:credentials
      query:
        title: Query
        description: The query to execute against the PostgreSQL Database.
        type: string
        example: 'INSERT INTO accounts (username,city) VALUES (:#username,:#city)'
      databaseName:
        title: Database Name
        description: The name of the PostgreSQL Database.
        type: string
  types:
    in:
      mediaType: application/json
  dependencies:
  - "camel:jackson"
  - "camel:kamelet"
  - "camel:sql"
  - "mvn:org.postgresql:postgresql:42.7.4"
  - "mvn:org.apache.commons:commons-dbcp2:2.12.0"
  template:
    beans:
      - name: dsBean
        type: "#class:org.apache.commons.dbcp2.BasicDataSource"
        properties:
          username: '{{username}}'
          password: '{{password}}'
          url: 'jdbc:postgresql://{{serverName}}:{{serverPort}}/{{databaseName}}'
          driverClassName: 'org.postgresql.Driver'
    from:
      uri: "kamelet:source"
      steps:
      - unmarshal:
          json: 
            library: Jackson
      - to: 
          uri: "sql:{{query}}"
          parameters:
            dataSource: "#bean:{{dsBean}}"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy