cis data svc 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" : [
{
"comparable_value" : "opaque_string_value",
"property" : "string",
"comparable_list" : [
"opaque_string_value",
"opaque_string_value"
],
"operator" : "EQUAL"
},
{
"comparable_value" : "opaque_string_value",
"property" : "string",
"comparable_list" : [
"opaque_string_value",
"opaque_string_value"
],
"operator" : "EQUAL"
}
],
"operator" : "AND"
},
"sort_criteria" : [
{
"sort_direction" : "ASCENDING",
"property" : "string"
},
{
"sort_direction" : "ASCENDING",
"property" : "string"
}
],
"limit" : 1,
"properties" : [
"string",
"string"
]
}
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.svc.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 must not be empty. 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.svc.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 |
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 GREATER_OR_EQUAL: Greater than or equal to operator LESS: Less than operator LESS_OR_EQUAL: Less than or equal to operator IN: Checks for equality with at least one of a list of values |
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 resource identifier, i.e. @modelKey property, 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]. This field is optional and it is only relevant when the value ofoperator is one of EQUAL, NOT_EQUAL, GREATER, GREATER_OR_EQUAL, LESS, or LESS_OR_EQUAL. |
filter.criteria[].comparable_list | opaque[] | The list of primitive values to test for equality with the property value when operator IN is used. The list cannot be empty. See cis.data.svc.resource_model.property_predicate.comparable_value for the list of allowable primitive value types. Optional. It is only relevant when operator has value IN. This field is optional and it is only relevant when the value of operator is 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. Could be used only if sorting criteria cis.data.svc.resource_model.query_spec.sort_criteria is applied. If used, the value should be positive integer. Optional. If unset, all resources will be returned. Note that the service defines its own limit that cannot be overriden here. If the more resources than this default limit, an vapi.std.errors.invalid_argument error will be thrown. |