Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 244595

Re: vCloud API - How to get only public catalogs or only organisation catalogs?

$
0
0

Well I don't know how it is done with the SDK but with the Rest API it is something like this:

 

 

Request:

GET https://<ip>/api/query?type=catalog&fields=name,isShared,isPublished
Response:
<?xml version="1.0" encoding="UTF-8"?>
<QueryResultRecords total="4" pageSize="25" page="1" name="catalog" type="application/vnd.vmware.vcloud.query.records+xml" href="https://<ip>/api/query?type=catalog&amp;page=1&amp;pageSize=25&amp;format=records&amp;fields=name,isShared,isPublished" ...>
    <Link rel="alternate" type="application/vnd.vmware.vcloud.query.references+xml" href="https://<ip>/api/query?type=catalog&amp;page=1&amp;pageSize=25&amp;format=references&amp;fields=name,isShared,isPublished"/>
    <Link rel="alternate" type="application/vnd.vmware.vcloud.query.idrecords+xml" href="https://<ip>/api/query?type=catalog&amp;page=1&amp;pageSize=25&amp;format=idrecords&amp;fields=name,isShared,isPublished"/>
    <CatalogRecord name="library1" isShared="false" isPublished="false" href="https://<ip>/api/catalog/54fb9371-d283-4231-96aa-ddff6ecfd715"/>
    <CatalogRecord name="library2" isShared="false" isPublished="false" href="https://<ip>/api/catalog/6851a8f0-ddfb-42ca-a572-bdc3411d396a"/>
    <CatalogRecord name="library3" isShared="false" isPublished="false" href="https://<ip>/api/catalog/85af5d82-edeb-4bdf-9d60-99c1ca0adf08"/>
    <CatalogRecord name="library4" isShared="false" isPublished="true" href="https://<ip>/api/catalog/f8028818-3225-4ade-95ad-c63b89164314"/>
</QueryResultRecords>
And then if you want to see only the published catalogs you can apply a filter:
Request:
GET https://<ip>/api/query?type=catalog&fields=name,isShared,isPublished&filter=isPublished==true
The result will contain only:
<CatalogRecord name="library4" isShared="false" isPublished="true" href="https://<ip>/api/catalog/f8028818-3225-4ade-95ad-c63b89164314"/>
Read the Query Service documentation for more information.

Viewing all articles
Browse latest Browse all 244595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>