new apinode namespace in wwapid
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/apiconfig"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/container"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
|
||||
"github.com/hpcng/warewulf/internal/pkg/buildconfig"
|
||||
"github.com/hpcng/warewulf/internal/pkg/version"
|
||||
@@ -241,7 +241,7 @@ func (s *apiServer) NodeAdd(ctx context.Context, request *wwapiv1.NodeAddParamet
|
||||
}
|
||||
|
||||
// Add the node(s).
|
||||
err = node.NodeAdd(request)
|
||||
err = apinode.NodeAdd(request)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -264,7 +264,7 @@ func (s *apiServer) NodeDelete(ctx context.Context, request *wwapiv1.NodeDeleteP
|
||||
return response, status.Errorf(codes.InvalidArgument, "nil request.NodeNames")
|
||||
}
|
||||
|
||||
err = node.NodeDelete(request)
|
||||
err = apinode.NodeDelete(request)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.NodeSetParamet
|
||||
}
|
||||
|
||||
// Perform the NodeSet.
|
||||
err = node.NodeSet(request)
|
||||
err = apinode.NodeSet(request)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -309,7 +309,7 @@ func (s *apiServer) NodeStatus(ctx context.Context, request *wwapiv1.NodeNames)
|
||||
return response, status.Errorf(codes.InvalidArgument, "nil request")
|
||||
}
|
||||
|
||||
return node.NodeStatus(request.NodeNames)
|
||||
return apinode.NodeStatus(request.NodeNames)
|
||||
}
|
||||
|
||||
// Version returns the versions of the wwapiv1 and warewulf as well as the api
|
||||
@@ -331,7 +331,7 @@ func (s *apiServer) Version(ctx context.Context, request *emptypb.Empty) (respon
|
||||
func (s *apiServer) nodeListInternal(nodeNames []string) (response *wwapiv1.NodeListResponse, err error) {
|
||||
|
||||
var nodes []*wwapiv1.NodeInfo
|
||||
nodes, err = node.NodeList(nodeNames)
|
||||
nodes, err = apinode.NodeList(nodeNames)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package add
|
||||
|
||||
import (
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -20,5 +20,5 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
Type: SetType,
|
||||
NodeNames: args,
|
||||
}
|
||||
return node.NodeAdd(&nap)
|
||||
return apinode.NodeAdd(&nap)
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
|
||||
nodeInfo, err := node.NodeList(args)
|
||||
nodeInfo, err := apinode.NodeList(args)
|
||||
if err != nil {
|
||||
wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err)
|
||||
return
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
apinode "github.com/hpcng/warewulf/internal/pkg/api/node"
|
||||
"github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
|
||||
"github.com/hpcng/warewulf/internal/pkg/warewulfconf"
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
@@ -37,7 +37,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
rightnow := time.Now().Unix()
|
||||
|
||||
var nodeStatusResponse *wwapiv1.NodeStatusResponse
|
||||
nodeStatusResponse, err = node.NodeStatus([]string{})
|
||||
nodeStatusResponse, err = apinode.NodeStatus([]string{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user