Skip to content

Commit 31fab51

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

File tree

1 file changed

+177
-1
lines changed

1 file changed

+177
-1
lines changed

docs/openapi3.yaml

Lines changed: 177 additions & 1 deletion
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:
@@ -1856,7 +1996,8 @@ components:
18561996
The event body will include detailed information about the test, such as the number of scenarios that were executed and the number of requests that were invoked.
18571997
items:
18581998
type: string
1859-
description: The url of where to send the webhook with the report information
1999+
format: uuid
2000+
description: The id of the webhook
18602001
arrival_rate:
18612002
type: number
18622003
minimum: 1
@@ -2277,3 +2418,38 @@ components:
22772418
percentage:
22782419
type: number
22792420
description: benchmark percentage weight
2421+
webhook:
2422+
type: object
2423+
required:
2424+
- name
2425+
- webhook_url
2426+
- events
2427+
properties:
2428+
id:
2429+
description: Unique webhook identifier
2430+
type: string
2431+
format: uuid
2432+
readOnly: true
2433+
name:
2434+
type: string
2435+
description: Webhook name
2436+
webhook_url:
2437+
type: string
2438+
description: Webhook url to post events
2439+
events:
2440+
description: list of events which will trigger the webhook
2441+
type: array
2442+
items:
2443+
$ref: '#/components/schemas/webhooks_types'
2444+
2445+
webhooks_types:
2446+
type: string
2447+
enum:
2448+
- started
2449+
- api_failure
2450+
- aborted
2451+
- failed
2452+
- finished
2453+
- bencmark_passed
2454+
- benchmark_failed
2455+

0 commit comments

Comments
 (0)