调用UpdateTemplate更新一个编排模板。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求语法
PUT /templates/TemplateId HTTP/1.1
Content-Type:application/json
{
"description" : "String",
"name" : "String",
"tags" : "String",
"template" : "String",
"template_type" : "String"
}
请求参数
参数名称 | 类型 | 是否必选 | 示例 | 说明 |
---|---|---|---|---|
TemplateId | String | 是 | 72d20cf8-a533-4ea9-a10d-e7630d3d2708 | 模板ID。 |
参数名称 | 类型 | 是否必选 | 示例 | 说明 |
---|---|---|---|---|
description | String | 否 | web server cluster | 部署模板描述信息。 |
name | String | 否 | webserver01 | 部署模板名称。 |
tags | String | 否 | web | 部署模板标签。 |
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: 8080 | YAML格式的模板内容。 |
template_type | String | 否 | kubernetes | 模板类型,值可以是任意值。
|
响应体语法
HTTP/1.1 200 OK
响应参数
无响应参数
更新编排模板示例
请求示例
PUT /templates/72d20cf8-a533-4ea9-a10d-e7630d3d2708 HTTP/1.1
Content-Type:application/json
{
"description" : "web server cluster",
"name" : "webserver01",
"tags" : "web",
"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: 8080",
"template_type" : "kubernetes"
}
正常返回示例
JSON
格式
HTTP/1.1 200 OK
错误码
访问错误中心查看更多错误码。
开发者资源
-
SDK
阿里云为您提供多种语言的SDK,帮助您快速通过API集成阿里云的产品和服务,推荐您使用SDK调用API,已免除您手动签名验证,详情请参见SDK参考文档链接。
-
OpenAPI Explorer
快速检索,可视化调试API,在线命令行工具,同步动态生成可执行的SDK代码示例。
-
阿里云CLI
阿里云资产管理和配置工具,可通过命令方式同时管理多个阿里云产品和服务,简单快捷,是您上云好帮手。