此包包含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第三方库


热门话题
与ReentrantLock相比,java ReentrantReadWriteLock的性能非常差   java如何使用Maven Android Studio正确导入?   安卓将ADB添加到我的Java PC应用程序   反射Java getDeclaredConstructor失败,来自JUnit的NoSuchMethodException   JSP上siteedit标记库的java替代   JavaSpring环境概要文件和JPA   java中是否有一个类似于StringBuilder的类,唯一的区别是它具有固定的长度?   JavaMathContext。小数点32 vs MathContext。小数点64,使用哪一个,为什么?   java使用spring在Ibm Websphere MQ中实现重试逻辑   java调用SpriteBatch。开始()和结束()   java有一种从文本中读取文本的方法。文件,并将其设置为pom中的maven属性。xml专家?   java让sitemesh使用struts2   Java Swing:在现有窗口上定位对话框   使用带有MemSql的JPA本机查询的java Select json列