You can call DescribeTemplates to query application deployment templates.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses the common request header only. For more information, see Common parameters.

Request syntax

GET /templates HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
template_type String No kubernetes

The type of the template. Valid values: kubernetes and compose. Default value: kubernetes.

Response parameters

Parameter Type Example Description
acl String private

Indicates whether the template is private, public, or shared by specified users. Valid values:

  • private
  • public
  • shared

Default value: private.

description String a template of nginx

The description of the template.

name String nginx-app

The name of the template.

tags String kubernetes

The tags of the template. The default value is the name of the template.

template String "apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1\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 # nodeSelector:\n # env: test-team\n containers:\n - name: nginx\n image: nginx:1.7.9 # replace it with your exactly <image_name:tags>\n ports:\n - containerPort: 80"

The content of the template.

template_type String kubernetes

The type of the template. Valid values:

  • kubernetes: the standard template provided by Kubernetes.
  • compose: the standard template provided by Docker Compose.

Examples

Sample requests

GET /templates HTTP/1.1
Common request header

Sample success responses

XML format

<template>"apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1\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 # nodeSelector:\n # env: test-team\n containers:\n - name: nginx\n image: nginx:1.7.9 # replace it with your exactly &lt;image_name:tags&gt;\n ports:\n - containerPort: 80"</template>
<name>nginx-app</name>
<description>a template of nginx</description>
<template_type>kubernetes</template_type>
<acl>private</acl>
<tags>kubernetes</tags>

JSON format

{"template":"\"apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1\\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 # nodeSelector:\\n # env: test-team\\n containers:\\n - name: nginx\\n image: nginx:1.7.9 # replace it with your exactly <image_name:tags>\\n ports:\\n - containerPort: 80\"","name":"nginx-app","description":"a template of nginx","template_type":"kubernetes","acl":"private","tags":"kubernetes"}

Error codes

For a list of error codes, visit the API Error Center.