fix(http): update NotificationRuleBase and NotificationRule schema to reflect reality (#15244)

* NotificationRuleBase: the endpointID should be required and editable, there is missing a links property
 * NotificationRule: add discriminator
 * add a missing TraceSpan parameter into a GetNotificationRules and GetChecks
pull/15286/head
Jakub Bednář 2019-09-26 12:07:44 +02:00 committed by GitHub
parent 95d6301458
commit 732c0cc28d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 1 deletions

View File

@ -5093,6 +5093,7 @@ paths:
- Checks
summary: Get all checks
parameters:
- $ref: '#/components/parameters/TraceSpan'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
- in: query
@ -5374,6 +5375,7 @@ paths:
- NotificationRules
summary: Get all notification rules
parameters:
- $ref: '#/components/parameters/TraceSpan'
- $ref: '#/components/parameters/Offset'
- $ref: '#/components/parameters/Limit'
- in: query
@ -9522,6 +9524,13 @@ components:
- $ref: "#/components/schemas/SMTPNotificationRule"
- $ref: "#/components/schemas/PagerDutyNotificationRule"
- $ref: "#/components/schemas/HTTPNotificationRule"
discriminator:
propertyName: type
mapping:
slack: "#/components/schemas/SlackNotificationRule"
smtp: "#/components/schemas/SMTPNotificationRule"
pagerduty: "#/components/schemas/PagerDutyNotificationRule"
http: "#/components/schemas/HTTPNotificationRule"
NotificationRules:
properties:
notificationRules:
@ -9539,13 +9548,13 @@ components:
- name
- tagRules
- statusRules
- endpointID
properties:
id:
readOnly: true
type: string
endpointID:
type: string
readOnly: true
orgID:
description: The ID of the organization that owns this notification rule.
type: string
@ -9598,6 +9607,27 @@ components:
$ref: "#/components/schemas/StatusRule"
labels:
$ref: "#/components/schemas/Labels"
links:
type: object
readOnly: true
example:
self: "/api/v2/notificationRules/1"
labels: "/api/v2/notificationRules/1/labels"
members: "/api/v2/notificationRules/1/members"
owners: "/api/v2/notificationRules/1/owners"
properties:
self:
description: URL for this endpoint.
$ref: "#/components/schemas/Link"
labels:
description: URL to retrieve labels for this notification rule.
$ref: "#/components/schemas/Link"
members:
description: URL to retrieve members for this notification rule.
$ref: "#/components/schemas/Link"
owners:
description: URL to retrieve owners for this notification rule.
$ref: "#/components/schemas/Link"
TagRule:
type: object
properties: