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

InfluxDB 2.0: The Telegraf "plugins" property is mapped to request schema [area/api] #12673

Closed
bednar opened this issue Mar 18, 2019 · 0 comments
Assignees
Labels

Comments

@bednar
Copy link
Contributor

bednar commented Mar 18, 2019

The Telegraf schema is defined as a copy of TelegrafRequest:

Telegraf:
      type: object
      allOf:
        - $ref: "#/components/schemas/TelegrafRequest"
        - type: object
          properties:
            id:
              type: string
            links:
              type: object
              example:
                self: "/api/v2/telegrafs/1"
                lables: "/api/v2/telegrafs/1/labels"
                owners: "/api/v2/telegrafs/1/owners"
                members: "/api/v2/telegrafs/1/members"
              properties:
                self:
                  $ref: "#/components/schemas/Link"
                labels:
                  $ref: "#/components/schemas/Link"
                members:
                  $ref: "#/components/schemas/Link"
                owners:
                  $ref: "#/components/schemas/Link"
            labels:
              $ref: "#/components/schemas/Labels"

The property plugins is defined an array of TelegrafRequestPlugin:

TelegrafRequest:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        agent:
          type: object
          properties:
            collectionInterval:
              type: integer
        plugins:
          type: array
          items:
            $ref: "#/components/schemas/TelegrafRequestPlugin"
        organizationID:
          type: string

but the Telegraf schema is used for a response not for a request.

The Telegraf.plugins has to be an array of TelegrafPlugin ([TelegrafPluginInputCpu, TelegrafPluginInputDocker]:

Telegraf:
      type: object
      allOf:
        - $ref: "#/components/schemas/TelegrafRequest"
        - type: object
          properties:
            id:
              type: string
            links:
              type: object
              example:
                self: "/api/v2/telegrafs/1"
                lables: "/api/v2/telegrafs/1/labels"
                owners: "/api/v2/telegrafs/1/owners"
                members: "/api/v2/telegrafs/1/members"
              properties:
                self:
                  $ref: "#/components/schemas/Link"
                labels:
                  $ref: "#/components/schemas/Link"
                members:
                  $ref: "#/components/schemas/Link"
                owners:
                  $ref: "#/components/schemas/Link"
            labels:
              $ref: "#/components/schemas/Labels"
            plugins:
              type: array
              items:
                $ref: "#/components/schemas/TelegrafPlugin"

...

TelegrafPlugin:
      type: object
      discriminator:
        propertyName: "name"
      required:
        - name
        - type
      properties:
        name:
          type: string
          example: cpu
        type:
          type: string
          enum:
            - input
            - output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants