调用DescribeTemplates查询编排模板。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求语法
GET /templates?template_type=String&page_num=Long&page_size=Long HTTP/1.1
Content-Type:application/json
请求参数
参数名称 | 类型 | 是否必选 | 示例 | 说明 |
---|---|---|---|---|
template_type | String | 是 | kubernetes |
模板类型,值可以是任意值。
默认值: |
page_num | Long | 否 | 1 |
对查询结果进行分页处理,指定返回第几页的数据。 默认值: 1。 |
page_size | Long | 否 | 10 |
对查询结果进行分页处理,指定每页包含的数据条数。 默认值:10。 |
响应体语法
HTTP/1.1 200
Content-Type:application/json
{
"templates" : [ {
"acl" : "String",
"id" : "String",
"name" : "String",
"description" : "String",
"tags" : "String",
"template" : "String",
"template_type" : "String",
"created" : "String",
"updated" : "String",
"template_with_hist_id" : "String"
} ],
"page_info" : {
"page_number" : Long,
"page_size" : Long,
"total_count" : Long
}
}
响应参数
参数名称 | 类型 | 示例 | 说明 |
---|---|---|---|
templates | Array of template |
模板列表。 |
|
acl | String | private |
用户部署模板的访问权限,取值:
默认值: |
id | String | 874ec485-e7e6-4373-8a3b-47bde8ae789f |
部署模板ID。 |
name | String | webserver |
部署模板名称。 |
description | String | a web server |
部署模板描述信息。 |
tags | String | kubernetes |
部署模板的标签,如果不显式指定,默认为模板名称。 |
template | String | 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 |
YAML格式的模板内容。 |
template_type | String | kubernetes |
模板类型,值可以是任意值。
|
created | String | 2020-06-10T16:30:16+08:00 |
部署模板创建时间。 |
updated | String | 2020-06-10T16:30:16+08:00 |
部署模板更新时间。 |
template_with_hist_id | String | ad81d115-7c8b-47e7-a222-9c28d7f6e588 |
模板关联的父模板ID,用于实现模板多版本功能(同一模板的不同版本拥有相同的 |
page_info | object |
分页信息。 |
|
page_number | Long | 20 |
展示当前页数。 |
page_size | Long | 3 |
单页最大数据条数。 |
total_count | Long | 50 |
结果总数。 |
查询所有编排模板示例
请求示例
GET /templates?template_type=kubernetes&page_num=1&page_size=10 HTTP/1.1
Content-Type:application/json
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<templates>
<acl>private</acl>
<id>874ec485-e7e6-4373-8a3b-47bde8ae789f</id>
<name>webserver</name>
<description>a web server</description>
<tags>kubernetes</tags>
<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>
<template_type>kubernetes</template_type>
<created>2020-06-10T16:30:16+08:00</created>
<updated>2020-06-10T16:30:16+08:00</updated>
<template_with_hist_id>ad81d115-7c8b-47e7-a222-9c28d7f6e588</template_with_hist_id>
</templates>
<page_info>
<page_number>20</page_number>
<page_size>3</page_size>
<total_count>50</total_count>
</page_info>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"templates" : [ {
"acl" : "private",
"id" : "874ec485-e7e6-4373-8a3b-47bde8ae789f",
"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" : "2020-06-10T16:30:16+08:00",
"updated" : "2020-06-10T16:30:16+08:00",
"template_with_hist_id" : "ad81d115-7c8b-47e7-a222-9c28d7f6e588"
} ],
"page_info" : {
"page_number" : 20,
"page_size" : 3,
"total_count" : 50
}
}
错误码
访问错误中心查看更多错误码。
开发者资源
-
SDK
阿里云为您提供多种语言的SDK,帮助您快速通过API集成阿里云的产品和服务,推荐您使用SDK调用API,已免除您手动签名验证,详情请参见SDK参考文档链接。
-
OpenAPI Explorer
快速检索,可视化调试API,在线命令行工具,同步动态生成可执行的SDK代码示例。
-
阿里云CLI
阿里云资产管理和配置工具,可通过命令方式同时管理多个阿里云产品和服务,简单快捷,是您上云好帮手。
在文档使用中是否遇到以下问题
更多建议
匿名提交