更新时间:2023-11-23 GMT+08:00

更新应用模板版本

功能介绍

该API用于更新一个应用模板版本。

URI

PUT /v2/{project_id}/edgemgr/apps/{app_id}/versions/{version_id}

表1 Path参数

名称

是否必选

说明

project_id

项目ID,获取方法请参见获取项目ID

app_id

应用模板ID

version_id

应用模板版本ID

请求消息

请求参数

表2 请求Header参数

参数

是否必选

类型

描述

Content-Type

String

消息体的类型(格式)

推荐您使用默认值application/json。

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

表3 请求Body参数

名称

是否必选

参数类型

说明

envs

Array of 表10 objects

环境变量

volumes

Array of 表11 objects

卷配置

configs

表14 object

高级配置参数

resources

表12 object

容器资源配置

command

Array of String

启动命令

liveness_probe

String

工作负载存活探针

readiness_probe

String

工作负载业务探针

args

Array of String

参数

npu_type

String

npu类型,支持D310类型。

  • D310表示D310类型
  • 不填表示为D310类型

请求示例

{
    "version": {
        "resources": {
            "limits": {
                "cpu": 0.1,
                "memory": 1024,
                "gpu": 3.9
            },
            "requests": {
                "cpu": 0.1,
                "memory": 1024,
                "gpu": 3.9
            }
        },
        "envs": [
            {
                "name": "key",
                "value": "name"
            }
        ],
        "volumes": [
            {
                "name": "test",
                "type": "hostPath",
                "source": "/tmp",
                "destination": "/tmp0",
                "read_only": true
            }
        ],
        "configs": {
            "privileged": true,
            "host_network": true,
            "restart_policy": "Always"
        }
    }
}

响应消息

响应参数

表4 响应Body参数

名称

参数类型

说明

version

表17 object

应用版本详细信息

响应示例

{
    "envs": [
        {
            "name": "MQ_IP",
            "value": "127.0.0.1"
        }
    ],
    "created_at": "2018-11-08T01:38:17.287510+08:00",
    "updated_at": null,
    "version": "1.11.08",
    "image_url": "",
    "volumes": [],
    "readiness_probe": null,
    "configs": {
        "host_network": true,
        "restart_policy": "Always",
        "privileged": false
    },
    "project_id": "{project_id}",
    "liveness_probe": null,
    "id": "8a33dc45-d18f-49b1-8573-6e60f9daa144",
    "npu_type": "",
    "resources": {
        "requests": {
            "cpu": 0.25,
            "memory": 512
        },
        "limits": {
            "cpu": 1,
            "memory": 512
        }
    }
}

错误码

请参见错误码