Skip to content

Commit

Permalink
aadd Admin reboot and restart endpoints to node client
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Nov 14, 2024
1 parent 02476a5 commit fbdd2a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,20 @@ func (n *NodeClient) NetworkListInterfaces(ctx context.Context) (result map[stri
return
}

// AdminRebootNode return all physical devices on a node
func (n *NodeClient) AdminRebootNode(ctx context.Context) error {
const cmd = "zos.admin.reboot"

return n.bus.Call(ctx, n.nodeTwin, cmd, nil, nil)
}

// AdminRestartService return all physical devices on a node
func (n *NodeClient) AdminRestartService(ctx context.Context, service string) error {
const cmd = "zos.admin.restart"

return n.bus.Call(ctx, n.nodeTwin, cmd, service, nil)
}

// NetworkListAllInterfaces return all physical devices on a node
func (n *NodeClient) NetworkListAllInterfaces(ctx context.Context) (result map[string]Interface, err error) {
const cmd = "zos.network.admin.interfaces"
Expand Down

0 comments on commit fbdd2a0

Please sign in to comment.