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

apidoc #26

Open
wants to merge 1 commit into
base: develop
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
108 changes: 81 additions & 27 deletions src/api-doc/MentorED-Scheduler.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
},
"item": [
{
"name": "create",
"name": "Create",
"item": [
{
"name": "Create Repetable job(cron)",
"name": "Create Repetable Job (Cron)",
"request": {
"method": "POST",
"header": [
Expand Down Expand Up @@ -43,15 +43,21 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/create",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "create"]
"path": [
"scheduler",
"jobs",
"create"
]
}
},
"response": []
},
{
"name": "Create Job delay",
"name": "Create Job Delay",
"event": [
{
"listen": "prerequest",
Expand Down Expand Up @@ -109,15 +115,21 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/create",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "create"]
"path": [
"scheduler",
"jobs",
"create"
]
}
},
"response": []
},
{
"name": "Create Repetable job(interval)",
"name": "Create Repetable Job (Interval)",
"request": {
"method": "POST",
"header": [
Expand All @@ -133,17 +145,23 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/create",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "create"]
"path": [
"scheduler",
"jobs",
"create"
]
}
},
"response": []
}
]
},
{
"name": "purge",
"name": "Purge",
"item": [
{
"name": "Clean",
Expand All @@ -162,15 +180,21 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/purge",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "purge"]
"path": [
"scheduler",
"jobs",
"purge"
]
}
},
"response": []
},
{
"name": "drain",
"name": "Drain",
"request": {
"method": "POST",
"header": [
Expand All @@ -186,15 +210,21 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/purge",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "purge"]
"path": [
"scheduler",
"jobs",
"purge"
]
}
},
"response": []
},
{
"name": "obliterate",
"name": "Obliterate",
"request": {
"method": "POST",
"header": [
Expand All @@ -210,17 +240,23 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/purge",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "purge"]
"path": [
"scheduler",
"jobs",
"purge"
]
}
},
"response": []
}
]
},
{
"name": "Remove job",
"name": "Remove Job",
"request": {
"method": "POST",
"header": [
Expand All @@ -236,15 +272,21 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/remove",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "remove"]
"path": [
"scheduler",
"jobs",
"remove"
]
}
},
"response": []
},
{
"name": "List",
"name": "List Job",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
Expand All @@ -263,9 +305,15 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/list?filter=completed,failed,delayed,active,wait,paused,repeat",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "list"],
"path": [
"scheduler",
"jobs",
"list"
],
"query": [
{
"key": "filter",
Expand Down Expand Up @@ -335,9 +383,15 @@
"url": {
"raw": "http://localhost:4000/scheduler/jobs/updateDelay",
"protocol": "http",
"host": ["localhost"],
"host": [
"localhost"
],
"port": "4000",
"path": ["scheduler", "jobs", "updateDelay"]
"path": [
"scheduler",
"jobs",
"updateDelay"
]
}
},
"response": []
Expand Down
48 changes: 24 additions & 24 deletions src/api-doc/api-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ servers:
- url: http://127.0.0.1:4000
description: Localhost
tags:
- name: Default
- name: Jobs
description: ''
externalDocs:
description: ''
url: ''
paths:
/scheduler/jobs/create:
post:
summary: Create repeatable jobs
summary: Create Repeatable Jobs
description: >-
The Scheduler Service using BullMQ allows you to add jobs to a queue
with different scheduling options. It supports three types of jobs:
delayed jobs, repeatable jobs with a cron pattern, and repeatable jobs
with an interval. Accepts a JSON request body with specific parameters.
operationId: /scheduler/jobs/create
tags: &ref_0
- Default
- Jobs
parameters: &ref_1 []
requestBody:
description: Job details
description: Job Details
required: true
content:
application/json:
Expand Down Expand Up @@ -222,7 +222,7 @@ paths:
meta:
correlation: 986c2de2-93a8-4f13-a13f-59501c58d287
headers: &ref_2 {}
description: Success response
description: OK. Success response
'400':
content:
application/json:
Expand All @@ -247,7 +247,7 @@ paths:
unique identifier of the job to be removed.
operationId: /scheduler/jobs/remove
tags:
- Default
- Jobs
parameters: []
requestBody:
content:
Expand All @@ -273,7 +273,7 @@ paths:
result: true
meta:
correlation: 73c06d73-8fb1-487f-b073-992233231bd6
description: Success response
description: OK. Success response
'400':
content:
application/json:
Expand All @@ -287,18 +287,18 @@ paths:
error: []
meta:
correlation: e08c248a-fbee-459f-b41a-97018663a51d
description: Response when job not found
description: Failure Response - Job not found
/scheduler/jobs/purge:
post:
summary: Purge jobs/queue
summary: Purge Jobs/Queue
description: >-
Purge jobs/queue using different methods (clean, drain, obliterate).
Accepts a JSON request body with the method and options parameters.

Note: "options" parameter is only needed for the clean method.
operationId: /scheduler/jobs/purge
tags:
- Default
- Jobs
parameters: []
requestBody:
content:
Expand Down Expand Up @@ -350,7 +350,7 @@ paths:
result: {}
meta:
correlation: fe7d4a8f-76f0-436a-9f9b-e118a89c346f
description: Success Response
description: OK. Success Response
'400':
description: Failure Response
content:
Expand All @@ -370,21 +370,21 @@ paths:
description: Get a list of jobs from the scheduler
operationId: /scheduler/jobs/list
tags:
- Default
- Jobs
parameters:
- in: query
name: filter
description: ''
description: 'Specify the status filter for the jobs.'
schema:
type: string
enum:
- completed
- failed
- delayed
- active
- wait
- paused
- repeat
- 'completed'
- 'failed'
- 'delayed'
- 'active'
- 'wait'
- 'paused'
- 'repeat'
responses:
'200':
content:
Expand Down Expand Up @@ -424,7 +424,7 @@ paths:
timestamp: 1684835756867
meta:
correlation: 8dec3a0b-1622-4d11-9071-4434c126b598
description: Success response
description: OK. Success response
'400':
content:
application/json:
Expand All @@ -439,7 +439,7 @@ paths:
meta:
correlation: 758680ac-06cd-4d45-a7ec-eddad54356a0
description: Failure Response
summary: Get list of jobs
summary: Job List
parameters: []
/scheduler/jobs/updateDelay:
post:
Expand All @@ -453,7 +453,7 @@ paths:
tags: *ref_0
parameters: *ref_1
requestBody:
description: Job details
description: Job Details
required: true
content:
application/json:
Expand Down Expand Up @@ -578,7 +578,7 @@ paths:
meta:
correlation: a2bcaf3d-6010-42ba-a3e4-cf02d7138847
headers: *ref_2
description: Success response
description: OK. Success response
'404':
content:
application/json:
Expand Down