-
Notifications
You must be signed in to change notification settings - Fork 22
docs: added documentation to all API endpoint routes so far #75
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7af0d4d
docs: added documentation to all API endpoint routes so far
adithyasunil04 3678197
docs: updated documentation for API endpoints with pydantic models
adithyasunil04 9177b67
chore: corrected position of @atomic() decorator
adithyasunil04 2407a3e
Merge pull request #2 from lugvitc/master
adithyasunil04 6361a22
chore: sync fork with main repo
adithyasunil04 c8f4c42
docs: shorten response_description
adithyasunil04 5144e35
changed from __root__ to ports in pwncore.routes.team.ContainerPortsR…
adithyasunil04 fb31efc
docs: moved all Pydantic response models to one location in `pwncore/…
adithyasunil04 51a02d4
chore: remove the unwanted comment
adithyasunil04 1d8c900
chore: make requested changes
adithyasunil04 e01efbf
chore: make requested changes in pwncore/routes/team.py
adithyasunil04 85b9c5a
chore: make code little prettier
adithyasunil04 2a27980
Merge branch 'lugvitc:master' into api_docs
adithyasunil04 3a90469
docs: rm response_description
adithyasunil04 2a7076e
rm response_description in admin.py
adithyasunil04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pydantic import BaseModel | ||
from typing import List, Optional | ||
|
||
class ErrorResponse(BaseModel): | ||
""" | ||
Generic error response | ||
msg_code: 0 (db_error), 2 (ctf_not_found) | ||
""" | ||
msg_code: int | ||
|
||
class ContainerStartResponse(BaseModel): | ||
""" | ||
Response for container start operation | ||
msg_code: 3 (success), 7 (already running), 8 (limit reached), 0 (db_error) | ||
""" | ||
msg_code: int | ||
ports: Optional[List[int]] = None | ||
ctf_id: Optional[int] = None | ||
|
||
class ContainerStopResponse(BaseModel): | ||
""" | ||
Response for container stop operations | ||
msg_code: 4 (stop success), 5 (stopall success), 6 (not found), 0 (db_error) | ||
""" | ||
msg_code: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.