new apinode namespace in wwapid

This commit is contained in:
Christian Goll
2022-07-13 16:05:16 +02:00
parent 14b86a5e8e
commit d10b4c352f
4 changed files with 12 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/hpcng/warewulf/internal/pkg/api/apiconfig" "github.com/hpcng/warewulf/internal/pkg/api/apiconfig"
"github.com/hpcng/warewulf/internal/pkg/api/container" "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/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/buildconfig"
"github.com/hpcng/warewulf/internal/pkg/version" "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). // Add the node(s).
err = node.NodeAdd(request) err = apinode.NodeAdd(request)
if err != nil { if err != nil {
return return
} }
@@ -264,7 +264,7 @@ func (s *apiServer) NodeDelete(ctx context.Context, request *wwapiv1.NodeDeleteP
return response, status.Errorf(codes.InvalidArgument, "nil request.NodeNames") return response, status.Errorf(codes.InvalidArgument, "nil request.NodeNames")
} }
err = node.NodeDelete(request) err = apinode.NodeDelete(request)
return return
} }
@@ -293,7 +293,7 @@ func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.NodeSetParamet
} }
// Perform the NodeSet. // Perform the NodeSet.
err = node.NodeSet(request) err = apinode.NodeSet(request)
if err != nil { if err != nil {
return return
} }
@@ -309,7 +309,7 @@ func (s *apiServer) NodeStatus(ctx context.Context, request *wwapiv1.NodeNames)
return response, status.Errorf(codes.InvalidArgument, "nil request") 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 // 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) { func (s *apiServer) nodeListInternal(nodeNames []string) (response *wwapiv1.NodeListResponse, err error) {
var nodes []*wwapiv1.NodeInfo var nodes []*wwapiv1.NodeInfo
nodes, err = node.NodeList(nodeNames) nodes, err = apinode.NodeList(nodeNames)
if err != nil { if err != nil {
return return
} }

View File

@@ -1,7 +1,7 @@
package add package add
import ( 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/hpcng/warewulf/internal/pkg/api/routes/wwapiv1"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@@ -20,5 +20,5 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
Type: SetType, Type: SetType,
NodeNames: args, NodeNames: args,
} }
return node.NodeAdd(&nap) return apinode.NodeAdd(&nap)
} }

View File

@@ -5,14 +5,14 @@ import (
"sort" "sort"
"strings" "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/hpcng/warewulf/internal/pkg/wwlog"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func CobraRunE(cmd *cobra.Command, args []string) (err error) { func CobraRunE(cmd *cobra.Command, args []string) (err error) {
nodeInfo, err := node.NodeList(args) nodeInfo, err := apinode.NodeList(args)
if err != nil { if err != nil {
wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err) wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err)
return return

View File

@@ -8,7 +8,7 @@ import (
"time" "time"
"github.com/fatih/color" "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/api/routes/wwapiv1"
"github.com/hpcng/warewulf/internal/pkg/warewulfconf" "github.com/hpcng/warewulf/internal/pkg/warewulfconf"
"github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/hpcng/warewulf/internal/pkg/wwlog"
@@ -37,7 +37,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
rightnow := time.Now().Unix() rightnow := time.Now().Unix()
var nodeStatusResponse *wwapiv1.NodeStatusResponse var nodeStatusResponse *wwapiv1.NodeStatusResponse
nodeStatusResponse, err = node.NodeStatus([]string{}) nodeStatusResponse, err = apinode.NodeStatus([]string{})
if err != nil { if err != nil {
return err return err
} }