mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
feat(api): add strict_names and batch node and link creation
This commit is contained in:
11 files changed
+359
-37
No files matched your search
@@ -75,3 +75,21 @@ class ComputeConflictError(ComputeError):
|
||||
|
||||
def response(self):
|
||||
return self._response
|
||||
|
||||
|
||||
def controller_error_status_code(error: ControllerError) -> int:
|
||||
"""
|
||||
HTTP status code returned by the API for a controller error.
|
||||
"""
|
||||
|
||||
if isinstance(error, ControllerTimeoutError):
|
||||
return 408
|
||||
if isinstance(error, ControllerUnauthorizedError):
|
||||
return 401
|
||||
if isinstance(error, ControllerForbiddenError):
|
||||
return 403
|
||||
if isinstance(error, ControllerNotFoundError):
|
||||
return 404
|
||||
if isinstance(error, ControllerBadRequestError):
|
||||
return 400
|
||||
return 409
|
||||
Reference in new issue
Block a user