VMware {code} Community
tiru201110141
Contributor
Contributor
Jump to solution

Sharing a vApp, Catalog using the vCloud API

I need to share the vApp using the vCloud API but couldn't find anything relating to sharing operation in the API documentation. If anyone was able to perform this using the API please provide me the steps or sample code to do the same.

0 Kudos
1 Solution

Accepted Solutions
rkamal
VMware Employee
VMware Employee
Jump to solution

Hi,

You can share vApps within your organization members.

"Controlling Access to vApps and Catalogs" - vCloud API Guide 1.5, Pg No 157.

GET https://vcloud/api/vApp/{vapp-id}/controlAccess - Reading access control settings on the vApp.

POST https://vcloud/api/vApp/{vapp-id}/action/controlAccess - Updating access control settings on the vApp.

Regards,

Rajesh Kamal.

View solution in original post

0 Kudos
5 Replies
rkamal
VMware Employee
VMware Employee
Jump to solution

Hi,

You can share vApps within your organization members.

"Controlling Access to vApps and Catalogs" - vCloud API Guide 1.5, Pg No 157.

GET https://vcloud/api/vApp/{vapp-id}/controlAccess - Reading access control settings on the vApp.

POST https://vcloud/api/vApp/{vapp-id}/action/controlAccess - Updating access control settings on the vApp.

Regards,

Rajesh Kamal.

0 Kudos
tiru201110141
Contributor
Contributor
Jump to solution

Hi Rajesh,

Thanks for your prompt response.

I have one more question relating to the vCloud API. Is there a way to achieve the following scenario using the API

I have an organization with two users - admin (Role: Org admin) and frank (Role: vApp User).

a) Login as admin

b) Get the list of vApps accessible by frank (vApps created by frank + shared to frank by other users)

c) Get the list of Catalogs accessible by frank (Catalogs created by frank + shared to frank by other users)

I could see that I can get the list of vApps/catalogs created by frank using the query service of the API. But couldnt find any filter which allows me to get the shared vApps and catalogs

Thanks

Thirumal Bandi

0 Kudos
tiru201110141
Contributor
Contributor
Jump to solution

Hi Rajesh,

Controlling access using the below request format is working only for vApp's

GET https://vcloud/api/object-type/{object-id}/controlAccess - Reading access control settings on the vApp.

POST https://vcloud/api/object-type/{object-id}/action/controlAccess - Updating access control settings on the vApp.

When the same format is used to read the access control settings of a Catalog then the following error is shown

https://<HOST-NAME>/api/catalog/03d05ca5-7db8-4aa0-8b9d-da6a543b3fb1/controlAccess

<Error xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" minorErrorCode="RESOURCE_NOT_FOUND"message="Resource not found" majorErrorCode="404" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://10.130.222.18/api/v1.5/schema/master.xsd" />

Could you please let me know if I am doing anything wrong or is it a limitation from vCloud API ?

Thanks

Thirumal Bandi

0 Kudos
Todor_Todorov
Hot Shot
Hot Shot
Jump to solution

Hi Thirumal,

The syntax for catalogs is little bit different:

GET https://vcloud/api/org/<org-uuid>/catalog/<catalog-uuid>/controlAccess - Reading access control settings on the catalog.

POST https://vcloud/api/org/<org-uuid>/catalog/<catalog-uuid>/action/controlAccess - Updating access control settings on the catalog.

The difference is that the organization uuid should also be included in the URL.

Those URLs are available as links (with rel="down" and rel="controlAccess" respectively) in the response after GET-ting an organization (/api/org/<uuid>).

Regards,

Todor

tiru201110141
Contributor
Contributor
Jump to solution

Hi Todor,

Thanks for your prompt response. It solved my problem

Regards

Thirumal Bandi

0 Kudos