VMware

ResourceModel Namespace

Represents a uniform query interface for search and retrieval of arbitrary projections onto given resource model data. Provides a convenient API for search and navigation through the CIS inventory using filtering by various resource model property criteria, including on properties of related resources.

List of commands:



Query Command

dcli com vmware cis data legacy resourcemodel query

Description

This method is deprecated! Use method {@link #retrieve(com.vmware.cis.data.QuerySpec)} instead. Retrieve a snapshot of the resource model data as specified in the provided query specification, i.e. QuerySpec instance.

Options

Option Name Type Required Description
resource‑filter‑filter‑type string Yes The type of the filter used. Valid values are: {TYPE, ID, PROPERTY, COMPOSITE}
resource‑filter‑resource‑type string No Limits the results returned for a query to resources with the specified resource type, e.g. com.acme.Person. TODO: Add reference to the documentation/API that clients can check in order to find out what types and properties they can query. This option is optional and it is only relevant when the value of filterType is TYPE.
resource‑filter‑resource‑id‑type string No The type of the resource being identified, e.g. com.acme.Person.
resource‑filter‑resource‑id‑id string No The resource's own identifier. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.
resource‑filter‑property‑filter‑property string No 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.
resource‑filter‑property‑filter‑operator string No The operator to compare the property values with. Valid values are: {EQUAL, NOT_EQUAL, GREATER, GREATER_OR_EQUAL, LESS, LESS_OR_EQUAL, STARTS_WITH, ENDS_WITH, CONTAINS}
resource‑filter‑property‑filter‑comparable‑type string No Determines the type of the comparable property value. Valid values are: {LONG, DOUBLE, BOOLEAN, STRING, ID}
resource‑filter‑property‑filter‑comparable‑long int No The long value to be compared against the specified property. This option is optional and it is only relevant when the value of comparableType is LONG.
resource‑filter‑property‑filter‑comparable‑double float No The double value to be compared against the specified property. This option is optional and it is only relevant when the value of comparableType is DOUBLE.
resource‑filter‑property‑filter‑comparable‑boolean bool No The boolean value to be compared against the specified property. This option is optional and it is only relevant when the value of comparableType is BOOLEAN.
resource‑filter‑property‑filter‑comparable‑string string No The string value to be compared against the specified property. This option is optional and it is only relevant when the value of comparableType is STRING.
resource‑filter‑property‑filter‑comparable‑id‑type string No The type of the resource being identified, e.g. com.acme.Person.
resource‑filter‑property‑filter‑comparable‑id‑id string No The resource's own identifier. When clients pass a value of this class as a parameter, the option type must contain the actual resource type. When commands return a value of this class as a output, the option type will contain the actual resource type.
resource‑filter‑composite‑filter‑operator string No The operator to be used to join the resource sets identified by the constituent filters. Valid values are: {INTERSECT, UNION}
property‑spec string No Specifies the properties of the filtered set of resources to be included in the result set for the query. 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. If unset, no properties will be returned but only the identifiers of the matched resources.
sort‑criteria‑property string No Specifies the resource model property whose value to compare when sorting the result items. 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.
sort‑criteria‑sort‑direction string No Specifies the order direction to use when sorting the result items by the specified resource model property/properties. The default value is ASCENDING. If unset, defaults to ASCENDING. Valid values are: {ASCENDING, DESCENDING}
offset int No The offset into the result set. Must be non-negative number. If the offset is N then items from N to N + limit - 1 will be returned. If unset, defaults to 0.
limit int No The maximum number of result items to return. Note that the service defines its own default limit that cannot be overriden here. If the specified value here is above that limit, an InvalidArgument error will be thrown for the particular query in order to indicate this violation. If unset, a default limit will be automatically assigned.
compute‑total‑item‑count bool No Indicates whether the total number of resources that matched the query should be computed. This is meaningful only in cases where the number of resources that match the query could be more than the limit of result items to be returned as specified in ResourceModel.QuerySpec.limit. *NOTE:* Use this with particular caution and only when it's absolutely needed as the computation of this value could have noticeable performance overhead. If unset, defaults to false.

Example

dcli com vmware cis data legacy resourcemodel query --resource-filter-filter-type test