更新时间:2026-09-22 GMT+08:00
分享

修改应用版本

功能介绍

修改应用版本

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

PUT /v2/{project_id}/edge-apps/{edge_app_id}/versions/{version}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

是

String

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

edge_app_id

是

String

应用ID,应用唯一。

version

是

String

应用版本,应用内版本唯一。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

是

String

用户Token。通过调用IAM服务 获取IAM用户Token接口获取,接口返回的响应消息头中“X-Subject-Token”就是需要获取的用户Token。简要的获取方法样例请参见 Token认证。

表3 请求Body参数

参数

是否必选

参数类型

描述

description

否

String

应用描述

deploy_type

否

String

部署类型docker|process

deploy_multi_instance

否

Boolean

是否允许部署多实例

container_settings

否

ContainerSettingsDTO object

容器相关配置

liveness_probe

否

ProbeDTO object

工作负载存活探针

readiness_probe

否

ProbeDTO object

工作负载业务探针

sdk_version

否

String

应用集成的边缘SDK版本

arch

否

Object

架构

command

否

Object

启动命令

args

否

Object

启动参数

outputs

否

Object

应用输出路由端点

inputs

否

Object

应用输入路由

services

否

Object

应用实现的服务列表

tpl_id

否

String

模板id

表4 ContainerSettingsDTO

参数

是否必选

参数类型

描述

configs

否

ContainerConfigsDTO object

容器特殊参数

image_url

是

String

镜像存储地址

envs

否

Object

环境变量

volumes

否

Array of VolumeDTO objects

卷配置

npu_type

否

String

NPU类型

vnpu_template

否

String

NPU算力切分模板,可在对应芯片的机器上通过npu-smi info -t template-info命令查询其详细信息

resources

否

ResourceDTO object

资源配额

ext_devices

否

Array of ExtDevice objects

外挂设备配置

表5 ContainerConfigsDTO

参数

是否必选

参数类型

描述

privileged

否

Boolean

开启容器特权模式

host_network

否

Boolean

是否使用主机网络模式

restart_policy

是

String

重启策略,容器执行健康检查后失败后的策略

container_port_list

否

Array of ContainerPortDTO objects

容器端口映射值

表6 ContainerPortDTO

参数

是否必选

参数类型

描述

container_port

否

Integer

构成一对映射的容器端口

host_port

否

Integer

构成一对映射的物理机对应网卡端口

host_ip

否

String

对应网卡地址

表7 VolumeDTO

参数

是否必选

参数类型

描述

name

是

String

卷名称

type

否

String

挂载类型

source

是

String

源路径

destination

是

String

卷挂载路径

read_only

否

Boolean

只读,默认只读

表8 ResourceDTO

参数

是否必选

参数类型

描述

limits

否

ResourceConfigDTO object

允许容器使用的最大资源

requests

否

ResourceConfigDTO object

容器需要使用的最小资源

表9 ResourceConfigDTO

参数

是否必选

参数类型

描述

cpu

否

Float

cpu个数

memory

否

Float

内存大小

gpu

否

Float

gpu内存大小,单位为M

npu

否

Float

使用npu加速卡个数

表10 ExtDevice

参数

是否必选

参数类型

描述

source

是

String

源路径

destination

是

String

卷挂载路径

cgroup_permissions

否

String

只读,默认MRW

表11 ProbeDTO

参数

是否必选

参数类型

描述

exec_command

否

String

执行探测的命令行命令

tcp_socket

否

TcpSocketDTO object

执行tcp探测

http_get

否

HttpGetDTO object

执行http探测

initial_delay_seconds

是

Integer

表示从工作负载启动后从多久开始探测

timeout_seconds

是

Integer

表示探测超时时间

period_seconds

否

Integer

检查周期

failure_threshold

否

Integer

失败多少次算不健康

表12 TcpSocketDTO

参数

是否必选

参数类型

描述

port

是

Integer

端口

表13 HttpGetDTO

参数

是否必选

参数类型

描述

path

是

String

请求路径

port

是

Integer

端口

host

否

String

主机地址

scheme

是

String

协议类型

响应参数

状态码:200

表14 响应Body参数

参数

参数类型

描述

edge_app_id

String

应用ID

name

String

应用名称

version

String

应用名称

sdk_version

String

应用集成的边缘SDK版本

description

String

应用描述

deploy_type

String

部署类型docker|process

deploy_multi_instance

Boolean

是否允许部署多实例

create_time

String

创建时间

update_time

String

最后一次修改时间

state

String

应用版本状态

arch

Array of strings

架构

publish_time

String

发布时间

off_shelf_time

String

下线时间

请求示例

PUT https://{endpoint}/v2/{project_id}/edge-apps/{edge_app_id}/versions/{version}

{
  "description" : "this is a test app version",
  "deploy_type" : "string",
  "deploy_multi_instance" : false,
  "container_settings" : {
    "configs" : {
      "privileged" : false,
      "host_network" : true,
      "restart_policy" : "string",
      "container_port_list" : [ {
        "container_port" : 65535,
        "host_port" : 65535,
        "host_ip" : "string"
      } ]
    },
    "image_url" : "string",
    "envs" : { },
    "volumes" : [ {
      "name" : "string",
      "type" : "string",
      "source" : "string",
      "destination" : "string",
      "read_only" : true
    } ],
    "resources" : {
      "limits" : {
        "cpu" : 1000,
        "memory" : 1024000,
        "gpu" : 1024000,
        "npu" : 1000
      },
      "requests" : {
        "cpu" : 1000,
        "memory" : 1024000,
        "gpu" : 1024000,
        "npu" : 1000
      }
    },
    "ext_devices" : [ {
      "source" : "string",
      "destination" : "string",
      "cgroup_permissions" : "string"
    } ]
  },
  "liveness_probe" : {
    "exec_command" : "string",
    "tcp_socket" : {
      "port" : 65535
    },
    "http_get" : {
      "path" : "string",
      "port" : 65535,
      "host" : "string",
      "scheme" : "HTTP"
    },
    "initial_delay_seconds" : 3600,
    "timeout_seconds" : 3600,
    "period_seconds" : 30,
    "failure_threshold" : 3
  },
  "readiness_probe" : {
    "exec_command" : "string",
    "tcp_socket" : {
      "port" : 65535
    },
    "http_get" : {
      "path" : "string",
      "port" : 65535,
      "host" : "string",
      "scheme" : "HTTP"
    },
    "initial_delay_seconds" : 3600,
    "timeout_seconds" : 3600,
    "period_seconds" : 30,
    "failure_threshold" : 3
  },
  "sdk_version" : "string",
  "arch" : { },
  "command" : { },
  "args" : { },
  "outputs" : { },
  "inputs" : { },
  "services" : { },
  "tpl_id" : "sys_general_opcua"
}

响应示例

状态码:200

{
  "edge_app_id" : "test-app",
  "name" : "string",
  "version" : "1.0.0",
  "sdk_version" : "string",
  "description" : "this is a test app",
  "deploy_type" : "string",
  "deploy_multi_instance" : false,
  "create_time" : "2020-05-28T11:31:29.740Z",
  "update_time" : "2020-05-28T11:31:29.740Z",
  "state" : "PUBLISHED",
  "arch" : [ "string" ],
  "publish_time" : "2020-05-28T11:31:29.740Z",
  "off_shelf_time" : "2020-05-28T11:31:29.740Z"
}

状态码

状态码

描述

200

OK

401

Bad Request

500

Internal Server Error

错误码

请参见错误码。

相关文档