文档首页/ 资源治理中心 RGC/ API参考/ API/ 模板治理/ 创建模板 - CreateTemplate
更新时间:2026-01-13 GMT+08:00
分享

创建模板 - CreateTemplate

功能介绍

创建RFS模板。

授权信息

账号根用户具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项

授权项

访问级别

资源类型(*为必须)

条件键

别名

依赖的授权项

rgc:template:create

Write

-

-

-

-

URI

POST /v1/rgc/templates

请求参数

表1 请求Body参数

参数

是否必选

参数类型

描述

template_name

String

模板名称。

template_type

String

模板类型。predefined:预置;customized:自定义。

template_description

String

模板描述。

template_body

String

模板内容。

响应参数

状态码:201

表2 响应Body参数

参数

参数类型

描述

template_id

String

模板ID。

template_version

String

模板版本。

template_name

String

模板名称。

状态码:403

表3 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

request_id

String

请求唯一标识

encoded_authorization_message

String

加密的错误信息

details

Array of ForbiddenErrorDetail objects

跨服务调用无权限错误信息

表4 ForbiddenErrorDetail

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

请求示例

创建RFS模板。

POST https://{endpoint}/v1/rgc/templates

{
  "template_name" : "string",
  "template_type" : "string",
  "template_description" : "string",
  "template_body" : "string"
}

响应示例

状态码:201

创建成功。

{
  "template_id" : "string",
  "template_version" : "string",
  "template_name" : "string"
}

状态码

状态码

描述

201

创建成功。

403

请求无权限。

错误码

请参见错误码

相关文档