This package contains the server endpoint for the Kaomi deployer. Kaomi server has to be run on the system where you want to deploy.
Project description
Kaomi Server
Configurazione ed uso del server
1. Creare un virtualenv con
virtualenv env --python=python3
source env/bin/activate
2. Installare il pacchetto python con
pip install kaomi_server
3. Creare i file di configurazione con
python -m kaomi_server configure --folder <path>
4. Avviare il server con
python -m kaomi_server start --config <path file server.conf> --apikey <path directory conf.d>
Creare il file di config per systemd con
nano /etc/systemd/system/kaomi-server.service
contenuto del file:
[Unit]
Description=Kaomi Server (TM) Service
[Service]
Type=simple
User=root
Group=root
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/kaomi-server
EnvironmentFile=-/etc/sysconfig/kaomi-server
ExecStart=<virtualenv path>/env/bin/python -m kaomi_server start --config <path file server.conf> --apikey <path directory conf.d>
Restart=on-abnormal
WorkingDirectory=<virtualenv path>
# When stopping, how long to wait before giving up and sending SIGKILL?
# Keep in mind that SIGKILL on a process can cause data loss.
TimeoutStopSec=3min
[Install]
WantedBy=multi-user.target
Formato rispose del server
Le risposte ottenute dal server in seguito ad una richiesta sono formate da una stringa contenente un dizionario con il formato:
{ "status": "status code", "substatus": "substatus code", "message": "meaning of the substatus" "data": "eventual useful data" }
Codici di stato e sotto-stato
Di seguito si riporta la tabella di conversione dei codici di stato e sub-stato ritornati dall'API del server.
status | substatus | meaning | data | example |
---|---|---|---|---|
0 | EVERYTHING WENT OK | |||
0 | Action executed | - | Specified folder has been created | |
1 | Final status reached but not in common way | - | Folder already existed | |
1 | REQUEST'S ERRORS | |||
0 | Wrong request type | - | Get request where only POST admitted | |
1 | Payload content-length greater than maximum allowed | Max request size in bytes | ||
2 | Json content cannot be parsed | - | ||
3 | Content-length not specified or not valid | - | ||
4 | Missing fields in JSON | List of requeted fields | ||
5 | ValueError in JSON | Exception text | Permissions received are not valid | |
2 | APPLICATION'S ERRORS | |||
0 | Generic server error occurred | Exception text | ||
1 | Invalid apikey | - | ||
2 | Action not permitted | Exception text | ||
3 | A RuntimeError occurred | Exception text | ||
4 | File/folder already exists | Exception text | ||
5 | The uploaded file is too big | - | Uploaded file exceed maximum size (data contains maximum size in MB) | |
6 | Client ip not allowed | - | The client ip is not in the allowed list |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kaomi-server-0.1.1.tar.gz
.
File metadata
- Download URL: kaomi-server-0.1.1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc7aae6d447f471eec95a379273e62db1a89027d7d2e5eab7766811086eb8794 |
|
MD5 | e4a240a0c2e07f9d96d7f9ed03ab4293 |
|
BLAKE2b-256 | b043e12f90b85fbdbd4db8437ea2fb2c08cd7242cce7bab8ddbe62f61fc38b5e |
File details
Details for the file kaomi_server-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: kaomi_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763c7fc73ea31273cdd2fdd2024748ce329e8a0c7a7e425599fee854ed9bbe69 |
|
MD5 | d58f37c767d0ad9b43bd83b3b56eb15b |
|
BLAKE2b-256 | 36129f0b0a8f5f6efaf7ffa7dcf06005d2678db1d2b28b08fdcbbc3ddf9d1c02 |