Skip to content

Commit

Permalink
9.0.11-SNAPSHOT -> 9.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mershad-manesh committed Dec 12, 2023
2 parents 709057a + 6609559 commit 72fd6d6
Show file tree
Hide file tree
Showing 28 changed files with 1,555 additions and 914 deletions.
4 changes: 2 additions & 2 deletions .github/assign-by-files.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"**/*.adoc":
- Bonrob2
- indigo423

"docs/**/*":
- Bonrob2
- indigo423
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### v9.0.11

Grafana Plugin for OpenNMS version 9.0.11 release contains a bug fix and enhancements.

* [OPG-468](https://opennms.atlassian.net/browse/OPG-468) Add \`nodeId\(\)\` query to datasources
* [OPG-469](https://opennms.atlassian.net/browse/OPG-469) Alarm Panel Columns Resizing
* [OPG-470](https://opennms.atlassian.net/browse/OPG-470) Alarm Panel User Feedback
* [OPG-472](https://opennms.atlassian.net/browse/OPG-472) Documentation for OPG nodeFilter labelFormat and valueFormat

### v9.0.10

Grafana Plugin for OpenNMS version 9.0.10 release contains a bug fix and an enhancement.
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '9'
title: Plugin for Grafana
asciidoc:
attributes:
full-display-version: '9.0.10'
full-display-version: '9.0.11'
grafana-version-required: '9.x'
grafana-version-tested: '9.0'
node-js-build-version: '16.x'
Expand Down
33 changes: 32 additions & 1 deletion docs/modules/datasources/pages/entity_datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,50 @@ nodeFilter(location='Default')
nodeFilter(location='$location')
----

=== nodeFilter(<filterQuery>)
=== nodeFilter(<filterQuery>[,labelFormat[,valueFormat]])

The `nodeFilter()` query returns a list of nodes that match the given filter expression.

The filter expression must be made up of an existing node attribute and its corresponding value.
Separate multiple filter expressions with an ampersand (`&`) (for example, `<attribute1>=<value1> & <attribute2>=<value2> & ...`).
The node's value can be a constant or a variable.

[[ds-nodefilter-label-value-formats]]
`labelFormat` and `valueFormat` attributes can optionally be added to format the `label` (what is displayed with the variable selection dropdown boxes) and the `value` (the value that is used when referenced within Grafana).
By default, Entity Datasource variables default to the node `id` for both of these values, however any of the following may be specified:

[caption=]
.`nodeFilter()` label and value formats
[cols="1,3"]
|===
| Format | Description

| id
| The node database id (a numeric value)

| label
| The node label

| id:label
| The node id and label

| label:id
| The node label and id

| fs:fid
| The node foreign source and foreign id

| fs:label
| The node foreign source and label

|===

.Example expressions using `nodeFilter()`
[source,]
----
nodeFilter(<node_attribute>='<value>')
nodeFilter(location='$location' & label='localhost')
nodeFilter(labelFormat=label,valueFormat=id,location='$location')
----

For more information about filters, see https://docs.opennms.com/horizon/latest/reference/configuration/filters/filters.html[Filters] in the main OpenNMS documentation.
Expand Down
11 changes: 9 additions & 2 deletions docs/modules/datasources/pages/performance_datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ For an example of a variable query, see <<panel_configuration:dynamic-dashboard.
The `locations()` query returns a list of all available node locations.
You can create a variable with a `locations()` query and use that variable inside a `nodeFilter()` query to filter the number of nodes displayed by location.

.Example expressions using `nodeFilter()`
.Example `locations()` expressions using `nodeFilter()`
[source,]
----
nodeFilter(location='Default')
nodeFilter(location='$location') <1>
----
<1> This example assumes you have a `location` variable with a `locations()` query.

=== nodeFilter(<filterQuery>)
=== nodeFilter(<filterQuery>[,labelFormat[,valueFormat]])

The `nodeFilter()` query returns a list of nodes which match the given filter expression.

Expand All @@ -187,10 +187,12 @@ The `nodeFilter()` query returns a list of nodes which match the given filter ex
nodeFilter(catincProduction & catincLinux) <1>
nodeFilter(location='Default' & catincProduction & catincSNMP) <2>
nodeFilter() <3>
nodeFilter(labelFormat=id:label,valueFormat=id) <4>
----
<1> Returns the set of nodes that are in the `Production` and `Linux` categories.
<2> Returns the set of nodes that are in the `SNMP` and `Production` categories and the `Default` location.
<3> Returns all nodes in inventory.
<4> Returns all nodes in inventory, with label and value formatting applied.

Only one argument is available for the `nodeFilter()` query:

Expand All @@ -203,6 +205,11 @@ Only one argument is available for the `nodeFilter()` query:
If omitted, all nodes are returned.
|===

`labelFormat` and `valueFormat` attributes can be specified.
Please refer to the <<datasources:entity_datasource.adoc#ds-nodefilter-label-value-formats, Entity Datasource documentation>> for more information on these options.
By default, Performance Datasource variables default the `labelFormat` to `label` and the `value` to `fs:fid` if the node is part of a requisition, otherwise the `value` will be the node `id.`


=== nodeResources(<nodeId>[,textProperty[,resourceType[,regexFilter]]])

The `nodeResources()` query returns a list of resource IDs that are available on the specified node.
Expand Down
Loading

0 comments on commit 72fd6d6

Please sign in to comment.