Skip to main content

DescribeTemplates

Description

Call DescribeTemplates query orchestration template.

Request Method

POST

Request Path

/apsara/route/CS/DescribeTemplates

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
regionIdBODYstringYesNo sample value for this parameter.region id
page_numBODYlongNo1paging the query results and specifying the data on which page to return. default value: 1.
template_typeBODYstringYeskubernetestemplate type, the value can be any value. when the value is kubernetes will be displayed on the orchestration template page of the console. when the value is compose will not be displayed on the orchestration template page of the console. default value:kubernetes.
versionBODYstringNo2016-01-01version of api
page_sizeBODYlongNo10paging the query results and specifying the number of data contained in each page. default value: 10.

Return data

NameTypeSample valueDescription
templatestringapiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment-basic labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: busybox:latest ports: - containerPort: 80template content in YAML format.
template_with_hist_idstringad81d115-7c8b-47e7-a222-9c28d7f6e588The parent template ID associated with the template, used to realize multi-version function of template (different versions of the same template have the same template_with_hist_id value).
createdstring2020-06-10T16:30:16+08:00deployment template creation time.
total_countlong50total number of results.
templatesarray of templateNo sample value for this parameter.template list.
descriptionstringa web serverdeployment template description information.
aclstringprivateaccess to the user deployment template, value: private: private. public: public. shared: shareable. default value:private.
tagsstringkubernetesthe label of the deployment template, if not explicitly specified, the default is the template name.
page_numberlong20shows the current number of pages.
page_infoobjectNo sample value for this parameter.paging information.
namestringwebserverdeployment template name.
template_typestringkubernetestemplate type, the value can be any value. when the value is kubernetes will be displayed on the orchestration template page of the console. when the value is compose will display the template (obsolete) on the console Swarm cluster page.
idstring874ec485-e7e6-4373-8a3b-47bde8ae789fdeployment template ID.
updatedstring2020-06-10T16:30:16+08:00deployment template update time.
page_sizelong3Maximum number of data on a single page.

Example

Successful Response example

{
"template":"apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment-basic labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: busybox:latest ports: - containerPort: 80",
"template_with_hist_id":"ad81d115-7c8b-47e7-a222-9c28d7f6e588",
"created":"2020-06-10T16:30:16+08:00",
"total_count":"50",
"templates":"",
"description":"a web server",
"acl":"private",
"tags":"kubernetes",
"page_number":"20",
"page_info":"",
"name":"webserver",
"template_type":"kubernetes",
"id":"874ec485-e7e6-4373-8a3b-47bde8ae789f",
"updated":"2020-06-10T16:30:16+08:00",
"page_size":"3"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}