Example 6-31. Create a Role
Request:
POST http://vcloud.example.com/api/v1.0/admin/roles
Content-Type: application/vnd.vmware.admin.role+xml
<Role name="vAppWrangler" xmlns="http://www.vmware.com/vcloud/v1">
<Description>Create and manage vApps</Description>
<RightReferences>
<RightReference type="application/vnd.vmware.admin.right+xml"
<RightReference type="application/vnd.vmware.admin.right+xml"
<RightReference type="application/vnd.vmware.admin.right+xml"
<RightReference ... />
...
</RightReferences>
</Role>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.role+xml
...
<Role name="vAppWrangler" type="application/vnd.vmware.admin.role+xml"
<Link rel="edit" type="application/vnd.vmware.admin.role+xml"
<Link rel="remove" href="http://vcloud.example.com/api/v1.0/admin/role/102"/>
<Description>Create and manage vApps</Description>
<RightReferences>
<RightReference type="application/vnd.vmware.admin.right+xml" name="vApp: View"
<RightReference type="application/vnd.vmware.admin.right+xml"
<RightReference type="application/vnd.vmware.admin.right+xml"
<RightReference ... />
...
</RightReferences>
</Role>
View Role Metadata
URLs for all roles in a vCloud appear as RoleReference elements in a vCloud body. An individual role's URL
is also displayed in the response to a request that creates the role A system administrator can GET a role URL
to view the Role body. Example 6‐32 does this for the role created in Example
Example 6-32. View Role Metadata
Request:
GET http://vcloud.example.com/api/v1.0/admin/role/102
Response:
200 OK
Content-Type: application/vnd.vmware.admin.role+xml
...
<Role name="vApp Wrangler" type="application/vnd.vmware.admin.role+xml"
VMware, Inc.
name="vApp: View"
href="http://vcloud.example.com/api/v1.0/admin/right/16"/>
name="vApp: Power Operations"
href="http://vcloud.example.com/api/v1.0/admin/right/9"/>
name="vApp: Download"
href="http://vcloud.example.com/api/v1.0/admin/right/11"/>
href="http://vcloud.example.com/api/v1.0/admin/role/102" ...>
href="http://vcloud.example.com/api/v1.0/admin/role/102"/>
href="http://vcloud.example.com/api/v1.0/admin/right/16"/>
name="vApp: Power Operations"
href="http://vcloud.example.com/api/v1.0/admin/right/9"/>
name="vApp: Download"
href="http://vcloud.example.com/api/v1.0/admin/right/11"/>
href="http://vcloud.example.com/api/v1.0/admin/role/102" ...>
Chapter 6 Administrative Operations
6‐31.
115
Need help?
Do you have a question about the VCLOUD API 1.0 - API and is the answer not in the manual?
Questions and answers