cis data provider resource model: property predicate

A condition on a resource model property. Matches all instances of the resource models listed in cis.data.provider.resource_model.query_spec.resource_models that have a property which satisifes this condition.

Representation:

{
    "ignore_case"true,
    "array_operator""ALL_ELEMENTS",
    "comparable_value""opaque_string_value",
    "property""string",
    "comparable_list"[
        "opaque_string_value",
        "opaque_string_value"
    ],
    "operator""EQUAL"
}

Attributes:

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

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. relatives/father.

In case the specified property is present in more than one of the queried resource models (specified in cis.data.provider.resource_model.query_spec.resource_models) the property name should be prefixed by the fully-qualified name of the resource model of interest, followed by / symbol before the actual property name, e.g. com.acme.PersonModel/relatives/father.

If the specified property is missing in the queried resource model or the property value is unset/null then the respective resource items should be excluded from the final result. This exclusion should happen for all comparison operators except the UNSET operator. The described behavior is the one applied in SQL where missing and null values are evaluated to unknown values and all predicates on these values do not match any resource.

operator string The operator to use for comparison of the property value.

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 converted 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.

Applicable to numerical properties only, e.g. long, double. Cannot apply to String or boolean.


GREATER_OR_EQUAL: Greater than or equal to operator.

Applicable to numerical properties only, e.g. long, double. Cannot apply to String or boolean.


LESS: Less than operator.

Applicable to numerical properties only, e.g. long, double. Cannot apply to String or boolean.


LESS_OR_EQUAL: Less than or equal to operator.

Applicable to numerical properties only, e.g. long, double. Cannot apply to String or boolean.


IN: Checks for equality with at least one of a list of values

See cis.data.provider.resource_model.property_predicate.comparable_list for the set of the allowable comparable value types.


NOT_IN: Checks for inequality with all values in a list. If the property is equal to any of the values in the list, evaluates to false. Otherwise, evaluates to true and the property is matched.

See #comparableList for the set of the allowable comparable value types.


LIKE: Pattern matching operator applicable to String properties.

The * character is used to define wildcard, i.e. a substitute for zero or more missing letters) before or after a given sequence of characters. If used at the end, it is interpreted as search for all properties whose value starts with the given characters. If used at the beginning, it is interpreted as search for all properties whose value ends with the given characters.

For instance, if the input pattern is *vm it will match property with value linux-vm, but not vm-linux. If the input pattern is vm* it will match property with value vm-linux, but not linux-vm.

The wildcard character cannot be used in between other characters, i.e. in the middle of a pattern. It can be use more than once in a single pattern only in case it surrounds the pattern, i.e. both in the beginning and at the end of the pattern to perform substring (infix) search.

For instance, if the input pattern is *vm* it will match property with value linux-vm-1, linux-vm, old-vm-linux, vm-linux and vm.

The backslash character \ is used for escaping. Hence, wildcard is escaped with the sequence \* and the escape character itself with the sequence \\.


NOT_LIKE: Opposite of LIKE. The resource will be matched if the property does NOT match the provided pattern.
UNSET: Checks whether the property has any value assigned to it or not, i.e. whether it is unset. Applicable only to optional properties or children of optional properties.

A property is considered unset if its value is null or its parent property is unset. Empty array is not considered unset.

For instance, the property com.acme.PersonModel/phone/home is considered unset if either it or its parent, i.e. com.acme.PersonModel/phone is equal to null.

Should be used in conjunction with a boolean value for cis.data.provider.resource_model.property_predicate.comparable_value in order to determine whether to look for unset or set property. If comparableValue is set to true, matches resources with unset property, Otherwise, if comparableValue is set to false, matches resources whose property is set to some (any) value, except null.

Optional
comparable_value opaque The primitive value that the property should be compared to. Note that only the following primitive value types could be used for comparison:
  • integer
  • floating point number
  • boolean
  • string
If any other type is provided, vapi.std.errors.invalid_argument exception will be returned.

Please, note that when comparing with model key, i.e. property PROPERTY_MODEL_KEY, the comparable value should be of string type.

Optional. It is only relevant when operator has value [EQUAL, NOT_EQUAL, GREATER, GREATER_OR_EQUAL, LESS, LESS_OR_EQUAL, LIKE, NOT_LIKE, UNSET]. This field is optional and it is only relevant when the value of operator is one of EQUAL, NOT_EQUAL, GREATER, GREATER_OR_EQUAL, LESS, LESS_OR_EQUAL, LIKE, NOT_LIKE, or UNSET.

comparable_list opaque[] The list of primitive values to test for equality with the property value when operator IN or NOT_IN is used. The list cannot be empty.

See cis.data.provider.resource_model.property_predicate.comparable_value for the list of allowable primitive value types.

Optional. It is only relevant when operator has value [IN, NOT_IN]. This field is optional and it is only relevant when the value of operator is one of IN or NOT_IN.

array_operator string The operator should be used only for properties, which return a collection as their value. It specifies one of the options defined in cis.data.provider.resource_model.property_predicate.array_operator.

This operator MUST always be used in combination with a cis.data.provider.resource_model.property_predicate.comparison_operator.

Optional. MUST be set for collection values and unset for non-collection (i.e. scalar) values.

ignore_case boolean Whether to treat lower and upper cases of the same letter as if they were the same character.

If set to true, comparing String properties will be performed while ignoring lower/upper case considerations. That is equivalent to performing the search as if before that each property was transformed to lower case.

The default value is false, which means that lower and upper case characters are treated as different characters.

If applied to property of type other than String, an InvalidArgument will be thrown.

Optional. If unset, it will be automatically assigned as false.