5.5

Table Of Contents
n
The type of the value must be specified, using one of the following keywords.
Table 94. Metadata Type Specifiers in Query Filters
Type Name as Specified in TypedValue Type Name as a Filter Expression Keyword
MetadataStringValue STRING
MetadataNumberValue NUMBER
MetadataDateTimeValue DATETIME
MetadataBooleanValue BOOLEAN
For queries that examine object metadata, you can filter query results using numeric comparison operations
when a metadata value has type NUMBER or DATETIME. Because object metadata types are dynamic, filter
expressions for metadata queries require additional parameters that define the attribute part of the
expression as metadata, and specify the type of the value part of the expression.
Table 95. Metadata Query Filter Expressions
Operator Example Operation
=gt= metadata:attribute=gt=[NUMBER |
DATETIME]:value
Greater than. The example evaluates to true if value
is of type NUMBER or DATETIME and the value
of the metadata key named attribute is greater than
value.
=lt= metadata:attribute=lt=[NUMBER |
DATETIME]:value
Less than. The example evaluates to true if value is
of type NUMBER or DATETIME and the value of
the metadata key named attribute is less than value.
=ge= metadata:attribute=ge=[NUMBER |
DATETIME]:value
Greater than or equal to. The example evaluates to
true if value is of type NUMBER or DATETIME and
the value of the metadata key named attribute is
greater than or equal to value.
=le= metadata:attribute=le=[NUMBER |
DATETIME]:value
Less than or equal to. The example evaluates to
true if value is of type NUMBER or DATETIME and
the value of the metadata key named attribute is
less than or equal to value.
You can specify up to 8 metadata fields in a single query. You cannot use a metadata value as a sort key
when sorting query output.
The syntax for specifying metadata in a fields parameter is:
fields=metadata[@SYSTEM]:key-name
For example:
fields=metadata:rank
fields=metadata@SYSTEM:expiry
The syntax for specifying a metadata field in a filter expression is:
metadata[@SYSTEM]:key-name operator type-keyword:value
For example:
metadata:rank=ge=NUMBER:1
metadata@SYSTEM:expiry=le=DATETIME:2012-06-18T12:00:00-05:00
Chapter 9 Using the Query Service
VMware, Inc. 301