Help Center/ Intelligent EdgeFabric/ API Reference/ API/ Application Template Management/ Querying a List of Application Template Versions
Updated on 2023-11-23 GMT+08:00

Querying a List of Application Template Versions

Function

This API is used to query a list of application template versions.

URI

GET /v2/{project_id}/edgemgr/apps/{app_id}/versions?{limit=xxx,offset=xxx}

Table 1 Path parameter

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

String

Number of records displayed on each page. The value range is 1–1000. The default value is 1000.

offset

No

String

Start position for a query. The value is a non-negative integer. The default value is 0.

  • If no query parameter is specified, all application versions of an account are returned.
  • If multiple query parameters are specified, the application versions that meet all the specified query parameters are returned.

Request

Table 3 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.

Response

Response parameters

Table 4 Parameters in the response body

Parameter

Type

Description

versions

Array of Table 17 objects

Application version details.

count

Integer

Number of application versions that meet the conditions.

Example response

{
    "count": 1,
    "versions": [
        {
            "envs": [],
            "created_at": "2018-07-26T07:31:29+08:00",
            "updated_at": null,
            "version": "v1",
            "image_url": "busybox:latest",
            "volumes": [],
            "npu_type": "",
            "readiness_probe": null,
            "configs": {
                "host_network": true,
                "restart_policy": "Always",
                "privileged": false
            },
            "project_id": "{project_id}",
            "liveness_probe": null,
            "id": "bc35aaff-bdd8-49e8-ace0-a25be2b09380",
            "resources": {
                "requests": {
                    "cpu": 0.25,
                    "memory": 512
                },
                "limits": {
                    "cpu": 1,
                    "memory": 512
                }
            }
        }
    ]
}

Error Codes

For details, see Error Codes.