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 "TaskCreateRequest" and "TaskUpdateRequest" doesn't have defined a description field [area/api] #13879

Closed
bednar opened this issue May 10, 2019 · 0 comments · Fixed by #14724

Comments

@bednar
Copy link
Contributor

bednar commented May 10, 2019

The Task is defined with description field:

Task:
      type: object
      properties:
        id:
          readOnly: true
          type: string
        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
        name:
          description: The name of the task.
          type: string
        description:
          description: An optional description of the task.
          type: string
        status:
          description: The current status of the task. When updated to 'inactive', cancels all queued jobs of this task.
          default: active
          type: string
          enum:
            - active
            - inactive
        labels:
          $ref: "#/components/schemas/Labels"
        authorizationID:
          description: The ID of the authorization used when this task communicates with the query engine.
          type: string
        flux:
          description: The Flux script to run for this task.
          type: string
        every:
          description: A simple task repetition schedule; parsed from Flux.
          type: string
        cron:
          description: A task repetition schedule in the form '* * * * * *'; parsed from Flux.
          type: string
        offset:
          description: Duration to delay after the schedule, before executing the task; parsed from flux, if set to zero it will remove this option and use 0 as the default.
          type: string
        latestCompleted:
          description: Timestamp of latest scheduled, completed run, RFC3339.
          type: string
          format: date-time
          readOnly: true
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
        links:
          type: object
          readOnly: true
          example:
            self: "/api/v2/tasks/1"
            owners: "/api/v2/tasks/1/owners"
            members: "/api/v2/tasks/1/members"
            labels: "/api/v2/tasks/1/labels"
            runs: "/api/v2/tasks/1/runs"
            logs: "/api/v2/tasks/1/logs"
          properties:
            self:
              $ref: "#/components/schemas/Link"
            owners:
              $ref: "#/components/schemas/Link"
            members:
              $ref: "#/components/schemas/Link"
            runs:
              $ref: "#/components/schemas/Link"
            logs:
              $ref: "#/components/schemas/Link"
            labels:
              $ref: "#/components/schemas/Link"
      required: [id, name, orgID, flux]

but the TaskCreateRequest and TaskUpdateRequest doesn't have a description field:

 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]

TaskUpdateRequest:
      type: object
      properties:
        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
        name:
          description: Override the 'name' option in the flux script.
          type: string
        every:
          description: Override the 'every' option in the flux script.
          type: string
        cron:
          description: Override the 'cron' option in the flux script.
          type: string
        offset:
          description: Override the 'offset' option in the flux script.
          type: string
        token:
          description: Override the existing token associated with the task.
          type: string

so there is no option how to set description to Task because create and update is defined as:

/tasks:
    post:
      tags:
        - Tasks
      summary: Create a new task
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
      requestBody:
        description: task to create
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskCreateRequest"
      responses:
        '201':
          description: Task created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

'/tasks/{taskID}':
    patch:
      tags:
        - Tasks
      summary: Update a task
      description: Update a task. This will cancel all queued runs.
      requestBody:
        description: task update to apply
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaskUpdateRequest"
      parameters:
        - $ref: '#/components/parameters/TraceSpan'
        - in: path
          name: taskID
          schema:
            type: string
          required: true
          description: ID of task to get
      responses:
        '200':
          description: task updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

introduced by #13850, cc @AlirieGray, @jademcgough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants