上一主题: get_acl 方法(template 对象)下一主题: modify_acl 方法(template 对象)


put_acl 方法(template 对象)
说明

替换整个模板 ACL。

语法
/api/v2/template/put_acl?template=template&owner=<owner>&acl=<ACLs>&vdc=controller-name 
参数
模板

模板的名称

owner

指定主体的网格 ACL 的 URL 编码的所有者属性

acl

用斜杠 (/) 分隔的主体的 URL 编码列表

vdc

目标虚拟数据中心的名称

事务类型

同步

请求类型

GET

示例

将模板应用 VDS_CentOS 的整个 ACL 替换为所有者 api@3tera.com

GET
http://192.168.123.200/api/v2/template/put_acl?template=VDS_CentOS&owner=local%3Auser%3Aapi%403tera.com&acl=&vdc=mygrid

将模板应用 VDS_CentOS 的整个 ACL 替换为所有者 api@3tera.com 和主体 local:user:api@3tera.com=full


GET
http://192.168.123.200/api/v2/template/put_acl?template=VDS_CentOS&owner=local%3Auser%3Aapi%403tera.com&acl=local%3Auser%3Aapi%403tera.com%3Dfull&vdc=mygrid

将模板应用 VDS_CentOS 的整个 ACL 替换为所有者 api@3tera.com 和主体 local:user:api@3tera.com=full/local:user:test@3tera.com=configure。

GET
http://192.168.123.200/api/v2/template/put_acl?template=VDS_CentOS&owner=local%3Auser%3Aapi%403tera.com&acl=local%3Auser%3Aapi%403tera.com%3Dfull%2Flocal%3Auser%3Atest%403tera.com%3Dconfigure&vdc=mygrid
 
样例输出

JSON

{
   "message" : ""
} 

XML


<message></message>

HTTP 错误代码
400

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

400.4

缺少必需参数 (template)

-缺少参数 template=template

缺少必需参数 (owner)

-参数 owner=owner

缺少必需参数 (acl)

-缺少参数 acl=acl

404.1

未找到实体-应用 test 不存在。

-指定的模板在 mygrid 上不存在。

未找到实体-无法放置应用 ACL-主体数据无效-主体本地用户“test@3tera.com”不存在。

-指定的 owner 或 acl 无效