---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: influxdb
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: influxdb
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: influxdb
        spec:
          containers:
          - image: funktion/connector-influxdb:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: influxdb
      syntax: influxdb:connectionBean
      title: InfluxDB
      description: The influxdb component allows you to interact with InfluxDB a time series database.
      label: database,ticks
      deprecated: false
      async: false
      producerOnly: true
      javaType: org.apache.camel.component.influxdb.InfluxDbComponent
      groupId: org.apache.camel
      artifactId: camel-influxdb
      version: 2.18.3
    componentProperties: {}
    properties:
      connectionBean:
        kind: path
        group: producer
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Name of org.influxdb.InfluxDB to use.
        order: 0
      databaseName:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Setter for databaseName
        order: 1
      retentionPolicy:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        defaultValue: default
        description: Setter for retentionPolicy
        order: 2
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 3
  documentation.adoc: |+
    [[InfluxDb-InfluxDbComponent]]
    InfluxDb Component
    ~~~~~~~~~~~~~~~~~~~~

    *Available as of Camel 2.18.0*

    This component allows you to interact with InfluxDB
    https://influxdata.com/time-series-platform/influxdb/ a time series database. The native body type for this component is
    Point (the native influxdb class), but it can also accept Map<String, Object> as message body and it will get converted
    to Point.class, please note that the map must contain an element with InfluxDbConstants.MEASUREMENT_NAME as key.

    Aditionally of course you may register your own Converters to your data type to Point, or use the
    (un)marshalling tools provided by camel.


    From *Camel 2.18* onwards Influxdb requires Java 8.

    Maven users will need to add the following dependency to their `pom.xml`
    for this component:

    [source,xml]
    ------------------------------------------------------------
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-influxdb</artifactId>
        <version>x.x.x</version>
        <!-- use the same version as your Camel core version -->
    </dependency>
    ------------------------------------------------------------

    [[InfluxDb-URIformat]]
    URI format
    ^^^^^^^^^^

    [source,java]
    -------------------------------
    influxdb://beanName?[options]
    -------------------------------

    [[InfluxDb-URIOptions]]
    URI Options
    ^^^^^^^^^^^

    The producer allows sending messages to a influxdb
    configured in the registry, using the native java driver.



    // component options: START
    The InfluxDB component has no options.
    // component options: END




    // endpoint options: START
    The InfluxDB component supports 4 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | connectionBean | producer |  | String | *Required* Name of org.influxdb.InfluxDB to use.
    | databaseName | producer |  | String | Setter for databaseName
    | retentionPolicy | producer | default | String | Setter for retentionPolicy
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END




    [[InfluxDb-MessageHeaders]]
    Message Headers
    ^^^^^^^^^^^^^^^

    [width="100%",cols="10%,10%,10%,10%,60%",options="header",]
    |=======================================================================
    |Name |Default Value |Type |Context |Description


    |=======================================================================

    [[InfluxDb-Example]]
    Example
    ^^^^^^^


    Below is an example route that stores a point into the db (taking the db name from the URI)
    specific key:

    [source,java]
    ------------------------------------------------------------------------------------
    from("direct:start")
            .setHeader(InfluxDbConstants.DBNAME_HEADER, constant("myTimeSeriesDB"))
            .to("influxdb://connectionBean);
    ------------------------------------------------------------------------------------

    [source,java]
    ------------------------------------------------------------------------------------
    from("direct:start")
            .to("influxdb://connectionBean?databaseName=myTimeSeriesDB");
    ------------------------------------------------------------------------------------

    For more information, see these resources...

    [[InfluxDb-SeeAlso]]
    See Also
    ^^^^^^^^

    * link:configuring-camel.html[Configuring Camel]
    * link:component.html[Component]
    * link:endpoint.html[Endpoint]
    * link:getting-started.html[Getting Started]

