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

Querying a List of Application Templates

Function

This API is used to query a list of application templates.

URI

GET /v2/{project_id}/edgemgr/apps?{name=xxx,limit=xxx,offset=xxx,visibility=xxx,alias=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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

name

No

String

Application template name, which supports fuzzy match.

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.

alias

No

String

Used for filtering by alias (fuzzy match).

visibility

No

String

  • public: Indicates a public template.
  • private: Indicates a user-created application template. It is the default value.
  • shared: Indicates a template shared with third-party applications or other users. This value is reserved and has not been implemented yet.
  • If no query parameter is specified, all application templates of an account are returned.
  • If multiple query parameters are specified, the application templates 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

apps

Array of Table 5 objects

List of application templates.

count

Integer

Number of application templates that meet the conditions.

Table 5 app

Parameter

Type

Description

id

String

Application template ID.

name

String

Application template name.

description

String

Application template description.

created_at

String

Creation time.

updated_at

String

Update time.

project_id

String

Project ID.

visibility

String

Template type.

app_versions

Table 17 object

Application version information.

alias

String

Application template alias.

icon_url

String

URL of the application icon. The value contains a maximum of 2,083 characters.

Example response
{
    "app": [{
        "name": "test",
        "created_at": "2018-05-25T03:26:33",
        "updated_at": "2018-05-25T03:29:48",
        "visibility": "private",
        "alias": "Optical character recognition",
        "icon_url": null,
        "project_id": "{project_id}",
        "id": "2873e595-a55c-4d55-aa8f-eefcbd2b5027",
        "description": "This is a test.",
            "app_versions": [
                {
                    "envs": [],
                    "created_at": "2018-05-23T03:58:41",
                    "args": [],
                    "updated_at": null,
                    "cpu": 0.01,
                    "version": "1.0.0",
                    "image_url": "",
                    "volumes": [],
                    "memory": 1,
                    "configs": {
                        "host_network": true,
                        "privileged": false
                    },
                    "project_id": "{project_id}",
                    "id": "6670f491-72d9-46e8-85f3-3a480b636205"
                }
            ]
        }
    ]
}

Error Codes

For details, see Error Codes.