Upon creation, a VDC template is not accessible to any organization in the system. To enable organizations to create VDCs from a template, a system administrator must use the vCloud API access control mechanism to grant those organizations ReadOnly access to the template, and must also grant organization members rights to view and instantiate VDC templates.
A system administrator can make a request similar to the ones described in Controlling Access to vApps and Catalogs to control access to VDC templates.
1 | Retrieve the XML representation of the VDC template to find its controlAccess link. GET https://vcloud.example.com/api/admin/extension/VdcTemplate/100 The controlAccess link has the following form: <vcloud:Link rel="controlAccess" href="https://vcloud.example.com/api/admin/extension/vdcTemplate/100/action/controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml"/> |
2 | Create a ControlAccessParams request body that grants ReadOnly access to the organizations that you want to have access to the template . The only AccessLevel that you can grant for a VdcTemplate is ReadOnly. You cannot set IsSharedToEveryone to true. |
3 | POST the ControlAccessParams request body to the link you retrieved in Step 1. |
A link to the specified VDC template is returned in the vdcTemplates list of those organizations to which access was granted. See Create a VDC from a Template
This request grants access to a VDC template to two organizations.
POST https://vcloud.example.com/api/admin/extension/vdcTemplate/100/action/controlAccess Content-Type: application/vnd.vmware.vcloud.controlAccess+xml ... <ControlAccessParams xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns="http://www.vmware.com/vcloud/v1.5"> <IsSharedToEveryone>false</IsSharedToEveryone> <AccessSettings> <AccessSetting> <Subject href="https://vcloud.example.com/api/org/5"></Subject> <AccessLevel>ReadOnly</AccessLevel> </AccessSetting> <AccessSetting> <Subject href="https://vcloud.example.com/api/org/26"></Subject> <AccessLevel>ReadOnly</AccessLevel> </AccessSetting> </AccessSettings> </ControlAccessParams>
The response is a ControlAccessParams element.
200 OK Content-Type: application/vnd.vmware.vcloud.controlAccess+xml ... <ControlAccessParams xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns="http://www.vmware.com/vcloud/v1.5" \> ... </ControlAccessParams>