influxdata / influxdata/openapi

schema/StatusRule - properties count and period ignored in request

Open
#559 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
18
Forks
9
PR merge metrics
No merged PRs in 30d

Description

When sending a request with a StatusRule containing the properties count and period as defined in StatusRule.yml, the server responds with an object containing a StatusRule stripped of these two properties.

Request

reqBody {
   "type": "http",
   "every": "10m",
   "offset": "0s",
   "name": "HTTPRule_aae0",
   "status": "active",
   "tagRules": [],
   "labels": [],
   "statusRules": [
      {
         "currentLevel": "CRIT",
         "previousLevel": "ANY",
         "count": 3,
         "period": "1h"
      }
   ],
   "description": "foo",
   "limit": 3,
   "limitEvery": 3600,
   "runbookLink": "/api/v2private/notebooks?orgID=9c5955fc99a60b8f",
   "url": "http://bogus.listener.test",
   "orgID": "e7494b160b9c62db",
   "endpointID": "0a0bbe57aefd1000"
}

Response

{
   "id": "0a0bbe59fd226000",
   "name": "HTTPRule_aae0",
   "description": "foo",
   "endpointID": "0a0bbe57aefd1000",
   "orgID": "e7494b160b9c62db",
   "ownerID": "0a0bbe5654fd1000",
   "taskID": "0a0bbe59ffe14000",
   "every": "10m",
   "offset": "0s",
   "runbookLink": "/api/v2private/notebooks?orgID=9c5955fc99a60b8f",
   "statusRules": [
      {
         "currentLevel": "CRIT",
         "previousLevel": "ANY"
      }
   ],
   "limit": 3,
   "limitEvery": 3600,
   "createdAt": "2022-09-27T12:46:28.852229364Z",
   "updatedAt": "2022-09-27T12:46:28.852229364Z",
   "type": "http",
   "labels": [],
   "links": {
      "self": "/api/v2/notificationRules/0a0bbe59fd226000",
      "labels": "/api/v2/notificationRules/0a0bbe59fd226000/labels",
      "members": "/api/v2/notificationRules/0a0bbe59fd226000/members",
      "owners": "/api/v2/notificationRules/0a0bbe59fd226000/owners",
      "query": "/api/v2/notificationRules/0a0bbe59fd226000/query"
   },
   "status": "active",
   "latestCompleted": "2022-09-27T12:46:28Z",
   "latestScheduled": "2022-09-27T12:46:28Z"
}

StatusRule.yml

  type: object
  properties:
    currentLevel:
      $ref: "./RuleStatusLevel.yml"
    previousLevel:
      $ref: "./RuleStatusLevel.yml"
    count:
      type: integer
    period:
      type: string

Do the properties count and period serve a purpose? Have they been superseded by limit and limitEvery? Should they be removed from this definition?

Latest commit in openapi

commit ad64ba87e7dd666feb80bbb85d1757b3d290d6c3 (HEAD -> master, origin/master, origin/HEAD)
Author: wiedld <wiedld@users.noreply.github.com>
Date:   Thu Sep 22 10:01:37 2022 -0700

Testing in K8SIDPE - latest commit

commit d3c2922e6c43cc6d7708a1622d6d2d7b1943b769 (HEAD -> master, origin/master, origin/HEAD)
Author: influx-acs[bot] <107396960+influx-acs[bot]@users.noreply.github.com>
Date:   Tue Sep 27 01:45:24 2022 +0000

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with StatusRule.yml and compare its count and period properties with the request and response examples. Trace the API handling for statusRules to determine whether these fields are supported or superseded by limit and limitEvery. Done means the specification and API behavior agree, with the relevant request/response behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.