Updated on 2023-11-23 GMT+08:00

Updating an Application Template Version

Function

This API is used to update an application template version.

URI

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

Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

app_id

Yes

Application template ID.

version_id

Yes

Application template version ID.

Request

Request parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

The default value application/json is recommended.

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

envs

No

Array of Table 10 objects

Environment variables.

volumes

No

Array of Table 11 objects

Volume configuration.

configs

No

Table 14 object

Advanced configuration parameters.

resources

No

Table 12 object

Container resource configuration.

command

No

Array of strings

Startup commands.

liveness_probe

No

String

Workload liveness probe.

readiness_probe

No

String

Workload readiness probe.

args

No

Array of strings

Parameters.

npu_type

No

String

NPU type. NUP type supports D310.

  • D310
  • If this parameter is left blank, D310 is used.

Example request

{
    "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"
        }
    }
}

Response

Response parameters

Table 4 Parameters in the response body

Parameter

Type

Description

version

Table 17 object

Application version details.

Example response

{
    "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
        }
    }
}

Error Codes

For details, see Error Codes.