-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
feat(rust): ockam node show
to use dynamic data from node
#3504
feat(rust): ockam node show
to use dynamic data from node
#3504
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks great!
Thank you for another awesome contribution!
This is a good question to consider, let's do that in a separate issue. The main thing to discuss would be what information makes sense in the table like output.
Yes it should be called Address.
No, I think.
Yes. Inlets & Outlets should be there. I'll think about what else. |
Hi, I'm looking at making some improvements and adding the inlets and outlets. Thanks, Neil. |
Great, glad you noticed I was about to merge 😬 |
ockam node show
to use dynamic data from nodeockam node show
to use dynamic data from node
Additional Proposed Changes
Queries
New Example Output> ockam node create n1
> ockam node create n2
> ockam tcp-outlet create --at /node/n1 --from /service/outlet --to 127.0.0.1:5000
> ockam tcp-inlet create --at /node/n2 --from 127.0.0.1:6000 --to /node/n1/service/outlet
> ockam node list
Node:
Name: n1
Status: UP
Route To Node:
Short: /node/n1
Verbose: /dnsaddr/localhost/tcp/58434
Identity: P5f2178c1852c02f602ead6f261133f036b1e4910058cc9c6cdfcddd5605d87cd
Transports:
Transport:
Type: TCP
Mode: Listening
Address: 127.0.0.1:58434
Secure Channel Listeners:
Listener:
Address: /service/api
Inlets:
Outlets:
Outlet:
Forward Address: 127.0.0.1:5000
Address: /service/outlet
Services:
Service:
Type: vault
Address: /service/vault_service
Service:
Type: identity
Address: /service/identity_service
Service:
Type: authenticated
Address: /service/authenticated
Service:
Type: uppercase
Address: /service/uppercase
Service:
Type: echoer
Address: /service/echo
Service:
Type: credentials
Address: /service/credentials
Node:
Name: n2
Status: UP
Route To Node:
Short: /node/n2
Verbose: /dnsaddr/localhost/tcp/58441
Identity: P5f2178c1852c02f602ead6f261133f036b1e4910058cc9c6cdfcddd5605d87cd
Transports:
Transport:
Type: TCP
Mode: Listening
Address: 127.0.0.1:58441
Secure Channel Listeners:
Listener:
Address: /service/api
Inlets:
Inlet:
Listen Address: 127.0.0.1:6000
Route To Outlet: /ip4/127.0.0.1/tcp/58434/service/outlet
Outlets:
Services:
Service:
Type: vault
Address: /service/vault_service
Service:
Type: identity
Address: /service/identity_service
Service:
Type: authenticated
Address: /service/authenticated
Service:
Type: uppercase
Address: /service/uppercase
Service:
Type: echoer
Address: /service/echo
Service:
Type: credentials
Address: /service/credentials |
ockam node show
to use dynamic data from nodeockam node show
to use dynamic data from node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That node output looks pretty great! I left a couple of nits, @SanjoDeundiak feel free to merge it whenever you want!
@Mergifyio rebase |
✅ Branch has been successfully rebased |
@neil2468 looks like your commits are not signed. Could you please force-push your last commit with your signature? Here you can find more details on how to do it: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
@adrianbenavides Done! Thanks. |
Yeah, don't worry about that. We looked into that and it seems a bug on the latest nightly version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! 🚀 Thanks again @neil2468, this PR is a great improvement 🙏
Here too @neil2468, although this time looks like it's a simple conflict. I'll merge it as soon as you push your changes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for another awesome contribution! 🙏
Current Behavior
ockam node show
intends to show the status and details of a node (e.g. a list of its services). At the moment this feature uses static text and assumes things about the node (see below code).ockam node list
andockam node create
.ockam node create | show
command more dynamic. #3177.ockam/implementations/rust/ockam/ockam_command/src/node/show.rs
Lines 43 to 79 in d4dd352
Proposed Changes
ockam node show
to ask the node for details about itself and display those details.get
/node/service
to allow the CLI to get a list of services from a node.ockam_command/tests/commands/bats
to test the new feature in CI.Queries
ockam node show
okay? Instead of a verbose tree, could we output some of the information in a tabular style likedocker image ls
?In the output, should the Transport field
Payload
be renamed?The request/response
get
/node/service
builds its response fromockam_api::nodes::service::NodeManager.registry
. Is there a risk that this might leak private information from the registry to a user using the CLI?Are there other details about a node that should be added to this feature (e.g. TCP inlets and outlets)?
Example Output
Checks