The Service Mapping query type is a pattern consisting of classes and relationships between those classes. After you build the pattern and run the query, the query returns all the Service Mapping services that contain that pattern.
Before you begin
Role required: cmdb_query_builder_read to only view and run saved queries, and cmdb_query_builder to create and save queries, modify saved queries, and run queries.
Authorized users can update and delete a
query created by another user.
About this task
Build the query by dragging the CI classes that you want to include in the query,
dropping them as nodes on the canvas, and then defining relationship properties
between them. For every class node in the query, you can filter on its attributes to
narrow down the results to a specific set of CIs of that class or to a single
specific CI. You can also select which property columns appear in the query
results.
As you step through building a query, list options and other user interface elements
of the CMDB Query Builder, are dynamically filtered as appropriate to your
selections.
See Example queries for a step-by-step walk through of building a Service Mapping query in the CMDB Query Builder.
Procedure
-
Navigate to .
-
On the CMDB Query Builder page do either of the
following:
-
Select Create new.
-
Enter a Name.
-
Select Service Mapping Query as the Query type.
-
Select Create.
-
Select a widget of a saved query to continue building an existing query. Search for a saved query first if needed.
-
Point to the upper right corner of a saved query widget.
-
Select the Duplicate Query icon to edit a copy of a saved query.
The new query's default name contains the string 'copy'.
-
On the canvas, you can do any of the following:
- Add CI classes to the query: Select classes from the CMDB
Classes hierarchy list and drag them to the canvas.
- Add connections (relationships) between two nodes on the canvas:
- On the first node in the relationship, select the small square at
the center of the right side.
- On the second node in the relationship, select the small square
at the center of the left side to create the connection.
- In Connection Properties on the
right-side bar, configure the following (select the connection
line if necessary):
Table 1. Relationship UI Notations
| Notation |
Description |
| Dashed line |
A relationship in a Service Mapping query. |
- Add filters to a class node: Apply filters to narrow down a class to a
specific set of CIs or to a single specific CI.
- Point to the node to add a filter to, and then select the
Apply filters icon that pops up
above the node.
- In the Filters section, add attribute and related list conditions.
- Close the Filters section.
For example: Add a filter for business criticality to query for
businesses that are 'most critical'.
Select Applied
Filters in the right-side bar to view all filters
for each node on the canvas.
- Add And/Or operators to the query:
- Connect one node to two other nodes.
- Select the And box that appears on the
connection line, to toggle between the
And and the Or
operators.
For example C1 is Tomcat WAR, C2 is Linux Server, and C3 is
Windows Server. Query for all Tomcat WAR CIs which are connected
either to Linux Server Or to a Windows Server.
- Add property columns for a node, to display in the query
results:
Note: For a relationship, the query results display the
parent, child, and
type columns. You cannot add any other
columns from the [cmdb_rel_ci] table.
- Select Properties in the right-side
pane.
- Select a node once or twice, so that the node's Report Columns
section appears in the right-side bar, and then select
Add Columns.
- Select properties and then select outside the properties list to
close it.
- Select columns and add filters that will be applied to the resulting set
of services:
- Select Properties in the right-side bar,
and then select an empty space on the canvas to ensure that
nothing is selected.
- Select Add Columns at the bottom of the
right-side bar and select columns to add. Select outside the
columns list to close it.
- Select the Apply Service Mapping Query
Filters icon at the top of the canvas and add
filters.
- Inverse the entire query and search for all Service Mapping services that do not include the query pattern: Select a node once or twice so that Query Properties appear in the right-side bar. In the Metadata section, toggle Services
Including This Pattern to enable or disable the option.
- Add a search tag that can then be used as a search criteria for saved
queries:
- Select the Add Tags icon at the top of the
canvas.
- Select Add Tag and in the Query
Tags dialog box enter one or more tag
strings.
- Select the Add Tags icon again to close
the Query Tags dialog box.
-
Select Save.
On the Saved Queries tab, point to a saved query
widget and select Query Information to view query
details such as the query type, last update date, and the query
schedules.
What to do next
Select Run.
The query results pane displays only the first 100 results of the query.
- Select Load More Results to display the next
set of 100 results.
- Select Load All Results to display the rest of
the query results, up to the number specified by the glide.cmdb.query.max_results_limit system property
(10,000 by default).
Select a CI to open its CI form, and on the CI form select Open in Workspace to view CI health in CMDB Workspace or in Service Graph Workspace. This operation requires the sn_cmdb_user (CMDB user) role.
Note: When a query is running, wait for it to complete or to time out before
opening or running another query.
- Modify Query Builder settings: Select the Settings icon to open the Query Builder Settings dialog box.
- Copy and share the URL of a saved query with users that have access to the CMDB
Query Builder. Pasting the shared URL in a new internet browser window, directly
opens the saved query in the CMDB Query Builder.
- Create a report in CMDB Query Builder.
- Create a schedule to run the query at a future
time, and to email the results to interested parties.
- Export query results:
Export query results that are visible: Select the Query
Results context menu and select Export. Even if the
Load More Results button is visible, indicating
that there are additional query results, only the results that are visible
are exported.
- Export and import a CMDB query to port a query definition between
instances.
- Populate a CMDB group
using the saved query.
- Delete a CMDB query.