Skip to content
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

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Conversation

Eslam-Nawara
Copy link
Contributor

@Eslam-Nawara Eslam-Nawara commented Sep 17, 2024

Description

add new endpoint to fetch node features

Changes

add new endpoint to fetch node features

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

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"
Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Collaborator

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 {
Copy link
Collaborator

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)
Copy link
Collaborator

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 :)

@Eslam-Nawara Eslam-Nawara merged commit 089d7c5 into main Sep 18, 2024
23 of 24 checks passed
@Eslam-Nawara Eslam-Nawara deleted the add-node-features-endpoint branch September 18, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants