Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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::
...
@@ -30,6 +30,7 @@ Filtering examples::
'''
'''
import
json
import
json
from
itertools
import
chain
from
itertools
import
chain
from
pyroute2
import
cli
from
pyroute2.common
import
basestring
from
pyroute2.common
import
basestring
MAX_REPORT_LINES
=
10000
MAX_REPORT_LINES
=
10000
...
@@ -174,6 +175,7 @@ class RecordSet(BaseRecordSet):
...
@@ -174,6 +175,7 @@ class RecordSet(BaseRecordSet):
to make chains of filters.
to make chains of filters.
'''
'''
@
cli
.
show_result
def
transform
(
self
,
**
kwarg
):
def
transform
(
self
,
**
kwarg
):
'''
'''
Transform record fields with a provided functions::
Transform record fields with a provided functions::
...
@@ -208,6 +210,7 @@ class RecordSet(BaseRecordSet):
...
@@ -208,6 +210,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
return
RecordSet
(
g
())
@
cli
.
show_result
def
filter
(
self
,
f
=
None
,
**
kwarg
):
def
filter
(
self
,
f
=
None
,
**
kwarg
):
'''
'''
Filter records. This function may be called in two ways. One way
Filter records. This function may be called in two ways. One way
...
@@ -241,6 +244,7 @@ class RecordSet(BaseRecordSet):
...
@@ -241,6 +244,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
return
RecordSet
(
g
())
@
cli
.
show_result
def
select
(
self
,
*
argv
):
def
select
(
self
,
*
argv
):
'''
'''
Select fields from records::
Select fields from records::
...
@@ -256,6 +260,7 @@ class RecordSet(BaseRecordSet):
...
@@ -256,6 +260,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
return
RecordSet
(
g
())
@
cli
.
show_result
def
join
(
self
,
right
,
condition
=
lambda
r1
,
r2
:
True
,
prefix
=
''
):
def
join
(
self
,
right
,
condition
=
lambda
r1
,
r2
:
True
,
prefix
=
''
):
'''
'''
Join two reports.
Join two reports.
...
@@ -298,6 +303,7 @@ class RecordSet(BaseRecordSet):
...
@@ -298,6 +303,7 @@ class RecordSet(BaseRecordSet):
return
RecordSet
(
g
())
return
RecordSet
(
g
())
@
cli
.
show_result
def
format
(
self
,
kind
):
def
format
(
self
,
kind
):
'''
'''
Convert report records into other formats. Supported formats are
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