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 LabelResponse schema isn't used for "/scrapers/{scraperTargetID}/labels" and "/buckets/{bucketID}/labels" (POST method) [area/api] #77

Open
bednar opened this issue Mar 19, 2019 · 3 comments
Assignees

Comments

@bednar
Copy link
Contributor

bednar commented Mar 19, 2019

The POST response for /scrapers/{scraperTargetID}/labels and /buckets/{bucketID}/labels is defined as inner object:

'/scrapers/{scraperTargetID}/labels':
    post:
      tags:
        - ScraperTargets
      summary: add a label to a scraper target
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: scraperTargetID
          schema:
            type: string
          required: true
          description: ID of the scraper target
      requestBody:
        description: label to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Label"
      responses:
        '200':
          description: a list of all labels for a scraper target
          content:
            application/json:
              schema:
                type: object
                properties:
                  labels:
                    $ref: "#/components/schemas/Labels"
                  links:
                    $ref: "#/components/schemas/Links"

...

'/buckets/{bucketID}/labels':
    post:
      tags:
        - Buckets
      summary: add a label to a bucket
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: bucketID
          schema:
            type: string
          required: true
          description: ID of the bucket
      requestBody:
        description: label to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LabelMapping"
      responses:
        '200':
          description: a list of all labels for a bucket
          content:
            application/json:
              schema:
                type: object
                properties:
                  labels:
                    $ref: "#/components/schemas/Labels"
                  links:
                    $ref: "#/components/schemas/Links"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

but has to be defined as LabelResponse (same type as for GET).

@bednar bednar changed the title InfluxDB 2.0: The LabelsResponse schema isn't used for "/scrapers/{scraperTargetID}/labels" and "/buckets/{bucketID}/labels" (POST method) [area/api] InfluxDB 2.0: The LabelResponse schema isn't used for "/scrapers/{scraperTargetID}/labels" and "/buckets/{bucketID}/labels" (POST method) [area/api] Mar 19, 2019
@bednar
Copy link
Contributor Author

bednar commented Mar 26, 2019

Hi @kelwang

The response type for creating a label has to be LabelResponse not LabelsResponse.

The definition has to be same as for /orgs/{orgID}/labels and for /telegrafs/{telegrafID}/labels:

'/orgs/{orgID}/labels':
    ...
    post:
      tags:
        - Organizations
      summary: add a label to an organization
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: orgID
          schema:
            type: string
          required: true
          description: ID of the organization
      requestBody:
        description: label to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LabelMapping"
      responses:
        '200':
          description: returns the created label
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LabelResponse"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"


'/telegrafs/{telegrafID}/labels':
    ...
    post:
      tags:
        - Telegrafs
      summary: add a label to a telegraf config
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: telegrafID
          schema:
            type: string
          required: true
          description: ID of the telegraf config
      requestBody:
        description: label to add
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LabelMapping"
      responses:
        '200':
          description: "the label added to the telegraf config"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LabelResponse"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

cc @jademcgough

@bednar bednar reopened this Mar 26, 2019
@stale
Copy link

stale bot commented Jul 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jul 30, 2019

This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.

@stale stale bot closed this as completed Jul 30, 2019
@russorat russorat reopened this Feb 24, 2020
@russorat russorat transferred this issue from influxdata/influxdb May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants