Skip to content

Commit

Permalink
fix(http): update NotificationRuleBase and NotificationRule schema to…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
bednar authored Sep 26, 2019
1 parent 95d6301 commit 732c0cc
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 732c0cc

Please sign in to comment.