DevStar-代码生成:使用示例

时间:2025-02-12 14:52:37

使用示例

  1. 执行如下命令,生成代码。

    hcloud DevStar RunDevstarTemplateJob --cli-region="cn-north-1" --repo_type=1 --application_name="spring" --template_id="0ae4cf82f4f3402bb6b7f1fbac6ed4dd"

    示例执行成功结果如下。

    {  "job_id": "ACVhBgLx"  ...

  1. 获取到任务 ID 后使用如下命令查询任务的运行状态。

    hcloud DevStar ShowJobDetail --cli-region="cn-north-1" --job_id="ACVhBgLx"

    显示如下则任务成功。

    {  "id": "ACVhBgLx",  "name": null,  "job_status": {    "initRepository": {      "name": "生成代码",      "displayName": null,      "status": "success",      "context": {        "status": null,        "project_uuid": null,        "repository_uuid": null,        "repository_id": null,        "repository_name": null,        "https_url": null,        "ssh_url": null,        "web_url": null,        "failure_reason": null      },      "elapsedTime": 4,      "createTime": 1655033046368,      "startTime": 1655033047705,      "endTime": 1655033052106,      "logs": []    }  },  "job_result": "success",  "show_type": null}

  1. 任务执行成功后,输入下载代码命令将生成的代码下载到本地(默认下载到命令行工具安装目录)。

    hcloud DevStar DownloadApplicationCode --cli-region="cn-north-1" --job_id="ACVhBgLx"

support.huaweicloud.com/clir-devstar/devstar_clir_02_0004.html