上一主题: migrate 方法(template 对象)下一主题: config_boundary 方法(template 对象)


config 方法(template 对象)
说明

检索应用模板配置参数

语法
/api/v2/template/config?template=template&vdc=controller-name 
参数
模板

应用模板的名称

vdc

目标虚拟数据中心的名称

选项

有关此命令可用选项的说明,请参阅命令行 Shell 参考中的“应用控制”

注意:Web 服务 API 中的模板对象与 shell 的应用对象相关。

事务类型

同步

请求类型

GET

示例

检索模板 VDS_CentOS51_r15 的配置参数。

GET http://192.168.123.200/api/v2/template/config?template=VDS_CentOS51_r15&vdc=mygrid 
样例输出
XML:
<config>
   <name>VDS_CentOS51_r15</name>
   <__description>虚拟专用服务器-基于 CentOS 5.1 (v1.0.14-1)</__description>
   <__doc_url>http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html</__doc_url> 
   <__template>0</__template>
</config>
JSON:

{   "__doc_url" : "http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html",
   "__template" : "0",
   "__description" : "虚拟专用服务器-基于 CentOS 5.1 (v1.0.14-1)",
   "name" : "VDS_CentOS51_r15"
} 
HTTP 错误代码
404

未找到实体 vdc mygrid-WS_API 应用中没有配置指定的 VDC 名称。

400.4

缺少必需参数 (template)。 -请求中缺少参数 template=template

404.1

未找到实体-权限被拒绝-应用 VDS_CentOS_r1 不存在。