2.2. Search
The Administration Portal is designed to enable the management of thousands of resources, such as volumes, hosts, and clusters. When managing the storage environment, it is recommended that large lists of resources, such as volumes, are reduced to a manageable number (for example, 10). This allows tasks to be performed on a smaller list, or to select specific items on the list on which to perform a given task.
To perform a search, enter the search query (free-text or syntax-based) in the Search bar at the top of the Administration Portal. Search queries can be saved as bookmarks for future reuse (Section C.3, “Saving and Accessing Queries as Bookmarks”). This eliminates the need to re-enter a search query each time specific search results are required.
2.2.1. Search Syntax
The syntax of search queries for Red Hat Gluster Storage Console resources is as follows:
result-type: {criteria} [sortby sort_spec]
Syntax Examples
The following examples describe how search queries are used, and help you to understand how Red Hat Gluster Storage Console assists with building search queries.
Example | Result |
---|---|
Volumes: status = up | Displays a list of all volumes that are up. |
Volumes: cluster = data | Displays a list of all volumes of the cluster data. |
Events: severity > normal sortby time | Displays the list of all events whose severity is higher than Normal, sorted by time. |
2.2.1.1. Auto-Completion
The Administration Portal provides auto-completion to help you create valid and powerful search queries. As you type each part of a search query, a drop-down list of choices for the next part of the search opens below the Search bar. You can select from the list and then continue typing or selecting the next part of the search, or ignore the options and continue entering your query manually.
The following table provides examples of how Administration Portal auto-completion assists in constructing a query:
Volumes: status = down
Input | List Items Displayed | Action |
---|---|---|
v | Volumes (1 option only) |
Select
Volumes or;
Type
Volumes
|
Volumes: |
All volumes properties
| Type s |
Volumes: s | volume properties starting with s | Select status or type status |
Volumes: status | =
!=
| Select or type |
Volumes: status = | All status values | Select or type down |
2.2.1.2. Result-Type Options
The result type allows you to search for resources of any of the following types:
- Host for a list of hosts
- Event for a list of events
- Users for a list of users
- Cluster for a list of clusters
- Volumes for a list of volumes
Each type of resource has a unique set of properties and a set of other resource types that it is associated with, so each search type has a set of valid syntax combinations. However, using the auto-complete feature helps you to easily create valid queries.
2.2.1.3. Search Criteria
You can specify the search criteria after the colon in the query. The syntax of
{criteria}
is as follows:
<prop> <operator> <value>
or
<obj-type>.<prop> <operator> <value>
Examples
The following table describes the parts of the syntax:
Part | Description | Values | Example | Note |
---|---|---|---|---|
prop | The property of the searched-for resource. Can also be the property of a resource type (see obj-type ), or tag (custom tag). | See the information for each of the search types in Section 2.2.1.3.1, “Wildcards and Multiple Criteria”. | Status | -- |
obj-type | A resource type that can be associated with the searched-for resource. | See the explanation of each of the search types in Section 2.2.1.3.1, “Wildcards and Multiple Criteria”. | Users | -- |
operator | Comparison operators. |
=
!= (not equal)
>
<
>=
<=
| -- | Value options depend on obj-type. |
Value | What the expression is being compared to. |
String
Integer
Ranking
Date (formatted according to regional settings)
|
Jones
256
normal
|
|
2.2.1.3.1. Wildcards and Multiple Criteria
Wildcards can be used in the
<value>
part of the syntax for strings. For example, to find all users beginning with m, enter m*
.
You can perform a search with two criteria by using the Boolean operators
AND
and OR
. For example:
Volumes: name = m* AND status = Up
This query returns all volumes whose names begin with "m".
When two criteria are specified without
AND
or OR
, AND
is implied. AND
precedes OR
, and OR
precedes implied AND
.
2.2.1.4. Determining Sort Order
You can determine the sort order of the returned information by using
sortby
. Sort direction (asc
for ascending, desc
for descending) can be included.
For example:
events: severity > normal sortby time desc
This query returns all events whose severity is higher than Normal, sorted by time (descending order).
2.2.2. Saving Queries as Bookmarks
Search queries can be saved as bookmarks. This allows you to sort and display results lists with a single click. You can save, edit and remove bookmarks with the Bookmarks pane. See Section C.3, “Saving and Accessing Queries as Bookmarks” for details.