模块
项目管理模块
project/check
查询项目名称是否占用
project/list
列出所有项目列表
project/detail
列出指定项目详情
project/add
添加项目
project/ssoAdd
添加项目(需登录权限)
project/update
更新项目信息
project/ssoUpdate
更新项目信息(需登录权限)
project/delete
删除项目
project/ssoDelete
删除项目(需登录权限)
用户管理模块
user/list
列出所有用户列表
user/detail
列出指定用户详情
user/add
添加用户(不建议直接调用,SSO中间件会自动添加)
user/update
更新用户信息(不建议直接调用)
user/delete
删除用户
成员管理模块(暂未使用)
member/list
member/add
member/update
member/delete
配置管理模块(已经弃用)
config/list
config/detail
config/add
config/update
config/delete
部署管理模块
deploy/check
查询部署方式名称是否占用
deploy/list
列出所有部署方式列表
deploy/detail
列出指定部署方式详情
deploy/add
添加部署方式
deploy/ssoAdd
添加部署方式(需登录权限)
deploy/update
更新部署方式
deploy/ssoUpdate
更新部署方式(需登录权限)
deploy/delete
删除部署方式
deploy/ssoDelete
删除部署方式(需登录权限)
容器管理模块
docker/list
列出所有容器列表
docker/show
列出指定容器详情(已经弃用)
docker/detail
列出指定容器详情
docker/add
添加容器(不建议直接调用,部署测试环境时会自动创建环境并写入容器信息)
docker/check
检查容器名称是否占用
docker/delete
删除容器
docker/ssoDelete
删除容器(需登录权限)
环境管理模块
env/list
列出测试环境列表
env/detail
列出指定测试环境详情
env/update
更新测试环境信息
env/add
添加测试环境(不建议直接调用,部署测试环境时会自动创建环境并写入环境信息)
env/check
检查测试环境名称是否占用
env/delete
删除测试环境
env/ssoDelete
删除测试环境(需登录权限)
测试用例管理模块
case/check
检查测试用例名称是否存在
case/list
列出测试用例列表
case/detail
列出指定测试用例详情
case/add
添加测试用例
case/ssoAdd
添加测试用例(需登录权限)
case/update
更新测试用例
case/ssoUpdate
更新测试用例(需登录权限)
case/delete
删除测试用例
case/ssoDelete
删除测试用例(需登录权限)
测试任务管理模块
test/check
检查测试任务名称是否存在
test/list
列出测试任务列表
test/detail
列出指定测试任务详情
test/add
添加测试任务
test/ssoAdd
添加测试任务(需登录权限)
test/update
更新测试任务
test/ssoUpdate
更新测试任务(需登录权限)
test/run
部署测试环境
test/ssoRun
部署测试环境(需登录权限)
test/rerun
重建测试环境
test/ssoRerun
重建测试环境(需登录权限)
test/build
运行测试构建
test/ssoBuild
运行测试构建(需登录权限)
test/delete
删除测试任务
test/ssoDelete
删除测试任务(需登录权限)
test/showConf
列出测试任务配置文件
test/setConf
设置测试任务配置文件
test/getLog
获取当前任务环境部署进度
test/getScheduleTest
获取定时任务列表
通用模块
common/getCodeBranch
获取被测服务分支
common/getCaseBranch
获取测试代码分支
common/getResourceByDatetime
根据时间获取资源信息
common/getResourceByTimestamp
根据时间戳获取资源信息
common/ssoUser
获取当前用户登陆信息(需登录权限)
common/ssoLogin
登陆
common/staffOrgs
获取组织架构
common/staffUsers
获取组织架构下的用户列表
统计模块
statistics/kpi
获取平台总体用量信息
statistics/logList
列出操作记录列表
statistics/logDetail
列出操作记录详情
statistics/myKpi
获取当前用户的用量信息(需登录权限)
statistics/myLog
列出当前用户的操作记录列表(需登录权限)
class TableUser(models.Model):
user_id = models.AutoField(primary_key=True)
user_name = models.CharField(max_length=128)
user_name_zh = models.CharField(max_length=128, default='N/A')
user_email = models.CharField(max_length=64, blank=True)
user_group = models.IntegerField(default=0) # 0:User, 1:Admin
user_business = models.CharField(max_length=32, blank=True)
user_create_time = models.DateTimeField(auto_now_add=True)
user_update_time = models.DateTimeField(auto_now=True)
class TableProject(models.Model):
project_id = models.AutoField(primary_key=True)
project_name = models.CharField(max_length=128, unique=True)
project_desc = models.CharField(max_length=128, blank=True)
project_owner = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id', verbose_name='user_id')
project_code_git = models.CharField(max_length=256)
project_case_git = models.CharField(max_length=256)
project_node_tag = models.CharField(max_length=32)
project_create_time = models.DateTimeField(auto_now_add=True)
project_update_time = models.DateTimeField(auto_now=True)
project_has_env = models.IntegerField(default=1)
project_has_case = models.IntegerField(default=1)
class TableDeploy(models.Model):
deploy_id = models.AutoField(primary_key=True)
project_id = models.ForeignKey(TableProject, on_delete=models.PROTECT, db_column='project_id')
user_id = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id')
deploy_name = models.CharField(max_length=128, unique=True)
deploy_desc = models.TextField(max_length=1024)
deploy_num = models.IntegerField(default=1)
deploy_image = models.TextField(max_length=1024)
deploy_cmd = models.TextField(max_length=1024)
deploy_create_time = models.DateTimeField(auto_now_add=True)
deploy_update_time = models.DateTimeField(auto_now=True)
class TableEnv(models.Model):
env_id = models.AutoField(primary_key=True)
project_id = models.ForeignKey(TableProject, on_delete=models.PROTECT, db_column='project_id')
user_id = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id')
deploy_id = models.ForeignKey(TableDeploy, on_delete=models.PROTECT, db_column='deploy_id')
env_commit_id = models.CharField(max_length=64, blank=True)
env_name = models.CharField(max_length=128, unique=True)
env_detail = models.TextField(max_length=1024)
env_docker = models.TextField(max_length=1024)
env_status = models.IntegerField(default=0)
env_create_time = models.DateTimeField(auto_now_add=True)
env_update_time = models.DateTimeField(auto_now=True)
class TableDocker(models.Model):
docker_id = models.AutoField(primary_key=True)
project_id = models.ForeignKey(TableProject, on_delete=models.PROTECT, db_column='project_id')
user_id = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id')
docker_name = models.CharField(max_length=128, unique=True)
docker_ip = models.CharField(max_length=64, blank=True)
docker_status = models.IntegerField(default=0) # 0:Down, 1:Up
docker_detail = models.TextField(max_length=1024, blank=True)
docker_env = models.IntegerField(default=0)
docker_create_time = models.DateTimeField(auto_now_add=True)
docker_update_time = models.DateTimeField(auto_now=True)
class TableCase(models.Model):
case_id = models.AutoField(primary_key=True)
project_id = models.ForeignKey(TableProject, on_delete=models.PROTECT, db_column='project_id')
user_id = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id')
case_name = models.CharField(max_length=128, unique=True)
case_desc = models.CharField(max_length=256, blank=True)
case_config = models.CharField(max_length=4096, blank=True)
case_jenkins_reports = models.CharField(max_length=256, blank=True)
case_public = models.IntegerField(default=0) # 0:Private, 1:Public
case_create_time = models.DateTimeField(auto_now_add=True)
case_update_time = models.DateTimeField(auto_now=True)
class TableTest(models.Model):
test_id = models.AutoField(primary_key=True)
project_id = models.ForeignKey(TableProject, on_delete=models.PROTECT, db_column='project_id')
user_id = models.ForeignKey(TableUser, on_delete=models.PROTECT, db_column='user_id')
test_name = models.CharField(max_length=128, unique=True)
test_desc = models.CharField(max_length=256, blank=True)
case_id = models.ForeignKey(TableCase, on_delete=models.PROTECT, db_column='case_id')
deploy_id = models.ForeignKey(TableDeploy, on_delete=models.PROTECT, db_column='deploy_id')
test_deploy_param = models.CharField(max_length=128, blank=True)
test_deploy_conf = models.IntegerField(default=0)
test_need_env = models.IntegerField(default=1)
env_id = models.IntegerField(default=0) # 0: No env
env_status = models.IntegerField(default=0) # 0: done, 1: processing
test_status = models.IntegerField(default=0) # 0: done, 1: processing,2:部署失败 3:已部署
test_code_branch = models.CharField(max_length=128, default='master')
test_case_branch = models.CharField(max_length=128, default='master')
test_type = models.IntegerField(default=0) # 0:Manual, 1:Schedule, 2:Web Hook
test_jenkins = models.IntegerField(default=0) # 0: No Jenkins Job, 1: Has Jenkins Job
test_recipients = models.CharField(max_length=256, blank=True)
test_cron = models.CharField(max_length=32, blank=True)
test_create_time = models.DateTimeField(auto_now_add=True)
test_update_time = models.DateTimeField(auto_now=True)
class TableLog(models.Model):
log_id = models.AutoField(primary_key=True)
log_project = models.IntegerField()
log_test = models.IntegerField(blank=True)
log_user = models.CharField(max_length=32)
log_action = models.CharField(max_length=32)
log_detail = models.CharField(max_length=4096, blank=True)
log_status = models.IntegerField() # 0:Success, -1:Failed
log_time = models.DateTimeField(auto_now_add=True)