openlab的命令行工具
openlabcmd的Python项目详细描述
OpenLab管理工具
这是openlab管理的命令行工具。
如何使用
您可以从源安装,也可以只使用pip install openlabcmd
。
在使用openlabcmd
之前,您应该创建或更新配置文件
openlab.conf
。使用-c
指定一个。工具会试图找到
路径/etc/openlab/openlab.conf
、~/openlab.conf
和
/usr/local/etc/openlab/openlab.conf
如果不是用户提供的。
支持的功能
检查
用于检查OpenLab CI基础结构的运行状况检查工具。
usage: openlab check [-h] [--type TYPE] [--cloud CLOUD] [--nocolor]
[--recover]
optional arguments:
-h, --help show this help message and exit
--type TYPE Specify a plugin type, like 'nodepool', 'jobs'. Default is
'all'.
--cloud CLOUD Specify a cloud provider, like 'otc', 'vexxhost'. Default is
'all'.
--nocolor Enable the no color mode.
--recover Enable the auto recover mode.
ha
openlab ha集群管理命令。
节点
节点的CRUD
- openlab ha节点列表
usage: openlab ha node list [-h] [--type {nodepool,zuul,zookeeper}] [--role {master,slave,zookeeper}] optional arguments: -h, --help show this help message and exit --type {nodepool,zuul,zookeeper} Filter the services with the specified node type. --role {master,slave,zookeeper} Filter the services with the specified node role.
- openlab ha节点获取
usage: openlab ha node get [-h] name positional arguments: name The node hostname.
- openlab ha节点初始化
usage: openlab ha node init [-h] --type {nodepool,zuul,zookeeper} --role {master,slave} --ip IP name positional arguments: name The new node hostname, it should be global unique. Format: {cloud-provider}-openlab-{type} optional arguments: -h, --help show this help message and exit --type {nodepool,zuul,zookeeper} The new node type. Choose from 'nodepool', 'zuul' and 'zookeeper' --role {master,slave} The new node role. It should be either 'master' or 'slave'. --ip IP The new node's public IP.
- openlab ha节点集
usage: openlab ha node set [-h] [--maintain {yes, no}] [--role {master,slave}] name positional arguments: name The node hostname. optional arguments: -h, --help show this help message and exit --maintain MAINTAIN Set the node to maintained status. --role {master,slave} Update node role. It should be either 'master' or 'slave'. Be careful to update the role, you should not update role except emergency situations, because it will impact checking scope of HA monitor , HA monitor will check and update it with built-in policy automatically.
- openlab ha节点删除
usage: openlab ha node delete [-h] name positional arguments: name The node hostname.
服务
获取或列出群集中运行的服务。
- OpenLab HA服务列表
usage: openlab ha service list [-h] [--node NODE] [--role {master,slave,zookeeper}] [--status {up,down,restarting}] optional arguments: -h, --help show this help message and exit --node NODE Filter the services with the specified node name. --role {master,slave,zookeeper} Filter the services with the specified node role. --status {up,down,restarting} Filter the services with the specified status.
- OpenLab HA服务获取
usage: openlab ha service get [-h] --node NODE name positional arguments: name service name. optional arguments: -h, --help show this help message and exit --node NODE The node where the service run.
群集
管理HA集群操作或检查现有的HA集群部署。openlab ha集群交换机
usage: openlab ha cluster switch [-h] optional arguments: -h, --help show this help message and exit
openlab ha集群修复 ''' 用法:openlab ha cluster repair[-h]--security group[--dry run]
可选参数: -h,帮助显示此帮助消息并退出 --安全组修复ha部署的安全组。 --试运行只报告ha部署的检查列表,不尝试 如果有检查错误,请修复。
''
配置
管理ha群集配置
- openlab ha配置列表
usage: openlab ha config list [-h] optional arguments: -h, --help show this help message and exit
- openlab ha配置集
usage: openlab ha config set [-h] name value positional arguments: name The name of config option. value The value of config option. optional arguments: -h, --help show this help message and exit
回购
支持openlab的repos管理工具。
usage: openlab repo list [-h] [--server SERVER] [--app-id APP_ID]
[--app-key APP_KEY]
optional arguments:
-h, --help show this help message and exit
--server SERVER Specify base server url. Default is github.com
--app-id APP_ID Specify the github APP ID, Default is 6778 (allinone:
7102, OpenLab: 6778).
--app-key APP_KEY Specify the app key file path. Default is
/var/lib/zuul/openlab-app-key.pem
提示
打印提示信息的帮助工具。
usage: openlab hint [-h] [--type TYPE]
optional arguments:
-h, --help show this help message and exit
--type TYPE Specify a hint type, like 'resource', 'redundant'.