Skip to main content

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

This package is the server for KAOMI Deployer.

Installaton, configuration and use

1. Create a virtualenv

virtualenv env --python=python3
source env/bin/activate

2. Install the package

pip install kaomi_server

3. Create configuration folder

python -m kaomi_server configure --folder <path>

4. Start the server

python -m kaomi_server start --config <path file server.conf> --apikey <path directory conf.d>

Create the config file for systemd with path /etc/systemd/system/kaomi-server.service

[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

The server responses are json dictionaries with the following structure:

{ "status": "status code", "substatus": "substatus code", "message": "meaning of the substatus" "data": "eventual useful data" }

Status and substatus codes

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaomi-server-0.1.4.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

kaomi_server-0.1.4-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file kaomi-server-0.1.4.tar.gz.

File metadata

  • Download URL: kaomi-server-0.1.4.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3

File hashes

Hashes for kaomi-server-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bf5a8bcacbc34b49a191d14c645a8d8a669a57237615105c299a695d5fb2d969
MD5 52f3fb6c39d78f1fecc47cee0a741cf4
BLAKE2b-256 c3f3d391465d19a4ecadd0462b90353a2a80d9c7718bae69ce816e5028df4e14

See more details on using hashes here.

File details

Details for the file kaomi_server-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: kaomi_server-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.3

File hashes

Hashes for kaomi_server-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce4295f3034c397f8ebff3b3c229f63aa4104f2f5eea7d0343a53ad4cc87c32
MD5 cee9a5b6666572f87c6c93f08de98263
BLAKE2b-256 d3b37890a04ef89af485ff747a1a328bcc2f665e387d38ad991e05d3c655a4ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page