Merge pull request from influxdata/fix-swagger-resource-labels

fix(swagger): Fixes conflicting label types
pull/15678/head
Brandon Farmer 2019-10-30 15:53:38 -07:00 committed by GitHub
commit a04212608a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 12 deletions
ui/src/types

View File

@ -9443,7 +9443,7 @@ components:
enum:
- active
- inactive
Check:
CheckDiscriminator:
oneOf:
- $ref: "#/components/schemas/DeadmanCheck"
- $ref: "#/components/schemas/ThresholdCheck"
@ -9452,9 +9452,16 @@ components:
mapping:
deadman: "#/components/schemas/DeadmanCheck"
threshold: "#/components/schemas/ThresholdCheck"
Check:
allOf:
- $ref: "#/components/schemas/CheckDiscriminator"
- type: object
properties:
labels:
$ref: "#/components/schemas/Labels"
PostCheck:
allOf:
- $ref: "#/components/schemas/Check"
- $ref: "#/components/schemas/CheckDiscriminator"
- type: object
properties:
status:
@ -9523,8 +9530,6 @@ components:
statusMessageTemplate:
description: The template used to generate and write a status message.
type: string
labels:
$ref: "#/components/schemas/Labels"
links:
type: object
readOnly: true
@ -9657,7 +9662,7 @@ components:
enum:
- active
- inactive
NotificationRule:
NotificationRuleDiscriminator:
oneOf:
- $ref: "#/components/schemas/SlackNotificationRule"
- $ref: "#/components/schemas/SMTPNotificationRule"
@ -9670,9 +9675,16 @@ components:
smtp: "#/components/schemas/SMTPNotificationRule"
pagerduty: "#/components/schemas/PagerDutyNotificationRule"
http: "#/components/schemas/HTTPNotificationRule"
NotificationRule:
allOf:
- $ref: "#/components/schemas/NotificationRuleDiscriminator"
- type: object
properties:
labels:
$ref: "#/components/schemas/Labels"
PostNotificationRule:
allOf:
- $ref: "#/components/schemas/NotificationRule"
- $ref: "#/components/schemas/NotificationRuleDiscriminator"
- type: object
properties:
status:
@ -9759,8 +9771,6 @@ components:
minItems: 1
items:
$ref: "#/components/schemas/StatusRule"
labels:
$ref: "#/components/schemas/Labels"
links:
type: object
readOnly: true
@ -9873,7 +9883,7 @@ components:
enum:
- active
- inactive
NotificationEndpoint:
NotificationEndpointDiscrimator:
oneOf:
- $ref: "#/components/schemas/SlackNotificationEndpoint"
- $ref: "#/components/schemas/PagerDutyNotificationEndpoint"
@ -9884,9 +9894,16 @@ components:
slack: "#/components/schemas/SlackNotificationEndpoint"
pagerduty: "#/components/schemas/PagerDutyNotificationEndpoint"
http: "#/components/schemas/HTTPNotificationEndpoint"
NotificationEndpoint:
allOf:
- $ref: "#/components/schemas/NotificationEndpointDiscrimator"
- type: object
properties:
labels:
$ref: "#/components/schemas/Labels"
PostNotificationEndpoint:
allOf:
- $ref: "#/components/schemas/NotificationEndpoint"
- $ref: "#/components/schemas/NotificationEndpointDiscrimator"
- type: object
properties:
status:
@ -9935,8 +9952,6 @@ components:
default: active
type: string
enum: ["active", "inactive"]
labels:
$ref: "#/components/schemas/Labels"
links:
type: object
readOnly: true

View File

@ -6,6 +6,7 @@ import {
SMTPNotificationRuleBase,
PagerDutyNotificationRuleBase,
HTTPNotificationRuleBase,
Label,
} from 'src/client'
type Omit<T, U> = Pick<T, Exclude<keyof T, U>>
@ -26,6 +27,7 @@ export type NotificationRuleBaseDraft = Overwrite<
id?: string
statusRules: StatusRuleDraft[]
tagRules: TagRuleDraft[]
labels?: Label[]
}
>