mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-23 09:15:34 +00:00
Add symbol dimensions endpoint and SSL support for packet capture with remote HTTPS server.
This commit is contained in:
@ -57,6 +57,22 @@ async def get_symbol(symbol_id: str):
|
||||
return ControllerNotFoundError("Could not get symbol file: {}".format(e))
|
||||
|
||||
|
||||
@router.get("/{symbol_id:path}/dimensions",
|
||||
responses={404: {"model": schemas.ErrorMessage, "description": "Could not find symbol"}})
|
||||
async def get_symbol_dimensions(symbol_id: str):
|
||||
"""
|
||||
Get a symbol dimensions.
|
||||
"""
|
||||
|
||||
controller = Controller.instance()
|
||||
try:
|
||||
width, height, _ = controller.symbols.get_size(symbol_id)
|
||||
symbol_dimensions = {'width': width, 'height': height}
|
||||
return symbol_dimensions
|
||||
except (KeyError, OSError, ValueError) as e:
|
||||
return ControllerNotFoundError("Could not get symbol file: {}".format(e))
|
||||
|
||||
|
||||
@router.post("/{symbol_id:path}/raw",
|
||||
status_code=status.HTTP_204_NO_CONTENT)
|
||||
async def upload_symbol(symbol_id: str, request: Request):
|
||||
|
Reference in New Issue
Block a user