1.5

Table Of Contents
name="bob"
href="https://vcloud.example.com/api/admin/user/39" />
<UserReference
type="application/vnd.vmware.admin.user+xml"
name="zorro"
href="https://vcloud.example.com/api/admin/user/58" />
</UserReferences>
Packaged Queries
Packaged queries have well-known URLs and can accept most of the parameters used with typed queries.
Query Syntax
Packaged queries have the following syntax:
API-URL
/
query-url
[?
param
][&
param
... ][&
filter
]
n
API-URL is a URL of the form https://vcloud.example.com/api.
n
query-url is the packaged query URL.
n
param is an optional query parameter. Zero or more parameters are allowed. See “Query Parameters,” on
page 211.
n
filter is an optional filter expression. At most one filter expression is allowed. See “Filter Expressions,” on
page 212.
Query Categories
Packaged queries are divided into the following categories:
User queries
The queries have the form API-URL/object-type/query. Any user can run these
queries.
Administrator queries
The queries have the form API-URL/admin/object-type/query. An organization
administrator can run these queries.
Extension queries
The queries have the form API-URL/admin/extension/object-type/query. A
system administrator can run these queries.
If you make a query whose result set you do not have rights to view, a response code of
ACCESS_TO_RESOURCE_IS_FORBIDDEN (403) is returned.
Each query type returns its result set as an XML document in which objects are represented as elements and
object properties are represented as attributes, pairing the name of the property with its value at the time the
request was run. By default, result sets are returned in the records format, which shows all database records
for each object. Most queries also support the references format, which returns a set of object references,
including name, type, and href attributes. All queries that support the records format also support the
idrecords format. For more information about the format parameter, see “Query Parameters,” on page 211.
Table 9-2. Packaged Queries
Query URL Result Set
API-URL/catalogs/query All catalogs in your organization that you have rights to view
or modify
API-URL/mediaList/query All media that you can view or modify
API-URL/vAppTemplates/query All vApp templates that you can view or modify
API-URL/vApps/query All vApps that you can view or modify
Chapter 9 Using the Query Service
VMware, Inc. 207