此包包含Kaomi部署程序的服务器端点。Kaomi服务器必须在您要部署的系统上运行。

kaomi-server的Python项目详细描述


Kaomi服务器

这个包是KAOMI Deployer的服务器。在

安装、配置和使用

1。创建虚拟环境

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

2。安装程序包

^{pr2}$

3。创建配置文件夹

python -m kaomi_server configure --folder <path>

5。为systemd创建配置文件,路径为/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

启动时启动Kaomi服务器

systemctl daemon-reload
systemctl enable kaomi-server.service

立即启动服务器

systemctl start kaomi-server.service

服务器格式

服务器响应是具有以下结构的json字典:

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

状态和子状态代码

statussubstatusmeaningdataexample
0EVERYTHING WENT OK
0Action executed-Specified folder has been created
1Final status reached but not in common way-Folder already existed
1REQUEST'S ERRORS
0Wrong request type-Get request where only POST admitted
1Payload content-length greater than maximum allowedMax request size in bytes
2Json content cannot be parsed-
3Content-length not specified or not valid-
4Missing fields in JSONList of requeted fields
5ValueError in JSONException textPermissions received are not valid
2APPLICATION'S ERRORS
0Generic server error occurredException text
1Invalid apikey-
2Action not permittedException text
3A RuntimeError occurredException text
4File/folder already existsException text
5The uploaded file is too big-Uploaded file exceed maximum size (data contains maximum size in MB)
6Client ip not allowed-The client ip is not in the allowed list

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法从布尔值中获得正确显示的结果   json java流逗号分隔   java ArrayList索引超出范围,但实际上没有?   Android中的java左对齐文本   当excel中的某些更改未保存时,如何在java中使用poi读取   java如何重新排列数组,使空值占据数组的开头?   查找多维数组是否在Java数组中   在Java中实现无数据库的数据   java什么是系统负载?   java在启动活动时“错误类型3错误:活动类{}不存在”,错误类型3活动类不存在”   java如何在textView中显示多个值   java JDBC:如何从结果集中检索SQL COUNT函数的结果?   JAXRS客户端的java应答   java奇怪的包装器类行为==和=   爪哇改变油漆的颜色会改变所有的颜色   在IntelliJ中使用Maven、Spring和ApacheSpark的java会导致错误   java清单文件的用途是什么   编译为什么Java编译器默认不缩短名称?(用于性能和模糊处理)   java JPA查询创建bean时出错