|
| 1 | +# OpenApi header is included in this file to support code highlighting in VSCode |
| 2 | +openapi: 3.0.3 |
| 3 | +info: |
| 4 | + title: Suppressions API |
| 5 | + version: "1.0.0" |
| 6 | +paths: |
| 7 | + /suppressions: |
| 8 | + get: |
| 9 | + tags: |
| 10 | + - suppression |
| 11 | + summary: "List user suppressions" |
| 12 | + description: "List all active user suppressions" |
| 13 | + operationId: getAllUserSuppressions |
| 14 | + responses: |
| 15 | + "200": |
| 16 | + $ref: "#/components/responses/userSuppressions" |
| 17 | + "500": |
| 18 | + $ref: "#/components/responses/suppressionApiError" |
| 19 | + post: |
| 20 | + tags: |
| 21 | + - suppression |
| 22 | + summary: "Create a user suppression" |
| 23 | + description: "Create a new user suppression. Only one user suppression may be active per monitor check state." |
| 24 | + operationId: createUserSuppression |
| 25 | + requestBody: |
| 26 | + $ref: "#/components/requestBodies/createUserSuppression" |
| 27 | + responses: |
| 28 | + "200": |
| 29 | + $ref: "#/components/responses/userSuppression" |
| 30 | + "400": |
| 31 | + $ref: "#/components/responses/suppressionApiError" |
| 32 | + "409": |
| 33 | + $ref: "#/components/responses/suppressionConflictError" |
| 34 | + "500": |
| 35 | + $ref: "#/components/responses/suppressionApiError" |
| 36 | + |
| 37 | + /suppressions/{suppressionIdentifier}: |
| 38 | + delete: |
| 39 | + tags: |
| 40 | + - suppression |
| 41 | + summary: "Delete a user suppression" |
| 42 | + description: "Remove a user suppression by its identifier." |
| 43 | + operationId: deleteUserSuppression |
| 44 | + parameters: |
| 45 | + - $ref: "#/components/parameters/suppressionIdentifier" |
| 46 | + responses: |
| 47 | + "204": |
| 48 | + description: "Suppression removed" |
| 49 | + "400": |
| 50 | + $ref: "#/components/responses/suppressionApiError" |
| 51 | + "404": |
| 52 | + $ref: "#/components/responses/suppressionNotFoundError" |
| 53 | + "500": |
| 54 | + $ref: "#/components/responses/suppressionApiError" |
| 55 | + |
| 56 | +components: |
| 57 | + parameters: |
| 58 | + suppressionIdentifier: |
| 59 | + in: path |
| 60 | + name: suppressionIdentifier |
| 61 | + required: true |
| 62 | + schema: |
| 63 | + type: string |
| 64 | + description: "The unique identifier (URN) of the user suppression" |
| 65 | + |
| 66 | + requestBodies: |
| 67 | + createUserSuppression: |
| 68 | + required: true |
| 69 | + content: |
| 70 | + application/json: |
| 71 | + schema: |
| 72 | + $ref: "#/components/schemas/CreateUserSuppression" |
| 73 | + |
| 74 | + responses: |
| 75 | + userSuppression: |
| 76 | + description: "A user suppression" |
| 77 | + content: |
| 78 | + application/json: |
| 79 | + schema: |
| 80 | + $ref: "#/components/schemas/UserSuppressionStatus" |
| 81 | + userSuppressions: |
| 82 | + description: "List of user suppressions" |
| 83 | + content: |
| 84 | + application/json: |
| 85 | + schema: |
| 86 | + $ref: "#/components/schemas/UserSuppressionStatusList" |
| 87 | + suppressionApiError: |
| 88 | + description: "Error response" |
| 89 | + content: |
| 90 | + application/json: |
| 91 | + schema: |
| 92 | + $ref: "#/components/schemas/SuppressionApiError" |
| 93 | + suppressionNotFoundError: |
| 94 | + description: "Suppression not found" |
| 95 | + content: |
| 96 | + application/json: |
| 97 | + schema: |
| 98 | + $ref: "#/components/schemas/SuppressionNotFoundError" |
| 99 | + suppressionConflictError: |
| 100 | + description: "A user suppression already exists for the given monitor check state" |
| 101 | + content: |
| 102 | + application/json: |
| 103 | + schema: |
| 104 | + $ref: "#/components/schemas/SuppressionConflictError" |
| 105 | + |
| 106 | + schemas: |
| 107 | + CreateUserSuppression: |
| 108 | + type: object |
| 109 | + description: "Request body for creating a user suppression" |
| 110 | + properties: |
| 111 | + note: |
| 112 | + type: string |
| 113 | + description: "Human-readable reason for the suppression." |
| 114 | + expiryEpochS: |
| 115 | + type: integer |
| 116 | + format: int64 |
| 117 | + description: "Unix epoch (seconds) at which this suppression expires. Maximum is 6 hours from now." |
| 118 | + selector: |
| 119 | + $ref: "#/components/schemas/UserSuppressionSelector" |
| 120 | + required: |
| 121 | + - note |
| 122 | + - selector |
| 123 | + |
| 124 | + UserSuppressionStatus: |
| 125 | + type: object |
| 126 | + description: "A user suppression as returned by the API" |
| 127 | + properties: |
| 128 | + identifier: |
| 129 | + type: string |
| 130 | + description: "Unique URN for this suppression." |
| 131 | + note: |
| 132 | + type: string |
| 133 | + expiryEpochS: |
| 134 | + type: integer |
| 135 | + format: int64 |
| 136 | + selector: |
| 137 | + $ref: "#/components/schemas/UserSuppressionSelector" |
| 138 | + required: |
| 139 | + - identifier |
| 140 | + - note |
| 141 | + - selector |
| 142 | + |
| 143 | + UserSuppressionSelector: |
| 144 | + type: object |
| 145 | + description: "Selects what to suppress. Discriminated by `type` to allow future selector variants." |
| 146 | + properties: |
| 147 | + type: |
| 148 | + type: string |
| 149 | + oneOf: |
| 150 | + - $ref: "#/components/schemas/MonitorCheckStateSelector" |
| 151 | + discriminator: |
| 152 | + propertyName: type |
| 153 | + required: |
| 154 | + - type |
| 155 | + |
| 156 | + MonitorCheckStateSelector: |
| 157 | + type: object |
| 158 | + description: "Selects a single monitor check state identified by monitor + checkStateId." |
| 159 | + properties: |
| 160 | + type: |
| 161 | + type: string |
| 162 | + enum: [MonitorCheckStateSelector] |
| 163 | + monitorId: |
| 164 | + $ref: "common.api.yaml#/components/schemas/MonitorReferenceId" |
| 165 | + checkStateId: |
| 166 | + type: string |
| 167 | + description: "The check state id within the monitor's output." |
| 168 | + subStream: |
| 169 | + type: string |
| 170 | + description: "The sub-stream identifier (always absent for Monitors, present for ExternalMonitors)." |
| 171 | + required: |
| 172 | + - type |
| 173 | + - monitorId |
| 174 | + - checkStateId |
| 175 | + |
| 176 | + UserSuppressionStatusList: |
| 177 | + type: object |
| 178 | + properties: |
| 179 | + suppressions: |
| 180 | + type: array |
| 181 | + items: |
| 182 | + $ref: "#/components/schemas/UserSuppressionStatus" |
| 183 | + required: |
| 184 | + - suppressions |
| 185 | + |
| 186 | + SuppressionApiError: |
| 187 | + type: object |
| 188 | + properties: |
| 189 | + message: |
| 190 | + type: string |
| 191 | + required: |
| 192 | + - message |
| 193 | + |
| 194 | + SuppressionNotFoundError: |
| 195 | + type: object |
| 196 | + properties: |
| 197 | + identifier: |
| 198 | + type: string |
| 199 | + _type: |
| 200 | + type: string |
| 201 | + enum: |
| 202 | + - SuppressionNotFoundError |
| 203 | + required: |
| 204 | + - identifier |
| 205 | + - _type |
| 206 | + |
| 207 | + SuppressionConflictError: |
| 208 | + type: object |
| 209 | + properties: |
| 210 | + message: |
| 211 | + type: string |
| 212 | + existingIdentifier: |
| 213 | + type: string |
| 214 | + description: "The identifier of the already-active suppression." |
| 215 | + required: |
| 216 | + - message |
| 217 | + - existingIdentifier |
0 commit comments