-
Notifications
You must be signed in to change notification settings - Fork 14
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 new endpoint to fetch node features #2422
Conversation
client/node.go
Outdated
@@ -322,6 +320,13 @@ func (n *NodeClient) NetworkGetPublicConfig(ctx context.Context) (cfg pkg.Public | |||
return | |||
} | |||
|
|||
func (n *NodeClient) NetworkGetNodeFeatures(ctx context.Context) (feat pkg.NodeFeatures, err error) { | |||
const cmd = "zos.network.node_features_get" |
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.
Why on the zos.network? I assumed it will be on zos.system.node_features
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.
since this is related to netowrkd-light I assumed it would be on network, but can move it to be system.node_features
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.
My reasoning is as a user I should ask the node what version do you have? (which is zos.system.version
) or what features are enabled on the node so zos.system.node_features_get
pkg/network.go
Outdated
@@ -257,6 +260,32 @@ type PublicConfig struct { | |||
Domain string `json:"domain"` | |||
} | |||
|
|||
type NodeFeatures struct { |
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.
NodeFeatures should have been a slice of a Feature []Feature and that feature is a typed string that can be any of `zdb, zmachine, .. etc)
pkg/monitor.go
Outdated
// SystemMonitor interface (provided by noded) | ||
type SystemMonitor interface { | ||
NodeID() uint32 | ||
Memory(ctx context.Context) <-chan VirtualMemoryStat | ||
CPU(ctx context.Context) <-chan TimesStat | ||
Disks(ctx context.Context) <-chan DisksIOCountersStat | ||
Nics(ctx context.Context) <-chan NicsIOCounterStat | ||
GetNodeFeatures() ([]NodeFeature, error) |
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.
About the suggested interface, will this ever fail? worst case would be an empty slice :)
Description
add new endpoint to fetch node features
Changes
add new endpoint to fetch node features
Related Issues
Checklist