Skip to content

Commit 18cf7a2

Browse files
committed
docs(webhooks): create webhooks API spec
1 parent 3bdedad commit 18cf7a2

File tree

1 file changed

+170
-0
lines changed

1 file changed

+170
-0
lines changed

docs/openapi3.yaml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ tags:
3737
- name: Configuration
3838
description: |
3939
This resource allows you to configure Predator programmatically.
40+
- name: Webhooks
41+
description: |
42+
This resource allows you to configure webhooks.
4043
x-tagGroups:
4144
- name: Reference
4245
tags:
@@ -46,6 +49,7 @@ x-tagGroups:
4649
- Jobs
4750
- Reports
4851
- Configuration
52+
- Webhooks
4953

5054
paths:
5155
#DSL Definitions
@@ -1383,6 +1387,142 @@ paths:
13831387
application/json:
13841388
schema:
13851389
$ref: '#/components/schemas/error_response'
1390+
# Webhooks
1391+
/v1/webhooks:
1392+
get:
1393+
operationId: retrieve-webhooks
1394+
tags:
1395+
- Webhooks
1396+
summary: Retrieve webhooks
1397+
description: Retrieve all webhooks.
1398+
responses:
1399+
'200':
1400+
description: Success
1401+
content:
1402+
application/json:
1403+
schema:
1404+
type: array
1405+
items:
1406+
$ref: '#/components/schemas/webhook'
1407+
'400':
1408+
description: Bad request
1409+
content:
1410+
application/json:
1411+
schema:
1412+
$ref: '#/components/schemas/error_response'
1413+
'404':
1414+
description: Not found
1415+
content:
1416+
application/json:
1417+
schema:
1418+
$ref: '#/components/schemas/error_response'
1419+
'500':
1420+
description: Internal server error
1421+
content:
1422+
application/json:
1423+
schema:
1424+
$ref: '#/components/schemas/error_response'
1425+
post:
1426+
operationId: create-a-webhook
1427+
tags:
1428+
- Webhooks
1429+
summary: Create a Webhook
1430+
description: Create a new Webhook.
1431+
responses:
1432+
'201':
1433+
description: Success
1434+
content:
1435+
application/json:
1436+
schema:
1437+
$ref: '#/components/schemas/webhook'
1438+
'400':
1439+
description: Bad request
1440+
content:
1441+
application/json:
1442+
schema:
1443+
$ref: '#/components/schemas/error_response'
1444+
'422':
1445+
description: Unprocessable entity
1446+
content:
1447+
application/json:
1448+
schema:
1449+
$ref: '#/components/schemas/error_response'
1450+
'500':
1451+
description: Internal server error
1452+
content:
1453+
application/json:
1454+
schema:
1455+
$ref: '#/components/schemas/error_response'
1456+
requestBody:
1457+
content:
1458+
application/json:
1459+
schema:
1460+
$ref: '#/components/schemas/webhook'
1461+
description: The webhook to add
1462+
required: true
1463+
/v1/webhooks/{webhook_id}:
1464+
get:
1465+
operationId: retrieve-a-webhook
1466+
tags:
1467+
- Webhooks
1468+
summary: Retrieve a webhook by id
1469+
description: Retrieve a webhook by id.
1470+
responses:
1471+
'200':
1472+
description: Success
1473+
content:
1474+
application/json:
1475+
schema:
1476+
$ref: '#/components/schemas/webhook'
1477+
'404':
1478+
description: Not found
1479+
content:
1480+
application/json:
1481+
schema:
1482+
$ref: '#/components/schemas/error_response'
1483+
'500':
1484+
description: Internal server error
1485+
content:
1486+
application/json:
1487+
schema:
1488+
$ref: '#/components/schemas/error_response'
1489+
put:
1490+
operationId: update-a-webhook
1491+
tags:
1492+
- Webhooks
1493+
summary: Update a webhook
1494+
description: Update a webhook.
1495+
responses:
1496+
'200':
1497+
description: Success
1498+
content:
1499+
application/json:
1500+
schema:
1501+
$ref: '#/components/schemas/webhook'
1502+
'400':
1503+
description: Bad request
1504+
content:
1505+
application/json:
1506+
schema:
1507+
$ref: '#/components/schemas/error_response'
1508+
'422':
1509+
description: Unprocessable entity
1510+
content:
1511+
application/json:
1512+
schema:
1513+
$ref: '#/components/schemas/error_response'
1514+
'404':
1515+
description: Not found
1516+
content:
1517+
application/json:
1518+
schema:
1519+
$ref: '#/components/schemas/error_response'
1520+
'500':
1521+
description: Internal server error
1522+
content:
1523+
application/json:
1524+
schema:
1525+
$ref: '#/components/schemas/error_response'
13861526

13871527
components:
13881528
parameters:
@@ -2277,3 +2417,33 @@ components:
22772417
percentage:
22782418
type: number
22792419
description: benchmark percentage weight
2420+
webhook:
2421+
type: object
2422+
required:
2423+
- name
2424+
- webhook_url
2425+
- events
2426+
properties:
2427+
name:
2428+
type: string
2429+
description: Webhook name
2430+
webhook_url:
2431+
type: string
2432+
description: Webhook url to post events
2433+
events:
2434+
description: list of events which will trigger the webhook
2435+
type: array
2436+
items:
2437+
$ref: '#/components/schemas/webhooks_types'
2438+
2439+
webhooks_types:
2440+
type: string
2441+
enum:
2442+
- started
2443+
- api_failure
2444+
- aborted
2445+
- failed
2446+
- finished
2447+
- bencmark_passed
2448+
- benchmark_failed
2449+

0 commit comments

Comments
 (0)