跳到主要内容

任务组管理命令:jobgroup

查询:ls

入口:

lbg jobgroup ls

概要:

usage: lbg jobgroup ls [-h] [-q] [-s START] [-e END] [-k SEARCH] [-o SORTBY] [-as] [--csv]
[--json] [--yaml] [--table] [--noheader] [-n NUMBER]

options:
-h, --help show this help message and exit
-q, --quiet only show job group id
-s START, --start START
default is a day ago. format is yyyy-mm-dd
-e END, --end END default is a day today. format is yyyy-mm-dd
-k SEARCH, --search SEARCH
allow search id/name
-o SORTBY, --sortby SORTBY
sort by id/createTime default is id
-as, --asce list by ascending, default descending
--csv output with csv format
--json output with json format
--yaml output with yaml format
--table output with table format
--noheader does not print header information
-n NUMBER, --number NUMBER
number of result to be display, default 50

参数说明:

参数缩写说明必填
--start-s开始时间,格式为yyyy-mm-dd
--end-e结束时间,格式为yyyy-mm-dd
--search-k根据id,名称搜索
--sortby-o可根据createTime/id进行排序,默认为id
--asce-as从反方向排序
--number-n显示多少个jobgroup默认为50

案例:

$ lbg jobgroup ls -n 10 # 显示前10个job group
$ lbg jobgroup ls -s 2022-03-05 -e 2022-07-08 # 显示从2022年3月5日到7月8日的任务组

提前终止:terminate

入口:

lbg jobgroup terminate

概要:

usage: lbg jobgroup terminate [-h] [-f] jobgroup_id [jobgroup_id ...]

positional arguments:
jobgroup_id id of the job group

options:
-h, --help show this help message and exit
-f, --force force terminate job group

参数说明:

参数缩写说明必填
--force-f不询问
--job_ids-提前终止的job group id

案例:

$ lbg jobgroup terminate 123 654 # 提前终止ID 为123和654的任务组

删除:rm

入口:

lbg jobgroup rm

概要:

usage: lbg jobgroup rm [-h] [-f] jobgroup_id [jobgroup_id ...]

positional arguments:
jobgroup_id id of the job group

options:
-h, --help show this help message and exit
-f, --force force delete job group

参数说明:

参数缩写说明必填
--force-f不询问
--job_ids-删除的job group id

案例:

$ lbg jobgroup rm 123 654 # 删除ID 为123和654的任务组

下载:download

入口:

lbg jobgroup download

概要:

usage: lbg jobgroup download [-h] [-p PATH] [-pr] jobgroup_id [jobgroup_id ...]

positional arguments:
jobgroup_id id of the job group

options:
-h, --help show this help message and exit
-p PATH, --path PATH download location default current dir
-pr, --parent create parent dir if needed

参数说明:

参数缩写说明必填
--parent-pr创建父目录如果父目录不存在
--path-p下载到指定目录,默认为当前目录

案例:

$ lbg jobgroup download 123 654 # 下载ID 为123和654的任务组

创建:create

入口:

lbg jobgroup create

概要:

usage: lbg jobgroup create [-h] [-n NAME] [-pjid PROJECT_ID]

optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME name of the job group
-pjid PROJECT_ID, --project_id PROJECT_ID project id of the job group

参数说明:

参数缩写说明必填
--name-n任务组名称
--project_id-pjid任务组项目id

案例:

$ lbg jobgroup create -n test -pjid 123 # 创建名称为test,项目id为123的任务组
{'groupId': 345} #groupId为创建的任务组id

任务组id的使用:

注意

这里的groupId和创建任务得到的JOB GROUP ID不同,通过lbg jobgroup create得到的group id,在提交任务时json配置文件需要设置bohrJobGroupId,而不是jobGroupId