From 9c515bf03bd608aa6a0915cf551748da0900685e Mon Sep 17 00:00:00 2001 From: zhoujinyu <2319109590@qq.com> Date: Sun, 4 Jan 2026 10:48:54 +0800 Subject: [PATCH] add vcctl missing docs Signed-off-by: zhoujinyu <2319109590@qq.com> --- content/en/docs/cli.md | 164 ++++++++++++++++++++++++++++++++++++----- content/zh/docs/cli.md | 153 +++++++++++++++++++++++++++++++++++--- 2 files changed, 291 insertions(+), 26 deletions(-) diff --git a/content/en/docs/cli.md b/content/en/docs/cli.md index 8fa2ab68..4f3f917f 100644 --- a/content/en/docs/cli.md +++ b/content/en/docs/cli.md @@ -27,48 +27,178 @@ A Command Line Interface (CLI) is provided for you to manage resources. 2. Copy the executable file to $PATH. You then can execute it anywhere. ## Command Line List -### Listing all jobs -vcctl job list -```html +### Job Commands + +#### Listing all jobs +```shell +vcctl job list [--namespace namespace] [--queue queue-name] [--all-namespaces] +``` + +```shell # vcctl job list Name Creation Phase JobType Replicas Min Pending Running Succeeded Failed Unknown RetryCount job-1 2020-09-01 Running Batch 1 1 0 1 0 0 0 0 ``` -### Deleting a specific job -vcctl job delete --name job-name [--namespace job-namespace] +#### Viewing a job +```shell +vcctl job view --name job-name [--namespace namespace] +``` -```html -# vcctl delete job --name job-1 --namespaces default +#### Deleting a specific job +```shell +vcctl job delete --name job-name [--namespace namespace] +``` + +```shell +# vcctl job delete --name job-1 --namespace default delete job job-1 successfully ``` -### Suspending a job -vcctl job suspend --name job-name [--namespace job-namespace] +#### Suspending a job +```shell +vcctl job suspend --name job-name [--namespace namespace] +``` -```html +```shell # vcctl job suspend --name job-1 --namespace default ``` -### Resuming a job (opposite to "vcctl job suspend") -vcctl job resume --name job-name [--namespace job-namespace] +#### Resuming a job (opposite to "vcctl job suspend") +```shell +vcctl job resume --name job-name [--namespace namespace] +``` -```html +```shell # vcctl job resume --name job-1 --namespace default ``` -### Running a job -vcctl job run --name job-name [--namespace job-namespace] +#### Running a job +```shell +vcctl job run --name job-name [--namespace namespace] +``` -```html +```shell # vcctl job run --name job-1 --namespace default ``` +### Queue Commands + +#### Creating a queue +```shell +vcctl queue create --name queue-name [--weight weight] [--state state] +``` + +```shell +# vcctl queue create --name test-queue --weight 1 --state Open +``` + +#### Listing all queues +```shell +vcctl queue list +``` + +#### Getting a queue +```shell +vcctl queue get --name queue-name +``` + +#### Operating a queue +```shell +vcctl queue operate --name queue-name --action action [--weight weight] +``` + +Valid actions: `open`, `close`, `update` + +```shell +# vcctl queue operate --name test-queue --action open +# vcctl queue operate --name test-queue --action close +# vcctl queue operate --name test-queue --action update --weight 2 +``` + +#### Deleting a queue +```shell +vcctl queue delete --name queue-name +``` + +### JobFlow Commands + +#### Creating a jobflow +```shell +vcctl jobflow create --file file-path +``` + +#### Listing all jobflows +```shell +vcctl jobflow list [--namespace namespace] [--all-namespaces] +``` + +#### Getting a jobflow +```shell +vcctl jobflow get --name jobflow-name [--namespace namespace] +``` + +#### Describing a jobflow +```shell +vcctl jobflow describe --name jobflow-name [--namespace namespace] [--format yaml|json] +``` + +#### Deleting a jobflow +```shell +vcctl jobflow delete --name jobflow-name [--namespace namespace] [--file file-path] +``` + +### JobTemplate Commands + +#### Creating a jobtemplate +```shell +vcctl jobtemplate create --file file-path +``` + +#### Listing all jobtemplates +```shell +vcctl jobtemplate list [--namespace namespace] +``` + +#### Getting a jobtemplate +```shell +vcctl jobtemplate get --name jobtemplate-name [--namespace namespace] +``` + +#### Describing a jobtemplate +```shell +vcctl jobtemplate describe --name jobtemplate-name [--namespace namespace] [--format yaml|json] +``` + +#### Deleting a jobtemplate +```shell +vcctl jobtemplate delete --name jobtemplate-name [--namespace namespace] [--file file-path] +``` + +### Pod Commands + +#### Listing pods +```shell +vcctl pod list [--namespace namespace] [--job job-name] [--queue queue-name] [--all-namespaces] +``` + +```shell +# vcctl pod list --job job-1 --namespace default +# vcctl pod list --queue test-queue --namespace default +``` + +### Version Command + +#### Displaying version information +```shell +vcctl version +``` + ## Note For more information about Volcano command lines, run the following commands: -```html +```shell # vcctl -h # vcctl [command] -h ``` diff --git a/content/zh/docs/cli.md b/content/zh/docs/cli.md index a9645174..8980fdf9 100644 --- a/content/zh/docs/cli.md +++ b/content/zh/docs/cli.md @@ -27,7 +27,13 @@ Volcano提供了命令行工具用于管理资源。 2. 将可执行文件拷贝到$PATH下以便您能在任何地方执行它。 ## 命令行列表 -### 列举所有的Job + +### Job 命令 + +#### 列举所有的Job +```shell +vcctl job list [--namespace namespace] [--queue queue-name] [--all-namespaces] +``` ```shell # vcctl job list @@ -35,35 +41,164 @@ Name Creation Phase JobType Replicas Min Pending Runni job-1 2020-09-01 Running Batch 1 1 0 1 0 0 0 0 ``` -### 删除指定的Job +#### 查看Job详情 +```shell +vcctl job view --name job-name [--namespace namespace] +``` +#### 删除指定的Job ```shell -# vcctl delete job --name job-1 --namespaces default +vcctl job delete --name job-name [--namespace namespace] +``` + +```shell +# vcctl job delete --name job-1 --namespace default delete job job-1 successfully ``` -### 中止一个Job +#### 中止一个Job +```shell +vcctl job suspend --name job-name [--namespace namespace] +``` -```html +```shell # vcctl job suspend --name job-1 --namespace default ``` -### 消费一个Job (与"vcctl job suspend"相反) +#### 恢复一个Job (与"vcctl job suspend"相反) +```shell +vcctl job resume --name job-name [--namespace namespace] +``` -```html +```shell # vcctl job resume --name job-1 --namespace default ``` -### 运行一个Job +#### 运行一个Job +```shell +vcctl job run --name job-name [--namespace namespace] +``` ```shell # vcctl job run --name job-1 --namespace default ``` +### Queue 命令 + +#### 创建队列 +```shell +vcctl queue create --name queue-name [--weight weight] [--state state] +``` + +```shell +# vcctl queue create --name test-queue --weight 1 --state Open +``` + +#### 列举所有队列 +```shell +vcctl queue list +``` + +#### 获取队列信息 +```shell +vcctl queue get --name queue-name +``` + +#### 操作队列 +```shell +vcctl queue operate --name queue-name --action action [--weight weight] +``` + +有效操作:`open`, `close`, `update` + +```shell +# vcctl queue operate --name test-queue --action open +# vcctl queue operate --name test-queue --action close +# vcctl queue operate --name test-queue --action update --weight 2 +``` + +#### 删除队列 +```shell +vcctl queue delete --name queue-name +``` + +### JobFlow 命令 + +#### 创建JobFlow +```shell +vcctl jobflow create --file file-path +``` + +#### 列举所有JobFlow +```shell +vcctl jobflow list [--namespace namespace] [--all-namespaces] +``` + +#### 获取JobFlow信息 +```shell +vcctl jobflow get --name jobflow-name [--namespace namespace] +``` + +#### 描述JobFlow +```shell +vcctl jobflow describe --name jobflow-name [--namespace namespace] [--format yaml|json] +``` + +#### 删除JobFlow +```shell +vcctl jobflow delete --name jobflow-name [--namespace namespace] [--file file-path] +``` + +### JobTemplate 命令 + +#### 创建JobTemplate +```shell +vcctl jobtemplate create --file file-path +``` + +#### 列举所有JobTemplate +```shell +vcctl jobtemplate list [--namespace namespace] +``` + +#### 获取JobTemplate信息 +```shell +vcctl jobtemplate get --name jobtemplate-name [--namespace namespace] +``` + +#### 描述JobTemplate +```shell +vcctl jobtemplate describe --name jobtemplate-name [--namespace namespace] [--format yaml|json] +``` + +#### 删除JobTemplate +```shell +vcctl jobtemplate delete --name jobtemplate-name [--namespace namespace] [--file file-path] +``` + +### Pod 命令 + +#### 列举Pod +```shell +vcctl pod list [--namespace namespace] [--job job-name] [--queue queue-name] [--all-namespaces] +``` + +```shell +# vcctl pod list --job job-1 --namespace default +# vcctl pod list --queue test-queue --namespace default +``` + +### Version 命令 + +#### 显示版本信息 +```shell +vcctl version +``` + ## 说明事项 如需获取更多命令行详情请按如下操作: -```html +```shell # vcctl -h # vcctl [command] -h ```