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

Add services endpoint to swagger definition and Fix NPE #53

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions definitions/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ MatchAll:
description: Match all filter
allOf:
- $ref: '#/definitions/Filter'
- type: object

MatchAllConditions:
x-opsgenie-domain: common
Expand Down Expand Up @@ -432,4 +431,4 @@ TeamResponder:
- type: object
properties:
name:
type: string
type: string
116 changes: 57 additions & 59 deletions definitions/incident.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,67 @@
StatusPageEntry:
x-opsgenie-domain: incident
type: object
allOf:
- required:
- title
- properties:
title:
type: string
description: The message to be added using status page into incident
details:
type: string
description: Description of the message being added via stats page into incident
required:
- title
properties:
title:
type: string
description: The message to be added using status page into incident
details:
type: string
description: Description of the message being added via stats page into incident

CreateIncidentPayload:
x-opsgenie-domain: incident
type: object
allOf:
- required:
- message
- serviceId
- properties:
message:
type: string
description: Message of the incident
description:
type: string
description: Description field of the incident that is generally used to provide a detailed information about the incident.
responders:
type: array
description: Responders that the incident will be routed to send notifications
items:
$ref: "#/definitions/Recipient"
tags:
type: array
description: Tags of the incident.
items:
type: string
details:
type: object
description: Map of key-value pairs to use as custom properties of the incident
additionalProperties:
type: string
priority:
type: string
description: Priority level of the incident
enum:
- P1
- P2
- P3
- P4
- P5
note:
type: string
description: Additional note that will be added while creating the incident
serviceId:
type: string
description: Service on which incident will be created.
statusPageEntry:
type: object
description: Status page entry fields. If this field is leaved blank, message and description of incident will be used for title and detail respectively.
additionalProperties:
$ref: "#/definitions/StatusPageEntry"
notifyStakeholders:
type: boolean
description: Indicate whether stakeholders are notified or not. Default value is false.
required:
- message
- serviceId
properties:
message:
type: string
description: Message of the incident
description:
type: string
description: Description field of the incident that is generally used to provide a detailed information about the incident.
responders:
type: array
description: Responders that the incident will be routed to send notifications
items:
$ref: "#/definitions/Recipient"
tags:
type: array
description: Tags of the incident.
items:
type: string
details:
type: object
description: Map of key-value pairs to use as custom properties of the incident
additionalProperties:
type: string
priority:
type: string
description: Priority level of the incident
enum:
- P1
- P2
- P3
- P4
- P5
note:
type: string
description: Additional note that will be added while creating the incident
serviceId:
type: string
description: Service on which incident will be created.
statusPageEntry:
type: object
description: Status page entry fields. If this field is leaved blank, message and description of incident will be used for title and detail respectively.
additionalProperties:
$ref: "#/definitions/StatusPageEntry"
notifyStakeholders:
type: boolean
description: Indicate whether stakeholders are notified or not. Default value is false.

IncidentActionPayload:
x-opsgenie-domain: incident
Expand Down
8 changes: 7 additions & 1 deletion definitions/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ IntegrationMeta:
type: string
teamId:
type: string

apiKey:
type: string
emailAddress:
type: string
AlertFilter:
type: object
properties:
Expand Down Expand Up @@ -555,6 +558,7 @@ ActionMapping:
OutgoingCallbackNew:
type: object
discriminator: callback-type
x-discriminator-is-enum: true
properties:
alertFilter:
$ref: '#/definitions/AlertFilter'
Expand Down Expand Up @@ -657,6 +661,7 @@ BaseWebhookCallback:
OutgoingCallback:
type: object
discriminator: callback-type
x-discriminator-is-enum: true
properties:
alertFilter:
$ref: '#/definitions/AlertFilter'
Expand Down Expand Up @@ -1810,6 +1815,7 @@ Integration:
BaseIncomingFeature:
type: object
discriminator: feature-type
x-discriminator-is-enum: true
properties:
suppressNotifications:
description: If enabled, notifications that come from alerts will be suppressed. Defaults to false
Expand Down
96 changes: 96 additions & 0 deletions definitions/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
##################
# REQUEST #
##################
CreateServicePayload:
type: object
required:
- name
properties:
name:
type: string
description: Name of the service
teamId:
type: string
description: Team id of the service.
description:
type: string
description: Description field of the service that is generally used to provide a detailed information about the service.
visibility:
type: string
enum:
- TEAM_MEMBERS
- OPSGENIE_USERS
tags:
type: array
items:
type: string

UpdateServicePayload:
type: object
required:
- name
properties:
name:
type: string
description: Name of the service
description:
type: string
description: Description field of the service that is generally used to provide a detailed information about the service.
visibility:
type: string
enum:
- TEAM_MEMBERS
- OPSGENIE-USERS

##################
# RESPONSE #
##################
GetServiceResponse:
type: object
allOf:
- $ref: '#/definitions/BaseResponse'
- properties:
data:
$ref: '#/definitions/Service'

ListServicesResponse:
type: object
allOf:
- $ref: '#/definitions/BaseResponse'
- properties:
data:
type: array
items:
$ref: '#/definitions/Service'
paging:
$ref: '#/definitions/PageDetails'

##################
# MODEL #
##################
Service:
type: object
required:
- name
properties:
id:
type: string
description: Id of the service
name:
type: string
description: Name of the service
teamId:
type: string
description: Team id of the service.
description:
type: string
description: Description field of the service that is generally used to provide a detailed information about the service.
visibility:
type: string
enum:
- TEAM_MEMBERS
- OPSGENIE_USERS
tags:
type: array
items:
type: string
91 changes: 91 additions & 0 deletions definitions/serviceAudienceTemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
##################
# REQUEST #
##################
PartialUpdateServiceAudienceTemplatePayload:
type: object
properties:
responder:
$ref: "#/definitions/ServiceAudienceTemplateResponder"
stakeholder:
$ref: "#/definitions/ServiceAudienceTemplateStakeholder"

##################
# RESPONSE #
##################
GetServiceAudienceTemplateResponse:
type: object
allOf:
- $ref: "#/definitions/BaseResponse"
- properties:
data:
$ref: "#/definitions/ServiceAudienceTemplate"

PartialUpdateServiceAudienceTemplateResponse:
type: object
allOf:
- $ref: "#/definitions/BaseResponse"

##################
# MODEL #
##################
ServiceAudienceTemplate:
type: object
properties:
responder:
$ref: "#/definitions/ServiceAudienceTemplateResponder"
stakeholder:
$ref: "#/definitions/ServiceAudienceTemplateStakeholder"

ServiceAudienceTemplateResponder:
type: object
properties:
teams:
type: array
items:
type: string
individuals:
type: array
items:
type: string

ServiceAudienceTemplateStakeholder:
type: object
properties:
individuals:
type: array
items:
type: string
conditionMatchType:
type: string
description: Match type for given conditions. Possible values are [match-all-conditions, match-any-condition]. Default value is [match-any-condition].
enum:
- match-all-conditions
- match-any-condition
conditions:
type: array
items:
$ref: "#/definitions/ServiceAudienceTemplateCondition"

ServiceAudienceTemplateCondition:
type: object
required:
- matchField
- value
properties:
matchField:
type: string
description: Field to be matched for users. Possible values are [country, state, city, zipCode, line, tag, customProperty]. customProperty can be used while actionType is keyValue.
enum:
- country
- state
- city
- zipCode
- line
- tag
- customProperty
key:
type: string
description: If matchField is customProperty, key must be given.
value:
type: string
description: Value to be check for the match field.
Loading