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 "Bucket.organization", "ScraperTargetResponse.organization" and "TelegrafPluginOutputInfluxDBV2Config.organization" should be rename to "org" [area/api] #13148

Closed
bednar opened this issue Apr 4, 2019 · 0 comments
Assignees
Labels
area/api kind/tech-debt Needs cleanup, will make the developer experience better

Comments

@bednar
Copy link
Contributor

bednar commented Apr 4, 2019

The Bucket schema is defined as:

    Bucket:
      properties:
        links:
          type: object
          readOnly: true
          example:
            labels: "/api/v2/buckets/1/labels"
            logs: "/api/v2/buckets/1/logs"
            members: "/api/v2/buckets/1/members"
            org: "/api/v2/orgs/2"
            owners: "/api/v2/buckets/1/owners"
            self: "/api/v2/buckets/1"
            write: "/api/v2/write?org=2&bucket=1"
          properties:
            labels:
              description: URL to retrieve labels for this bucket
              $ref: "#/components/schemas/Link"
            logs:
              description: URL to retrieve operation logs for this bucket
              $ref: "#/components/schemas/Link"
            members:
              description: URL to retrieve members that can read this bucket
              $ref: "#/components/schemas/Link"
            org:
              description: URL to retrieve parent organization for this bucket
              $ref: "#/components/schemas/Link"
            owners:
              description: URL to retrieve owners that can read and write to this bucket.
              $ref: "#/components/schemas/Link"
            self:
              description: URL for this bucket
              $ref: "#/components/schemas/Link"
            write:
              description: URL to write line protocol for this bucket
              $ref: "#/components/schemas/Link"
        id:
          readOnly: true
          type: string
        name:
          type: string
        organizationID:
          type: string
        organization:
          type: string
        rp:
          type: string
        retentionRules:
          type: array
          description: rules to expire or retain data.  No rules means data never expires.
          items:
            type: object
            properties:
              type:
                type: string
                default: expire
                enum:
                  - expire
              everySeconds:
                type: integer
                description: duration in seconds for how long data will be kept in the database.
                example: 86400
                minimum: 1
            required: [type, everySeconds]
        labels:
          $ref: "#/components/schemas/Labels"
      required: [name, retentionRules]

ScraperTargetResponse is defined as:

ScraperTargetResponse:
      type: object
      allOf:
        - $ref: "#/components/schemas/ScraperTargetRequest"
        - type: object
          properties:
            id:
              type: string
              readOnly: true
            organization:
              type: string
              description: name of the organization
            bucket:
              type: string
              description: name of the bucket
            links:
              type: object
              readOnly: true
              example:
                self: "/api/v2/scrapers/1"
                owners: "/api/v2/scrapers/1/owners"
                members: "/api/v2/scrapers/1/members"
                bucket: "/api/v2/buckets/1"
                organization: "/api/v2/orgs/1"
              properties:
                self:
                  $ref: "#/components/schemas/Link"
                members:
                  $ref: "#/components/schemas/Link"
                owners:
                  $ref: "#/components/schemas/Link"
                bucket:
                  $ref: "#/components/schemas/Link"
                organization:
                  $ref: "#/components/schemas/Link"

and TelegrafPluginOutputInfluxDBV2Config is defined as:

TelegrafPluginOutputInfluxDBV2Config:
      type: object
      required:
        - urls
        - token
        - organization
        - bucket
      properties:
        urls:
          type: array
          items:
            type: string
            format: uri
        token:
          type: string
        organization:
          type: string
        bucket:
          type: string
    IsOnboarding:

The properties organization should be renamed to org as is in rest of API:

TaskCreateRequest:
      type: object
      properties:
        orgID:
          description: The ID of the organization that owns this Task.
          type: string
        org:
          description: The name of the organization that owns this Task.
          type: string
        status:
          description: Starting state of the task. 'inactive' tasks are not run until they are updated to 'active'
          default: active
          type: string
          enum:
            - active
            - inactive
        flux:
          description: The Flux script to run for this task.
          type: string
        token:
          description: The token to use for authenticating this task when it executes queries. If omitted, uses the token associated with the request that creates the task.
          type: string
      required: [flux]

...

Permission:
      required: [action, resource]
      properties:
        action:
          type: string
          enum:
            - read
            - write
        resource:
          type: object
          required: [type]
          properties:
            type:
              type: string
              enum:
                - authorizations
                - buckets
                - dashboards
                - orgs
                - sources
                - tasks
                - telegrafs
                - users
                - variables
                - scrapers
                - secrets
                - labels
                - views
                - documents
            id:
              type: string
              nullable: true
              description: if id is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type.
            name:
              type: string
              nullable: true
              description: optional name of the resource if the resource has a name field.
            orgID:
              type: string
              nullable: true
              description: if orgID is set that is a permission for all resources owned my that org. if it is not set it is a permission for all resources of that resource type.
            org:
              type: string
              nullable: true
              description: optional name of the organization of the organization with orgID.

 Authorization:
      required: [orgID, permissions]
      allOf:
        - $ref: "#/components/schemas/AuthorizationUpdateRequest"
        - type: object
          properties:
            orgID:
              type: string
              description: ID of org that authorization is scoped to.
            permissions:
              type: array
              minLength: 1
              description: List of permissions for an auth.  An auth must have at least one Permission.
              items:
                $ref: "#/components/schemas/Permission"
            id:
              readOnly: true
              type: string
            token:
              readOnly: true
              type: string
              description: Passed via the Authorization Header and Token Authentication type.
            userID:
              readOnly: true
              type: string
              description: ID of user that created and owns the token.
            user:
              readOnly: true
              type: string
              description: Name of user that created and owns the token.
            org:
              readOnly: true
              type: string
              description: Name of the org token is scoped to.
            links:
              type: object
              readOnly: true
              example:
                self: "/api/v2/authorizations/1"
                user: "/api/v2/users/12"
              properties:
                self:
                  readOnly: true
                  type: string
                  format: uri
                user:
                  readOnly: true
                  type: string
                  format: uri

...

/buckets:
    get:
      tags:
        - Buckets
      summary: List all buckets
      parameters:
          - $ref: '#/components/parameters/TraceSpan'
          - $ref: "#/components/parameters/Offset"
          - $ref: "#/components/parameters/Limit"
          - in: query
            name: org
            description: specifies the organization name of the resource
            schema:
              type: string
          - in: query
            name: orgID
            description: specifies the organization id of the resource
            schema:
              type: string
          - in: query
            name: name
            description: only returns buckets with the specified name
            schema:
              type: string
      responses:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api kind/tech-debt Needs cleanup, will make the developer experience better
Projects
None yet
Development

No branches or pull requests

3 participants