cis data provider resource model: query spec
Each query has the following main constituents:
- Property List: specifies the list of property values to be returned in the result set for the query. Corresponds to the
SELECT
clause in SQL. - Resource Model List: specifies one or multiple resource models (for the same resource type) that should be queried. Corresponds to the
FROM
clause in SQL. - Filter: restricts (filters) the set of resource models whose properties should be returned based on conditions/predicates on their property values. Corresponds to the
WHERE
clause in SQL. - Sort Criteria: defines how the final result set should be sorted by comparing the values of one or more properties of the items in the result set. Corresponds to the
ORDER BY
clause in SQL. - Limit: limits the number of items from the final sorted result set that should be returned to the client.
Representation:
"resource_models" : [
"string",
"string"
],
"filter" : {
"criteria" : [
{
"ignore_case" : true,
"array_operator" : "ALL_ELEMENTS",
"comparable_value" : "opaque_string_value",
"property" : "string",
"comparable_list" : [
"opaque_string_value",
"opaque_string_value"
],
"operator" : "EQUAL"
},
{
"ignore_case" : true,
"array_operator" : "ALL_ELEMENTS",
"comparable_value" : "opaque_string_value",
"property" : "string",
"comparable_list" : [
"opaque_string_value",
"opaque_string_value"
],
"operator" : "EQUAL"
}
],
"operator" : "AND"
},
"sort_criteria" : [
{
"ignore_case" : true,
"sort_direction" : "ASCENDING",
"property" : "string"
},
{
"ignore_case" : true,
"sort_direction" : "ASCENDING",
"property" : "string"
}
],
"offset" : 1,
"limit" : 1,
"properties" : [
"string",
"string"
],
"return_total_count" : true
}
Attributes:
Name | Type | Description |
---|---|---|
Required | ||
properties | string[] | The names of the (resource model) properties to be included in the result set for the query. Each 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 In case a requested 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 Corresponds to the The list may be unset only if the cis.data.provider.resource_model.query_spec.limit is set to zero. Otherwise, vapi.std.errors.invalid_argument error will be thrown. |
resource_models | string[] | The names of the resource models to be queried. All properties used in the query should belong to one of those resource models. If a property from another model is used somewhere else in the query an vapi.std.errors.invalid_argument error will be thrown to indicate this violation. Multiple resource models could be specified here only if they all belong to the same resource type. In case multiple resoruce models are specified they are implicitly joined on their primary key @modelKey property. Each resource model name should be fully-qualified, e.g. Corresponds to the The list must not be empty. Otherwise, vapi.std.errors.invalid_argument error will be thrown. |
filter.criteria | property_predicate[] | A set of conditions on the resource model properties that together define the criteria for filtering/matching the resources whose data to retrieve. The list must not be empty. Otherwise, vapi.std.errors.invalid_argument error will be thrown. |
filter.criteria[].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 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 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. |
filter.criteria[].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:
EQUAL: Equality operator. NOT_EQUAL: Inequality operator. GREATER: Greater than operator. Applicable to numerical properties only, e.g. GREATER_OR_EQUAL: Greater than or equal to operator. Applicable to numerical properties only, e.g. LESS: Less than operator. Applicable to numerical properties only, e.g. LESS_OR_EQUAL: Less than or equal to operator. Applicable to numerical properties only, e.g. 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 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 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 For instance, the property Should be used in conjunction with a |
Optional | ||
filter | filter | Restricts (filters) the set of resource models whose properties should be returned based on conditions/predicates on their property values. Corresponds to the FROM clause). |
filter.criteria[].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:
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 ofoperator is one of EQUAL, NOT_EQUAL, GREATER, GREATER_OR_EQUAL, LESS, LESS_OR_EQUAL, LIKE, NOT_LIKE, or UNSET. |
filter.criteria[].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 ofoperator is one of IN or NOT_IN. |
filter.operator | string | The logical operator which defines how the property predicates should be combined in order to filter a given resource. Optional. If unset, defaults to AND . |
sort_criteria | sort_criterion[] | Defines how the final result set should be sorted by comparing the values of one or more properties of the items in the result set. Represents a list of one or more sorting criteria, where those with lower indices in the list takes precedence over the specs with higher indices. Corresponds to the |
limit | long | The maximum number of result items to return. If used, the value should be a non-negative integer. A limit of zero means that no items shall be retrieved. Useful if the client is only interested in the total number of items matched by the query; in this case, cis.data.provider.resource_model.query_spec.return_total_count should be set to A non-zero limit can be used only if sorting criteria is applied, i.e. cis.data.provider.resource_model.query_spec.sort_criteria is set. Note that the service defines its own default limit that cannot be overridden here. If the specified value here is above that limit, an vapi.std.errors.invalid_argument error will be thrown for the particular query in order to indicate this violation. Optional. If unset, a default limit will be automatically assigned. |
offset | long | The offset into the result set. Could be used only if sorting criteria is applied, i.e. cis.data.provider.resource_model.query_spec.sort_criteria is set. If used, the value should be a non-negative integer. If the offset is |
return_total_count | boolean | Indicates whether the total number of resources that matched the query should be computed and returned. This is meaningful only in cases where the number of resources that match the query could be more than the limit of the result items to be returned as specified in cis.data.provider.resource_model.query_spec.limit, or if the client wants to retrieve only the number of items that matched the query, but without the items themselves. If unset, defaults to false . The total number of matched resources depends solely on the cis.data.provider.resource_model.query_spec.filter and the cis.data.provider.resource_model.query_spec.resource_models. It does not depend on the requested cis.data.provider.resource_model.query_spec.properties, i.e. the total count is similar to but less expressive than the SQL NOTE: Use this with particular caution and only when it's absolutely needed as the computation of this value could have noticeable performance overhead. Optional. If unset, it will be automatically assigned as false. |