All Products
Search
Document Center

Container Service for Kubernetes:DescribeTemplates

Last Updated:Aug 28, 2026

An orchestration template defines and describes a group of Kubernetes resources. It declaratively describes the configuration of an application or how an application runs. You can call the DescribeTemplates API operation to query orchestration templates and their detailed information, including access permissions, YAML content, and labels.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:DescribeTemplates

get

*All Resource

*

None None

Request syntax

GET /templates HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

template_type

string

No

The type of template. This parameter can be set to a custom value.

  • If the parameter is set to kubernetes, the template is displayed on the Templates page in the console.

  • If you set the parameter to compose, the template is not displayed on the Templates page in the console.

Default value: kubernetes.

kubernetes

page_num

integer

No

The page number.

Default value: 1.

1

page_size

integer

No

The number of entries per page.

Default value: 10.

10

Response elements

Element

Type

Description

Example

object

The response body.

templates

array<object>

The list of returned templates.

object

acl

string

The access control policy of the template. Valid values:

  • private: The template is private.

  • public: The template is public.

  • shared: The template can be shared.

Default value: private.

private

id

string

The ID of the template.

874ec485-e7e6-4373-8a3b-47bde8******

name

string

The name of the template.

webserver

description

string

The description of the template.

a web server

tags

string

The label of the template. By default, the value is the name of the template.

kubernetes

template

string

The template content in the YAML format.

apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: nginx-deployment-basic\n labels:\n app: nginx\nspec:\n replicas: 2\n selector:\n matchLabels:\n app: nginx\n template:\n metadata:\n labels:\n app: nginx\n spec:\n containers:\n - name: nginx\n image: busybox:latest\n ports:\n - containerPort: 80

template_type

string

The type of template. This parameter can be set to a custom value.

  • If the parameter is set to kubernetes, the template is displayed on the Templates page in the console.

  • If the parameter is set to compose, the template is displayed on the Container Service - Swarm page in the console. However, Container Service for Swarm is deprecated.

kubernetes

created

string

The time when the template was created.

2025-04-25T16:56:33+08:00

updated

string

The time when the template was updated.

2025-04-25T16:56:33+08:00

template_with_hist_id

string

The ID of the parent template. The value of template_with_hist_id is the same for each template version. This allows you to manage different template versions.

ad81d115-7c8b-47e7-a222-9c28d7******

page_info

object

The pagination information.

page_number

integer

The page number.

20

page_size

integer

The number of entries per page.

3

total_count

integer

The total number of entries returned.

50

Examples

Success response

JSON format

{
  "templates": [
    {
      "acl": "private",
      "id": "874ec485-e7e6-4373-8a3b-47bde8******",
      "name": "webserver",
      "description": "a web server",
      "tags": "kubernetes",
      "template": "apiVersion: apps/v1\\nkind: Deployment\\nmetadata:\\n  name: nginx-deployment-basic\\n  labels:\\n    app: nginx\\nspec:\\n  replicas: 2\\n  selector:\\n    matchLabels:\\n      app: nginx\\n  template:\\n    metadata:\\n      labels:\\n        app: nginx\\n    spec:\\n      containers:\\n      - name: nginx\\n        image: busybox:latest\\n        ports:\\n        - containerPort: 80",
      "template_type": "kubernetes",
      "created": "2025-04-25T16:56:33+08:00",
      "updated": "2025-04-25T16:56:33+08:00",
      "template_with_hist_id": "ad81d115-7c8b-47e7-a222-9c28d7******"
    }
  ],
  "page_info": {
    "page_number": 20,
    "page_size": 3,
    "total_count": 50
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.