Skip to content

Commit

Permalink
Merge pull request #100 from nokia/fix-docs
Browse files Browse the repository at this point in the history
various doc updates
  • Loading branch information
karimra authored Apr 17, 2023
2 parents 523bd90 + c8ef993 commit 0687906
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/basic_usage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The following examples demonstrate the basic usage of the `gnmic` in a scenario where the remote target runs insecure (not TLS enabled) gNMI server. The `admin:admin` credentials are used to connect to the gNMI server running at `10.1.0.11:57400` address.
The following examples demonstrate the basic usage of `gnmic` in a scenario where the remote target runs an unsecured (without TLS enabled) gNMI server. The `admin:admin` credentials are used to connect to the gNMI server running at `10.1.0.11:57400` address.

!!!info
For the complete command usage examples, refer to the ["Command reference"](cmd/capabilities.md) menu.
Expand Down
1 change: 1 addition & 0 deletions docs/cmd/capabilities.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Description

The `[cap | capabilities]` command represents the [gNMI Capabilities RPC](https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto#L51).

It is used to send a [Capability Request](https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto#L431) to the specified target(s) and expects one [Capability Response](https://github.com/openconfig/gnmi/blob/master/proto/gnmi/gnmi.proto#L440) per target.
Expand Down
3 changes: 2 additions & 1 deletion docs/deployments/deployments_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Each deployment comes with:

The [containerlab](https://containerlab.srlinux.dev/) examples come with a fabric deployed using Nokia's [SR Linux](https://learn.srlinux.dev)

If you don't find an example that fits your needs, feel free to start a discussion on [github](https://github.com/openconfig/gnmic/discussions)
If you don't find an example that fits your needs, feel free to open an issue on [github](https://github.com/openconfig/gnmic/issues/new)

### Single Instance

These examples showcase single `gnmic` instance deployments with the most commonly used outputs
Expand Down
2 changes: 2 additions & 0 deletions docs/user_guide/configuration_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ See [here](configuration_flags.md) for a complete list of the supported global a
The Env variable names are inline with the flag names as well as the configuration hierarchy.

See [here](configuration_env.md) for more details on environment variables.

## File configuration

Configuration file that `gnmic` reads must be in one of the following formats: JSON, YAML, TOML, HCL or Properties.

By default, `gnmic` will search for a file named `.gnmic.[yml/yaml, toml, json]` in the following locations and will use the first file that exists:
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/event_processors/event_extract_tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ processors:
# processor type
event-extract-tags:
value-names:
- `/(\w+)/(?P<group>\w+)/(\w+)`
- /([a-zA-Z0-9-_:]+)/(?P<group>[a-zA-Z0-9-_:]+)/([a-zA-Z0-9-_:]+)
```
=== "Event format before"
Expand Down
18 changes: 18 additions & 0 deletions docs/user_guide/event_processors/event_starlark.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,21 @@ def rate(vals):
change = vals[1][1] - vals[0][1]
return change / period
```

#### Ungroup values

The below script ungroups values part of the same event message producing an event message per value.

```python
def apply(*events):
ungrouped_events = []
for e in events:
for k, v in e.values.items():
# create a new event without any value
new_event = Event(e.name, e.timestamp, e.tags)
# add a single value to the new event
new_event.values[k] = v
# add the new event to the array
ungrouped_events.append(new_event)
return ungrouped_events
```

0 comments on commit 0687906

Please sign in to comment.