-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inspect interfaces
command, refactor cmd package
#2437
Conversation
16f277f
to
05edc31
Compare
@vista- with This just makes parsing the json a little easier so we don't have to strip out any logging |
I think the idea with json output and log messages that we used in other commands was that log messages are directed to stderr and json was printed to stdout |
…fields from JSON for stable output
…filter based on that
thanks a bunch @vista- |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2437 +/- ##
==========================================
+ Coverage 52.16% 52.41% +0.24%
==========================================
Files 171 172 +1
Lines 17342 17582 +240
==========================================
+ Hits 9047 9215 +168
- Misses 7346 7398 +52
- Partials 949 969 +20
|
This PR adds the
inspect interfaces
subcommand, which can be used to list the network interfaces of deployed nodes of a lab. The command provides information about the operational state, type, and interface alias of interfaces of lab nodes.This is a privileged Containerlab command, as it requires entering network namespaces, which only privileged users can perform.
It can either output with pretty-printed table or JSON formatting.
The
inspect
and the newinspect interfaces
command has been moved into a sub-package ofcmd
.This PR also comes with a large refactor of the
cmd
package, moving common (or shared) variables within thecommon
package insidecmd
.