cis data legacy resource model: property filter

Defines a filter criteria that matches all resources that have a certain property whose value satisfies a specified comparison predicate.

If needed, the property filter predicate may also be defined on a property of a related resource.

Representations:

{
    "comparable_boolean"true,
    "comparable_double"1.5,
    "comparable_id"{
        "id""obj-103",
        "type""string"
    },
    "comparable_long"1,
    "comparable_string""string",
    "comparable_type""LONG",
    "operator""EQUAL",
    "property""string"
}
<?xml version="1.0" ?>
<ns0:PropertyFilter xmlns:ns0="http://vmware.com/cis/data/legacy/resource_model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <comparable_double>1.5</comparable_double>
  <comparable_string>string</comparable_string>
  <comparable_id>
    <id>obj-103</id>
    <type>string</type>
  </comparable_id>
  <comparable_boolean>true</comparable_boolean>
  <property>string</property>
  <comparable_type>LONG</comparable_type>
  <comparable_long>1</comparable_long>
  <operator>EQUAL</operator>
</ns0:PropertyFilter>

Attributes:

Name Type Description
Required
property string Specifies the resource model property to be compared.

Each property specification begins with the fully-qualified name of the resource model that declares the property, followed by the name of the property. The property name could be either a single property name, in case of an immediate property of the resource model or a property path, i.e. chain of property names, separated with / symbol to indicate a child property, e.g. com.acme.PersonModel/relatives/father.

In case the property filter needs to be defined on a property of a related resource, the path should be equal to the -> separated concatenation of the following:

  1. Specification of the property that holds the identifier (id) of the related resource in the target resource model.
  2. Specification of the desired property to compare in the related resource model.
For instance, if we need to search for all persons whose father's name is "Michael" the property path would be com.acme.PersonModel/relatives/father->com.acme.PersonModel/name, assuming both relatives/father and name properties are declared in com.acme.PersonModel resource model.

In case the property of a related entity of a related entity (i.e. multi-hop relationship) should be compared, another path could be added and so on. For instance: com.acme.PersonModel/relatives/father->com.acme.PersonModel/relatives/mother->com.acme.PersonModel/name.

operator string The operator to compare the property values with.

Defines the possible operators to use when comparing the values of individual resource model properties.

When comparing values of different types, one of the values can be promoted from one type to another (if needed in order to perform correct comparison) according to the following rules:

  • When comparing numeric values, a comparable of type long could be promoted (converted) to type double. The result value will be the same as the original value.
  • When comparing to a boolean value, a comparable of type string can be promoted to boolean if the value is parsable to boolean, i.e. either false or true in lower case.
Value is one of:
EQUAL: Equality operator
NOT_EQUAL: Inequality operator
GREATER: Greater than operator
GREATER_OR_EQUAL: Greater than or equal to operator
LESS: Less than operator
LESS_OR_EQUAL: Less than or equal to operator
STARTS_WITH: Operator that checks whether a string property value starts with the comparable string value.

For instance, the comparable value powered will match property whose value is poweredOn or poweredOff, but it will not match isPoweredOn.


ENDS_WITH: Operator that checks whether a string property value ends with the comparable string value.

For instance, the comparable value On will match property whose value is poweredOn, but it will not match poweredOff.


CONTAINS: Operator that checks whether a string property value contains the comparable string value anywhere in its content.

For instance, a property with value isPoweredOn will be matched by comparable values like powered, On or isPoweredOn.

comparable_type string Determines the type of the comparable property value.

The types of properties that can be used for comparison in a property filter. Value is one of:
LONG: Property value of long type.
DOUBLE: Property value of double type.
BOOLEAN: Property value of boolean type.
STRING: Property value of string type.
ID: Property value which represents a resource identifier

Optional
comparable_long long The long value to be compared against the specified property.

Optional. It is only relevant when comparable_type has value LONG. This field is optional and it is only relevant when the value of comparable_type is LONG.

comparable_double double The double value to be compared against the specified property.

Optional. It is only relevant when comparable_type has value DOUBLE. This field is optional and it is only relevant when the value of comparable_type is DOUBLE.

comparable_boolean boolean The boolean value to be compared against the specified property.

Optional. It is only relevant when comparable_type has value BOOLEAN. This field is optional and it is only relevant when the value of comparable_type is BOOLEAN.

comparable_string string The string value to be compared against the specified property.

Optional. It is only relevant when comparable_type has value STRING. This field is optional and it is only relevant when the value of comparable_type is STRING.

comparable_id typed_ID The string value to be compared against the specified property.

Optional. It is only relevant when comparable_type has value ID. This field is optional and it is only relevant when the value of comparable_type is ID.