-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from knikolla/feature/limits
Feature: Create LimitRange on Project creation
- Loading branch information
Showing
9 changed files
with
119 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
ADMIN_USERNAME = "admin" | ||
QUOTA_DEF_FILE = "quotas.json" | ||
LIMIT_DEF_FILE = "limits.json" |
This file contains 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,32 @@ | ||
"""Defined exceptions used by acct-mgt.""" | ||
|
||
|
||
class ApiException(Exception): | ||
"""Base exception class for errors. | ||
All exceptions subclassing ApiException will be caught from Flask's | ||
error handler and return the appropriate status code and message. | ||
The visible parameter controls whether the error message is visible | ||
to the end user. | ||
""" | ||
|
||
status_code = 500 | ||
visible = True | ||
default_message = "Internal Server Error." | ||
|
||
def __init__(self, message=None): | ||
self.message = message or self.default_message | ||
|
||
|
||
class BadRequest(ApiException): | ||
"""Exception class for invalid requests.""" | ||
|
||
status_code = 400 | ||
default_message = "Invalid Request." | ||
|
||
|
||
class Conflict(BadRequest): | ||
"""Exception class for requests that create already existing resources.""" | ||
|
||
status_code = 409 | ||
default_message = "Resource already exists." |
This file contains 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 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 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 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,13 @@ | ||
[ | ||
{ | ||
"type": "Container", | ||
"default": { | ||
"cpu": "200m", | ||
"memory": "512Mi" | ||
}, | ||
"defaultRequest": { | ||
"cpu": "100m", | ||
"memory": "256Mi" | ||
} | ||
} | ||
] |
This file contains 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 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