Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyroute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
safeedge
pyroute2
Commits
2cba6d95
Commit
2cba6d95
authored
Apr 11, 2020
by
Peter V. Saveliev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb.report: publish filter results in cli
parent
7830d224
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
pyroute2/ndb/report.py
pyroute2/ndb/report.py
+6
-0
No files found.
pyroute2/ndb/report.py
View file @
2cba6d95
...
...
@@ -30,6 +30,7 @@ Filtering examples::
'''
import
json
from
itertools
import
chain
from
pyroute2
import
cli
from
pyroute2.common
import
basestring
MAX_REPORT_LINES
=
10000
...
...
@@ -174,6 +175,7 @@ class RecordSet(BaseRecordSet):
to make chains of filters.
'''
@
cli
.
show_result
def
transform
(
self
,
**
kwarg
):
'''
Transform record fields with a provided functions::
...
...
@@ -208,6 +210,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
@
cli
.
show_result
def
filter
(
self
,
f
=
None
,
**
kwarg
):
'''
Filter records. This function may be called in two ways. One way
...
...
@@ -241,6 +244,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
@
cli
.
show_result
def
select
(
self
,
*
argv
):
'''
Select fields from records::
...
...
@@ -256,6 +260,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
@
cli
.
show_result
def
join
(
self
,
right
,
condition
=
lambda
r1
,
r2
:
True
,
prefix
=
''
):
'''
Join two reports.
...
...
@@ -298,6 +303,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
@
cli
.
show_result
def
format
(
self
,
kind
):
'''
Convert report records into other formats. Supported formats are
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment