Server
swerex.server
AUTH_TOKEN
module-attribute
AUTH_TOKEN = ''
api_key_header
module-attribute
api_key_header = APIKeyHeader(name='X-API-Key')
authenticate
async
authenticate(request: Request, call_next)
Authenticate requests with an API key (if set).
Source code in swerex/server.py
40 41 42 43 44 45 46 47 |
|
close
async
close()
Source code in swerex/server.py
132 133 134 135 |
|
close_session
async
close_session(request: CloseSessionRequest)
Source code in swerex/server.py
87 88 89 |
|
create_session
async
create_session(request: CreateSessionRequest)
Source code in swerex/server.py
77 78 79 |
|
exception_handler
async
exception_handler(request: Request, exc: Exception)
We catch exceptions that are thrown by the runtime, serialize them to JSON and return them to the client so they can reraise them in their own code.
Source code in swerex/server.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
execute
async
execute(command: Command)
Source code in swerex/server.py
92 93 94 |
|
is_alive
async
is_alive()
Source code in swerex/server.py
72 73 74 |
|
read_file
async
read_file(request: ReadFileRequest)
Source code in swerex/server.py
97 98 99 |
|
root
async
root()
Source code in swerex/server.py
67 68 69 |
|
run
async
run(action: Action)
Source code in swerex/server.py
82 83 84 |
|
serialize_model
serialize_model(model)
Source code in swerex/server.py
36 37 |
|
upload
async
upload(file: UploadFile = File(...), target_path: str = Form(...), unzip: bool = Form(False))
Source code in swerex/server.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
write_file
async
write_file(request: WriteFileRequest)
Source code in swerex/server.py
102 103 104 |
|