From ffef31969ed63ff91bbb067667e51a14bea22715 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 15 Dec 2023 15:40:51 +0100 Subject: [PATCH] api changes for use without NodeInfo Signed-off-by: Christian Goll --- internal/app/api/wwapid/wwapid.go | 6 +- .../pkg/api/apiconfig/container/container.go | 35 +- internal/pkg/api/container/container.go | 59 +- internal/pkg/api/node/add.go | 77 +++ internal/pkg/api/node/delete.go | 106 +++ internal/pkg/api/node/edit.go | 2 +- internal/pkg/api/node/list.go | 63 +- internal/pkg/api/node/node.go | 400 ----------- internal/pkg/api/node/set.go | 140 ++++ internal/pkg/api/profile/add.go | 42 ++ internal/pkg/api/profile/delete.go | 52 +- internal/pkg/api/profile/edit.go | 4 +- internal/pkg/api/profile/list.go | 5 +- internal/pkg/api/profile/profile.go | 197 ------ internal/pkg/api/profile/set.go | 139 ++++ internal/pkg/api/routes/v1/routes.proto | 29 +- internal/pkg/api/routes/wwapiv1/routes.pb.go | 646 ++++++++---------- .../pkg/api/routes/wwapiv1/routes.pb.gw.go | 4 +- .../pkg/api/routes/wwapiv1/routes_grpc.pb.go | 12 +- 19 files changed, 912 insertions(+), 1106 deletions(-) create mode 100644 internal/pkg/api/node/add.go create mode 100644 internal/pkg/api/node/delete.go delete mode 100644 internal/pkg/api/node/node.go create mode 100644 internal/pkg/api/node/set.go create mode 100644 internal/pkg/api/profile/add.go delete mode 100644 internal/pkg/api/profile/profile.go create mode 100644 internal/pkg/api/profile/set.go diff --git a/internal/app/api/wwapid/wwapid.go b/internal/app/api/wwapid/wwapid.go index 0ae4c35b..055cff77 100644 --- a/internal/app/api/wwapid/wwapid.go +++ b/internal/app/api/wwapid/wwapid.go @@ -293,14 +293,14 @@ func (s *apiServer) NodeList(ctx context.Context, request *wwapiv1.NodeNames) (r } // NodeSet updates fields for zero or more nodes and returns the updated nodes. -func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.NodeSetParameter) (response *wwapiv1.NodeListResponse, err error) { +func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.ConfSetParameter) (response *wwapiv1.NodeListResponse, err error) { // Parameter checks. if request == nil { return response, status.Errorf(codes.InvalidArgument, "nil request") } - if request.NodeNames == nil { + if request.ConfList == nil { return response, status.Errorf(codes.InvalidArgument, "nil request.NodeNames") } @@ -311,7 +311,7 @@ func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.NodeSetParamet } // Return the updated nodes as per REST. - return s.nodeListInternal(request.NodeNames) + return s.nodeListInternal(request.ConfList) } func (s *apiServer) NodeStatus(ctx context.Context, request *wwapiv1.NodeNames) (response *wwapiv1.NodeStatusResponse, err error) { diff --git a/internal/pkg/api/apiconfig/container/container.go b/internal/pkg/api/apiconfig/container/container.go index 3ca6de12..0c21f3bf 100644 --- a/internal/pkg/api/apiconfig/container/container.go +++ b/internal/pkg/api/apiconfig/container/container.go @@ -66,14 +66,10 @@ func ContainerBuild(cbp *wwapiv1.ContainerBuildParameter) (err error) { //TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map profiles, _ := nodeDB.FindAllProfiles() for _, profile := range profiles { - wwlog.Debug("Looking for profile default: %s", profile.Id.Get()) - if profile.Id.Get() == "default" { + wwlog.Debug("Looking for profile default: %s", profile.Id()) + if profile.Id() == "default" { wwlog.Debug("Found profile default, setting container name to: %s", containers[0]) - profile.ContainerName.Set(containers[0]) - err := nodeDB.ProfileUpdate(profile) - if err != nil { - return errors.Wrap(err, "failed to update node profile") - } + profile.ContainerName = containers[0] } } // TODO: Need a wrapper and flock around this. Sometimes we restart warewulfd and sometimes we don't. @@ -81,7 +77,11 @@ func ContainerBuild(cbp *wwapiv1.ContainerBuildParameter) (err error) { if err != nil { return errors.Wrap(err, "failed to persist nodedb") } - fmt.Printf("Set default profile to container: %s\n", containers[0]) + err = warewulfd.DaemonReload() + if err != nil { + return errors.Wrap(err, "failed to reload warewulfd") + } + wwlog.Info("Set default profile to container: %s", containers[0]) } } return @@ -109,7 +109,7 @@ ARG_LOOP: //_, arg := range args { containerName := cdp.ContainerNames[i] for _, n := range nodes { - if n.ContainerName.Get() == containerName { + if n.ContainerName == containerName { wwlog.Error("Container is configured for nodes, skipping: %s", containerName) continue ARG_LOOP } @@ -211,15 +211,10 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin //TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map profiles, _ := nodeDB.FindAllProfiles() for _, profile := range profiles { - wwlog.Debug("Looking for profile default: %s", profile.Id.Get()) - if profile.Id.Get() == "default" { + wwlog.Debug("Looking for profile default: %s", profile.Id()) + if profile.Id() == "default" { wwlog.Debug("Found profile default, setting container name to: %s", cip.Name) - profile.ContainerName.Set(cip.Name) - err = nodeDB.ProfileUpdate(profile) - if err != nil { - err = errors.Wrap(err, "failed to update profile") - return - } + profile.ContainerName = cip.Name } } // TODO: We need this in a function with a flock around it. @@ -264,7 +259,7 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) { nodemap := make(map[string]int) for _, n := range nodes { - nodemap[n.ContainerName.Get()]++ + nodemap[n.ContainerName]++ } for _, source := range sources { @@ -307,9 +302,9 @@ func ContainerShow(csp *wwapiv1.ContainerShowParameter) (response *wwapiv1.Conta var nodeList []string for _, n := range nodes { - if n.ContainerName.Get() == containerName { + if n.ContainerName == containerName { - nodeList = append(nodeList, n.Id.Get()) + nodeList = append(nodeList, n.Id()) } } diff --git a/internal/pkg/api/container/container.go b/internal/pkg/api/container/container.go index 325a0c5f..64a29628 100644 --- a/internal/pkg/api/container/container.go +++ b/internal/pkg/api/container/container.go @@ -21,15 +21,15 @@ import ( func ContainerCopy(cbp *wwapiv1.ContainerCopyParameter) (err error) { if cbp == nil { - return fmt.Errorf("ContainerCopyParameter is nil") + return fmt.Errorf("containerCopyParameter is nil") } if !container.DoesSourceExist(cbp.ContainerSource) { - return fmt.Errorf("Container %s does not exists.", cbp.ContainerSource) + return fmt.Errorf("container %s does not exists.", cbp.ContainerSource) } if !container.ValidName(cbp.ContainerDestination) { - return fmt.Errorf("Container name contains illegal characters : %s", cbp.ContainerDestination) + return fmt.Errorf("container name contains illegal characters : %s", cbp.ContainerDestination) } if container.DoesSourceExist(cbp.ContainerDestination) { @@ -92,14 +92,10 @@ func ContainerBuild(cbp *wwapiv1.ContainerBuildParameter) (err error) { // TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map profiles, _ := nodeDB.FindAllProfiles() for _, profile := range profiles { - wwlog.Debug("Looking for profile default: %s", profile.Id.Get()) - if profile.Id.Get() == "default" { + wwlog.Debug("Looking for profile default: %s", profile.Id()) + if profile.Id() == "default" { wwlog.Debug("Found profile default, setting container name to: %s", containers[0]) - profile.ContainerName.Set(containers[0]) - err := nodeDB.ProfileUpdate(profile) - if err != nil { - return errors.Wrap(err, "failed to update node profile") - } + profile.ContainerName = containers[0] } } // TODO: Need a wrapper and flock around this. Sometimes we restart warewulfd and sometimes we don't. @@ -133,7 +129,7 @@ ARG_LOOP: //_, arg := range args { containerName := cdp.ContainerNames[i] for _, n := range nodes { - if n.ContainerName.Get() == containerName { + if n.ContainerName == containerName { wwlog.Error("Container is configured for nodes, skipping: %s", containerName) continue ARG_LOOP } @@ -253,15 +249,10 @@ func ContainerImport(cip *wwapiv1.ContainerImportParameter) (containerName strin // TODO: Don't loop through profiles, instead have a nodeDB function that goes directly to the map profiles, _ := nodeDB.FindAllProfiles() for _, profile := range profiles { - wwlog.Debug("Looking for profile default: %s", profile.Id.Get()) - if profile.Id.Get() == "default" { + wwlog.Debug("Looking for profile default: %s", profile.Id()) + if profile.Id() == "default" { wwlog.Debug("Found profile default, setting container name to: %s", cip.Name) - profile.ContainerName.Set(cip.Name) - err = nodeDB.ProfileUpdate(profile) - if err != nil { - err = errors.Wrap(err, "failed to update profile") - return - } + profile.ContainerName = cip.Name } } // TODO: We need this in a function with a flock around it. @@ -306,7 +297,7 @@ func ContainerList() (containerInfo []*wwapiv1.ContainerInfo, err error) { nodemap := make(map[string]int) for _, n := range nodes { - nodemap[n.ContainerName.Get()]++ + nodemap[n.ContainerName]++ } for _, source := range sources { @@ -383,8 +374,8 @@ func ContainerShow(csp *wwapiv1.ContainerShowParameter) (response *wwapiv1.Conta var nodeList []string for _, n := range nodes { - if n.ContainerName.Get() == containerName { - nodeList = append(nodeList, n.Id.Get()) + if n.ContainerName == containerName { + nodeList = append(nodeList, n.Id()) } } @@ -429,11 +420,13 @@ func ContainerRename(crp *wwapiv1.ContainerRenameParameter) (err error) { return err } for _, node := range nodes { - if node.ContainerName.Get() == crp.ContainerName { - node.ContainerName.Set(crp.TargetName) - if err := nodeDB.NodeUpdate(node); err != nil { - return err - } + if node.ContainerName == crp.ContainerName { + node.ContainerName = crp.TargetName + /* + if err := nodeDB.NodeUpdate(node); err != nil { + return err + } + */ } } @@ -442,11 +435,13 @@ func ContainerRename(crp *wwapiv1.ContainerRenameParameter) (err error) { return err } for _, profile := range profiles { - if profile.ContainerName.Get() == crp.ContainerName { - profile.ContainerName.Set(crp.TargetName) - if err := nodeDB.ProfileUpdate(profile); err != nil { - return err - } + if profile.ContainerName == crp.ContainerName { + profile.ContainerName = crp.TargetName + /* + if err := nodeDB.ProfileUpdate(profile); err != nil { + return err + } + */ } } diff --git a/internal/pkg/api/node/add.go b/internal/pkg/api/node/add.go new file mode 100644 index 00000000..0ba20630 --- /dev/null +++ b/internal/pkg/api/node/add.go @@ -0,0 +1,77 @@ +package apinode + +import ( + "encoding/hex" + "fmt" + "net" + + "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" + "github.com/hpcng/warewulf/internal/pkg/node" + "github.com/hpcng/warewulf/internal/pkg/util" + "github.com/hpcng/warewulf/internal/pkg/warewulfd" + "github.com/hpcng/warewulf/internal/pkg/wwlog" + "github.com/hpcng/warewulf/pkg/hostlist" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" +) + +// NodeAdd adds nodes for management by Warewulf. +func NodeAdd(nap *wwapiv1.NodeAddParameter) (err error) { + + if nap == nil { + return fmt.Errorf("NodeAddParameter is nil") + } + + nodeDB, err := node.New() + if err != nil { + return errors.Wrap(err, "failed to open node database") + } + dbHash := nodeDB.Hash() + if hex.EncodeToString(dbHash[:]) != nap.Hash && !nap.Force { + return fmt.Errorf("got wrong hash, not modifying node database") + } + node_args := hostlist.Expand(nap.NodeNames) + var ipv4, ipmiaddr net.IP + for _, a := range node_args { + n, err := nodeDB.AddNode(a) + if err != nil { + return errors.Wrap(err, "failed to add node") + } + err = yaml.Unmarshal([]byte(nap.NodeConfYaml), &n) + if err != nil { + return errors.Wrap(err, "Failed to decode nodeConf") + } + wwlog.Info("Added node: %s:", a) + for _, dev := range n.NetDevs { + if !ipv4.IsUnspecified() && ipv4 != nil { + // if more nodes are added increment IPv4 address + ipv4 = util.IncrementIPv4(ipv4, 1) + wwlog.Verbose("Incremented IP addr to %s", ipv4) + dev.Ipaddr = ipv4 + + } else if !dev.Ipaddr.IsUnspecified() { + ipv4 = dev.Ipaddr + } + } + if n.Ipmi != nil { + if !ipmiaddr.IsUnspecified() && ipmiaddr != nil { + ipmiaddr = util.IncrementIPv4(ipmiaddr, 1) + wwlog.Verbose("Incremented ipmi IP addr to %s", ipmiaddr) + n.Ipmi.Ipaddr = ipmiaddr + } else if !n.Ipmi.Ipaddr.IsUnspecified() { + ipmiaddr = n.Ipmi.Ipaddr + } + } + } + + err = nodeDB.Persist() + if err != nil { + return errors.Wrap(err, "failed to persist new node") + } + + err = warewulfd.DaemonReload() + if err != nil { + return errors.Wrap(err, "failed to reload warewulf daemon") + } + return +} diff --git a/internal/pkg/api/node/delete.go b/internal/pkg/api/node/delete.go new file mode 100644 index 00000000..7738c18f --- /dev/null +++ b/internal/pkg/api/node/delete.go @@ -0,0 +1,106 @@ +package apinode + +import ( + "encoding/hex" + "fmt" + "os" + + "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" + "github.com/hpcng/warewulf/internal/pkg/node" + "github.com/hpcng/warewulf/internal/pkg/warewulfd" + "github.com/hpcng/warewulf/internal/pkg/wwlog" + "github.com/hpcng/warewulf/pkg/hostlist" + "github.com/pkg/errors" +) + +// NodeDelete adds nodes for management by Warewulf. +func NodeDelete(ndp *wwapiv1.NodeDeleteParameter) (err error) { + + var nodeList []node.NodeConf + nodeList, err = NodeDeleteParameterCheck(ndp, false) + if err != nil { + return + } + + nodeDB, err := node.New() + if err != nil { + wwlog.Error("Failed to open node database: %s", err) + return + } + dbHash := nodeDB.Hash() + if hex.EncodeToString(dbHash[:]) != ndp.Hash && !ndp.Force { + return fmt.Errorf("got wrong hash, not modifying node database") + } + + for _, n := range nodeList { + err := nodeDB.DelNode(n.Id()) + if err != nil { + wwlog.Error("%s", err) + } else { + //count++ + wwlog.Verbose("Deleting node: %s\n", n.Id()) + } + } + + err = nodeDB.Persist() + if err != nil { + return errors.Wrap(err, "failed to persist nodedb") + } + + err = warewulfd.DaemonReload() + if err != nil { + return errors.Wrap(err, "failed to reload warewulf daemon") + } + return +} + +// NodeDeleteParameterCheck does error checking on NodeDeleteParameter. +// Output to the console if console is true. +// Returns the nodes to delete. +func NodeDeleteParameterCheck(ndp *wwapiv1.NodeDeleteParameter, console bool) (nodeList []node.NodeConf, err error) { + + if ndp == nil { + err = fmt.Errorf("NodeDeleteParameter is nil") + return + } + + nodeDB, err := node.New() + if err != nil { + wwlog.Error("Failed to open node database: %s", err) + return + } + dbHash := nodeDB.Hash() + if hex.EncodeToString(dbHash[:]) != ndp.Hash && !ndp.Force { + wwlog.Debug("got hash: %s", ndp.Hash) + wwlog.Debug("actual hash: %s", hex.EncodeToString(dbHash[:])) + err = fmt.Errorf("got wrong hash, not modifying node database") + return + } + + nodes, err := nodeDB.FindAllNodes() + if err != nil { + wwlog.Error("Could not get node list: %s", err) + return + } + + node_args := hostlist.Expand(ndp.NodeNames) + + for _, r := range node_args { + var match bool + for _, n := range nodes { + if n.Id() == r { + nodeList = append(nodeList, n) + match = true + } + } + + if !match { + fmt.Fprintf(os.Stderr, "ERROR: No match for node: %s\n", r) + } + } + + if len(nodeList) == 0 { + fmt.Printf("No nodes found\n") + } + return +} diff --git a/internal/pkg/api/node/edit.go b/internal/pkg/api/node/edit.go index f1d15a7c..05d96ffd 100644 --- a/internal/pkg/api/node/edit.go +++ b/internal/pkg/api/node/edit.go @@ -39,7 +39,7 @@ func FilteredNodes(nodeList *wwapiv1.NodeList) *wwapiv1.NodeYaml { os.Exit(1) } nodeMap := nodeDB.Nodes - nodeMap = node.FilterMapByName(nodeMap, nodeList.Output) + nodeMap = node.FilterNodesByName(nodeMap, nodeList.Output) buffer, _ := yaml.Marshal(nodeMap) retVal := wwapiv1.NodeYaml{ NodeConfMapYaml: string(buffer), diff --git a/internal/pkg/api/node/list.go b/internal/pkg/api/node/list.go index 2ffa66d2..3e098741 100644 --- a/internal/pkg/api/node/list.go +++ b/internal/pkg/api/node/list.go @@ -39,7 +39,7 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro } sort.Strings(netNames) nodeList.Output = append(nodeList.Output, - fmt.Sprintf("%s:=:%s:=:%s", n.Id.Print(), n.Profiles.Print(), strings.Join(netNames, ", "))) + fmt.Sprintf("%s:=:%s:=:%s", n.Id(), n.Profiles, strings.Join(netNames, ", "))) } } else if nodeGet.Type == wwapiv1.GetNodeList_Network { nodeList.Output = append(nodeList.Output, @@ -48,14 +48,15 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro if len(n.NetDevs) > 0 { for name := range n.NetDevs { nodeList.Output = append(nodeList.Output, - fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id.Print(), name, - n.NetDevs[name].Hwaddr.Print(), - n.NetDevs[name].Ipaddr.Print(), - n.NetDevs[name].Gateway.Print(), - n.NetDevs[name].Device.Print())) + fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id(), name, + n.NetDevs[name].Hwaddr, + n.NetDevs[name].Ipaddr, + n.NetDevs[name].Gateway, + n.NetDevs[name].Device)) } } else { - fmt.Printf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id.Print(), "--", "--", "--", "--", "--") + nodeList.Output = append(nodeList.Output, + fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id(), "--", "--", "--", "--", "--")) } } } else if nodeGet.Type == wwapiv1.GetNodeList_Ipmi { @@ -63,61 +64,41 @@ func NodeList(nodeGet *wwapiv1.GetNodeList) (nodeList wwapiv1.NodeList, err erro fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s", "NODE NAME", "IPMI IPADDR", "IPMI PORT", "IPMI USERNAME", "IPMI INTERFACE")) for _, n := range node.FilterByName(nodes, nodeGet.Nodes) { nodeList.Output = append(nodeList.Output, - fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id.Print(), - n.Ipmi.Ipaddr.Print(), - n.Ipmi.Port.Print(), - n.Ipmi.UserName.Print(), - n.Ipmi.Interface.Print(), - n.Ipmi.EscapeChar.Print())) + fmt.Sprintf("%s:=:%s:=:%s:=:%s:=:%s:=:%s", n.Id(), + n.Ipmi.Ipaddr, + n.Ipmi.Port, + n.Ipmi.UserName, + n.Ipmi.Interface, + n.Ipmi.EscapeChar)) } } else if nodeGet.Type == wwapiv1.GetNodeList_Long { nodeList.Output = append(nodeList.Output, fmt.Sprintf("%s:=:%s:=:%s:=:%s", "NODE NAME", "KERNEL OVERRIDE", "CONTAINER", "OVERLAYS (S/R)")) for _, n := range node.FilterByName(nodes, nodeGet.Nodes) { nodeList.Output = append(nodeList.Output, - fmt.Sprintf("%s:=:%s:=:%s:=:%s", n.Id.Print(), - n.Kernel.Override.Print(), - n.ContainerName.Print(), - n.SystemOverlay.Print()+"/"+n.RuntimeOverlay.Print())) + fmt.Sprintf("%s:=:%s:=:%s:=:%s", n.Id(), + n.Kernel.Override, + n.ContainerName, + strings.Join(n.SystemOverlay, ",")+"/"+strings.Join(n.RuntimeOverlay, ","))) } } else if nodeGet.Type == wwapiv1.GetNodeList_All || nodeGet.Type == wwapiv1.GetNodeList_FullAll { for _, n := range node.FilterByName(nodes, nodeGet.Nodes) { nodeList.Output = append(nodeList.Output, fmt.Sprintf("%s:=:%s:=:%s:=:%s", "NODE", "FIELD", "PROFILE", "VALUE")) - fields := n.GetFields(wwapiv1.GetNodeList_FullAll == nodeGet.Type) + fields := nodeDB.GetFields(n, nodeGet.Type == wwapiv1.GetNodeList_All) for _, f := range fields { nodeList.Output = append(nodeList.Output, - fmt.Sprintf("%s:=:%s:=:%s:=:%s", n.Id.Print(), f.Field, f.Source, f.Value)) + fmt.Sprintf("%s:=:%s:=:%s:=:%s", n.Id(), f.Field, f.Source, f.Value)) } } } else if nodeGet.Type == wwapiv1.GetNodeList_YAML || nodeGet.Type == wwapiv1.GetNodeList_JSON { - nodeResp := node.NodeYaml{ - NodeProfiles: make(map[string]*node.NodeConf), - Nodes: make(map[string]*node.NodeConf), - } - filterNodes := node.FilterByName(nodes, nodeGet.Nodes) - for _, nodeInfo := range filterNodes { - myNode := node.NewConf() - myNode.GetFrom(nodeInfo) - myNode.Flatten() - nodeResp.Nodes[nodeInfo.Id.Get()] = &myNode - } - - profiles, _ := nodeDB.FindAllProfiles() - for _, profileInfo := range profiles { - myProfile := node.NewConf() - myProfile.GetFrom(profileInfo) - myProfile.Flatten() - nodeResp.NodeProfiles[profileInfo.Id.Get()] = &myProfile - } - var buf []byte if nodeGet.Type == wwapiv1.GetNodeList_JSON { - buf, _ = json.MarshalIndent(nodeResp, "", " ") + buf, _ = json.MarshalIndent(filterNodes, "", " ") } if nodeGet.Type == wwapiv1.GetNodeList_YAML { - buf, _ = yaml.Marshal(nodeResp) + buf, _ = yaml.Marshal(filterNodes) } nodeList.Output = append(nodeList.Output, string(buf)) diff --git a/internal/pkg/api/node/node.go b/internal/pkg/api/node/node.go deleted file mode 100644 index 822432c4..00000000 --- a/internal/pkg/api/node/node.go +++ /dev/null @@ -1,400 +0,0 @@ -package apinode - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "net/http" - "os" - - "github.com/pkg/errors" - "github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1" - warewulfconf "github.com/warewulf/warewulf/internal/pkg/config" - "github.com/warewulf/warewulf/internal/pkg/hostlist" - "github.com/warewulf/warewulf/internal/pkg/node" - "github.com/warewulf/warewulf/internal/pkg/util" - "github.com/warewulf/warewulf/internal/pkg/wwlog" - "gopkg.in/yaml.v2" - - "github.com/warewulf/warewulf/internal/pkg/warewulfd" -) - -// NodeAdd adds nodes for management by Warewulf. -func NodeAdd(nap *wwapiv1.NodeAddParameter) (err error) { - - if nap == nil { - return fmt.Errorf("NodeAddParameter is nil") - } - - nodeDB, err := node.New() - if err != nil { - return errors.Wrap(err, "failed to open node database") - } - dbHash := nodeDB.Hash() - if hex.EncodeToString(dbHash[:]) != nap.Hash && !nap.Force { - return fmt.Errorf("got wrong hash, not modifying node database") - } - node_args := hostlist.Expand(nap.NodeNames) - var nodeConf node.NodeConf - err = yaml.Unmarshal([]byte(nap.NodeConfYaml), &nodeConf) - if err != nil { - return errors.Wrap(err, "Failed to decode nodeConf") - } - - for _, a := range node_args { - var n node.NodeInfo - n, err = nodeDB.AddNode(a) - if err != nil { - return errors.Wrap(err, "failed to add node") - } - wwlog.Info("Added node: %s", a) - var netName string - for netName = range nodeConf.NetDevs { - // as map should only have key this should give is the first and - // only key - } - // setting node from the received yaml - err = nodeConf.Check() - if err != nil { - err = fmt.Errorf("error on check of node %s: %s", n.Id.Get(), err) - return - - } - n.SetFrom(&nodeConf) - if netName != "" && nodeConf.NetDevs[netName].Ipaddr != "" { - // if more nodes are added increment IPv4 address - nodeConf.NetDevs[netName].Ipaddr = util.IncrementIPv4(nodeConf.NetDevs[netName].Ipaddr, 1) - - wwlog.Verbose("Incremented IP addr to %s", nodeConf.NetDevs[netName].Ipaddr) - } - if nodeConf.Ipmi != nil && nodeConf.Ipmi.Ipaddr != "" { - // if more nodes are added increment IPv4 address - nodeConf.Ipmi.Ipaddr = util.IncrementIPv4(nodeConf.Ipmi.Ipaddr, 1) - wwlog.Verbose("Incremented IP addr to %s", nodeConf.Ipmi.Ipaddr) - } - err = nodeDB.NodeUpdate(n) - if err != nil { - return errors.Wrap(err, "failed to update nodedb") - } - - } - - err = nodeDB.Persist() - if err != nil { - return errors.Wrap(err, "failed to persist new node") - } - - err = warewulfd.DaemonReload() - if err != nil { - return errors.Wrap(err, "failed to reload warewulf daemon") - } - return -} - -// NodeDelete adds nodes for management by Warewulf. -func NodeDelete(ndp *wwapiv1.NodeDeleteParameter) (err error) { - - var nodeList []node.NodeInfo - nodeList, err = NodeDeleteParameterCheck(ndp, false) - if err != nil { - return - } - - nodeDB, err := node.New() - if err != nil { - return fmt.Errorf("failed to open node database: %s", err) - } - dbHash := nodeDB.Hash() - if hex.EncodeToString(dbHash[:]) != ndp.Hash && !ndp.Force { - return fmt.Errorf("got wrong hash, not modifying node database") - } - - for _, n := range nodeList { - err := nodeDB.DelNode(n.Id.Get()) - if err != nil { - wwlog.Error("%s", err) - } else { - //count++ - wwlog.Verbose("Deleting node: %s\n", n.Id.Print()) - } - } - - err = nodeDB.Persist() - if err != nil { - return errors.Wrap(err, "failed to persist nodedb") - } - - err = warewulfd.DaemonReload() - if err != nil { - return errors.Wrap(err, "failed to reload warewulf daemon") - } - return -} - -// NodeDeleteParameterCheck does error checking on NodeDeleteParameter. -// Output to the console if console is true. -// Returns the nodes to delete. -func NodeDeleteParameterCheck(ndp *wwapiv1.NodeDeleteParameter, console bool) (nodeList []node.NodeInfo, err error) { - - if ndp == nil { - return nodeList, fmt.Errorf("NodeDeleteParameter is nil") - } - - nodeDB, err := node.New() - if err != nil { - return nodeList, fmt.Errorf("failed to open node database: %s", err) - } - dbHash := nodeDB.Hash() - if hex.EncodeToString(dbHash[:]) != ndp.Hash && !ndp.Force { - wwlog.Debug("got hash: %s", ndp.Hash) - wwlog.Debug("actual hash: %s", hex.EncodeToString(dbHash[:])) - return nodeList, fmt.Errorf("got wrong hash, not modifying node database") - } - - nodes, err := nodeDB.FindAllNodes() - if err != nil { - return nodeList, fmt.Errorf("could not get node list: %s", err) - } - - node_args := hostlist.Expand(ndp.NodeNames) - - nodeList = node.FilterByName(nodes, node_args) - - if len(nodeList) == 0 { - wwlog.Info("No nodes found") - } - return -} - -// NodeSet is the wwapiv1 implmentation for updating node fields. -func NodeSet(set *wwapiv1.NodeSetParameter) (err error) { - - if set == nil { - return fmt.Errorf("NodeAddParameter is nil") - } - - var nodeDB node.NodeYaml - nodeDB, _, err = NodeSetParameterCheck(set, false) - if err != nil { - return - } - return DbSave(&nodeDB) -} - -// NodeSetParameterCheck does error checking on NodeSetParameter. -// Output to the console if console is true. -// TODO: Determine if the console switch does wwlog or not. -// - console may end up being textOutput? -func NodeSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (nodeDB node.NodeYaml, nodeCount uint, err error) { - - if set == nil { - err = fmt.Errorf("node set parameter is nil") - if console { - fmt.Printf("%v\n", err) - return - } - } - - if set.NodeNames == nil { - err = fmt.Errorf("node set parameter: NodeNames is nil") - if console { - fmt.Printf("%v\n", err) - return - } - } - - nodeDB, err = node.New() - if err != nil { - wwlog.Error("Could not open node configuration: %s", err) - return - } - - nodes, err := nodeDB.FindAllNodes() - if err != nil { - wwlog.Error("Could not get node list: %s", err) - return - } - - // Note: This does not do expansion on the nodes. - - if set.AllNodes || (len(set.NodeNames) == 0 && len(nodes) > 0) { - if console { - fmt.Printf("\n*** WARNING: This command will modify all nodes! ***\n\n") - } - } else { - expandNodes := hostlist.Expand(set.NodeNames) - nodes = node.FilterByName(nodes, expandNodes) - } - - if len(nodes) == 0 { - if console { - fmt.Printf("No nodes found\n") - } - return - } - - for _, n := range nodes { - wwlog.Verbose("Evaluating node: %s", n.Id.Get()) - var nodeConf node.NodeConf - err = yaml.Unmarshal([]byte(set.NodeConfYaml), &nodeConf) - if err != nil { - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - err = nodeConf.Check() - if err != nil { - err = fmt.Errorf("error on check of node %s: %s", n.Id.Get(), err) - return - - } - n.SetFrom(&nodeConf) - if set.NetdevDelete != "" { - if _, ok := n.NetDevs[set.NetdevDelete]; !ok { - err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Node: %s, Deleting network device: %s", n.Id.Get(), set.NetdevDelete) - delete(n.NetDevs, set.NetdevDelete) - } - if set.PartitionDelete != "" { - deletedPart := false - for diskname, disk := range n.Disks { - if _, ok := disk.Partitions[set.PartitionDelete]; ok { - wwlog.Verbose("Node: %s, on disk %, deleting partition: %s", n.Id.Get(), diskname, set.PartitionDelete) - deletedPart = true - delete(disk.Partitions, set.PartitionDelete) - } - if !deletedPart { - wwlog.Error(fmt.Sprintf("%v", err.Error())) - err = fmt.Errorf("partition doesn't exist: %s", set.PartitionDelete) - return - } - } - } - if set.DiskDelete != "" { - if _, ok := n.Disks[set.DiskDelete]; !ok { - err = fmt.Errorf("disk doesn't exist: %s", set.DiskDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Node: %s, deleting disk: %s", n.Id.Get(), set.DiskDelete) - delete(n.Disks, set.DiskDelete) - } - if set.FilesystemDelete != "" { - if _, ok := n.FileSystems[set.FilesystemDelete]; !ok { - err = fmt.Errorf("filesystem doesn't exist: %s", set.FilesystemDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Node: %s, deleting filesystem: %s", n.Id.Get(), set.FilesystemDelete) - delete(n.FileSystems, set.FilesystemDelete) - } - for _, key := range nodeConf.TagsDel { - wwlog.Debug("deleting tag %s", key) - delete(n.Tags, key) - } - if nodeConf.Ipmi != nil { - for _, key := range nodeConf.Ipmi.TagsDel { - wwlog.Debug("deleting Ipmi tag %s", key) - delete(n.Ipmi.Tags, key) - } - } - for net := range nodeConf.NetDevs { - for _, key := range nodeConf.NetDevs[net].TagsDel { - if _, ok := n.NetDevs[net]; ok { - delete(n.NetDevs[net].Tags, key) - } - } - } - err := nodeDB.NodeUpdate(n) - if err != nil { - wwlog.Error("%s", err) - os.Exit(1) - } - - nodeCount++ - } - return -} - -// NodeStatus returns the imaging state for nodes. -// This requires warewulfd. -func NodeStatus(nodeNames []string) (nodeStatusResponse *wwapiv1.NodeStatusResponse, err error) { - - // Local structs for translating json from warewulfd. - type nodeStatusInternal struct { - NodeName string `json:"node name"` - Stage string `json:"stage"` - Sent string `json:"sent"` - Ipaddr string `json:"ipaddr"` - Lastseen int64 `json:"last seen"` - } - - // all status is a map with one key (nodes) - // and maps of [nodeName]NodeStatus underneath. - type allStatus struct { - Nodes map[string]*nodeStatusInternal `json:"nodes"` - } - - controller := warewulfconf.Get() - - if controller.Ipaddr == "" { - err = fmt.Errorf("the Warewulf Server IP Address is not properly configured") - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - - statusURL := fmt.Sprintf("http://%s:%d/status", controller.Ipaddr, controller.Warewulf.Port) - wwlog.Verbose("Connecting to: %s", statusURL) - - resp, err := http.Get(statusURL) - if err != nil { - wwlog.Error("Could not connect to Warewulf server: %s", err) - return - } - defer resp.Body.Close() - - decoder := json.NewDecoder(resp.Body) - var wwNodeStatus allStatus - - err = decoder.Decode(&wwNodeStatus) - if err != nil { - wwlog.Error("Could not decode JSON: %s", err) - return - } - - // Translate struct and filter. - nodeStatusResponse = &wwapiv1.NodeStatusResponse{} - - if len(nodeNames) == 0 { - for _, v := range wwNodeStatus.Nodes { - nodeStatusResponse.NodeStatus = append(nodeStatusResponse.NodeStatus, - &wwapiv1.NodeStatus{ - NodeName: v.NodeName, - Stage: v.Stage, - Sent: v.Sent, - Ipaddr: v.Ipaddr, - Lastseen: v.Lastseen, - }) - } - } else { - nodeList := hostlist.Expand(nodeNames) - for _, v := range wwNodeStatus.Nodes { - for j := 0; j < len(nodeList); j++ { - if v.NodeName == nodeList[j] { - nodeStatusResponse.NodeStatus = append(nodeStatusResponse.NodeStatus, - &wwapiv1.NodeStatus{ - NodeName: v.NodeName, - Stage: v.Stage, - Sent: v.Sent, - Ipaddr: v.Ipaddr, - Lastseen: v.Lastseen, - }) - break - } - } - } - } - return -} diff --git a/internal/pkg/api/node/set.go b/internal/pkg/api/node/set.go new file mode 100644 index 00000000..1814b900 --- /dev/null +++ b/internal/pkg/api/node/set.go @@ -0,0 +1,140 @@ +package apinode + +import ( + "fmt" + + "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" + "github.com/hpcng/warewulf/internal/pkg/node" + "github.com/hpcng/warewulf/internal/pkg/util" + "github.com/hpcng/warewulf/internal/pkg/wwlog" + "gopkg.in/yaml.v2" + + "github.com/hpcng/warewulf/internal/pkg/warewulfd" +) + +// NodeSet is the wwapiv1 implmentation for updating node fields. +func NodeSet(set *wwapiv1.ConfSetParameter) (err error) { + if set == nil { + return fmt.Errorf("NodeSetParameter is nil") + } + var nodeDB node.NodeYaml + nodeDB, _, err = NodeSetParameterCheck(set) + if err != nil { + return err + } + if err = nodeDB.Persist(); err != nil { + return err + } + if err = warewulfd.DaemonReload(); err != nil { + return err + } + return +} + +/* +NodeSetParameterCheck does error checking and returns a modified +NodeYml which than can be persisted +*/ +func NodeSetParameterCheck(set *wwapiv1.ConfSetParameter) (nodeDB node.NodeYaml, count uint, err error) { + nodeDB, err = node.New() + if err != nil { + wwlog.Error("Could not open configuration: %s", err) + return + } + //func AbstractSetParameterCheck(set *wwapiv1.ConfSetParameter, confMap map[string]*node.NodeConf, confs []string) (count uint, err error) { + if set == nil { + err = fmt.Errorf("profile set parameter is nil") + return + } + if set.ConfList == nil { + err = fmt.Errorf("node nodes to set!") + return + } + confs := nodeDB.ListAllNodes() + // Note: This does not do expansion on the nodes. + if set.AllConfs || (len(set.ConfList) == 0) { + wwlog.Warn("this command will modify all nodes/profiles") + } else if len(confs) == 0 { + wwlog.Warn("no nodes/profiles found") + return + } else { + confs = set.ConfList + } + //var confobject node.NodeConf + for _, p := range set.ConfList { + if util.InSlice(set.ConfList, p) { + wwlog.Verbose("evaluating profile: %s", p) + if _, ok := nodeDB.Nodes[p]; !ok { + continue + } + err = yaml.Unmarshal([]byte(set.NodeConfYaml), nodeDB.Nodes[p]) + if err != nil { + return + } + if set.NetdevDelete != "" { + if _, ok := nodeDB.Nodes[p].NetDevs[set.NetdevDelete]; !ok { + err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete) + wwlog.Error(fmt.Sprintf("%v", err.Error())) + return + } + wwlog.Verbose("Profile: %s, Deleting network device: %s", p, set.NetdevDelete) + delete(nodeDB.Nodes[p].NetDevs, set.NetdevDelete) + } + if set.PartitionDelete != "" { + for diskname, disk := range nodeDB.Nodes[p].Disks { + if _, ok := disk.Partitions[set.PartitionDelete]; ok { + wwlog.Verbose("Node: %s, on disk %, deleting partition: %s", p, diskname, set.PartitionDelete) + delete(disk.Partitions, set.PartitionDelete) + } else { + return nodeDB, count, fmt.Errorf("partition doesn't exist: %s", set.PartitionDelete) + + } + } + } + if set.DiskDelete != "" { + if _, ok := nodeDB.Nodes[p].Disks[set.DiskDelete]; ok { + wwlog.Verbose("Node: %s, deleting disk: %s", p, set.DiskDelete) + delete(nodeDB.Nodes[p].Disks, set.DiskDelete) + } else { + return nodeDB, count, fmt.Errorf("disk doesn't exist: %s", set.DiskDelete) + } + } + if set.FilesystemDelete != "" { + if _, ok := nodeDB.Nodes[p].FileSystems[set.FilesystemDelete]; ok { + wwlog.Verbose("Node: %s, deleting filesystem: %s", p, set.FilesystemDelete) + delete(nodeDB.Nodes[p].FileSystems, set.FilesystemDelete) + } else { + return nodeDB, count, fmt.Errorf("disk doesn't exist: %s", set.FilesystemDelete) + } + } + for _, key := range set.TagDel { + delete(nodeDB.Nodes[p].Tags, key) + } + for key, val := range set.TagAdd { + if nodeDB.Nodes[p].Tags == nil { + nodeDB.Nodes[p].Tags = make(map[string]string) + } + nodeDB.Nodes[p].Tags[key] = val + } + for key, val := range set.IpmiTagAdd { + if nodeDB.Nodes[p].Ipmi.Tags == nil { + nodeDB.Nodes[p].Ipmi.Tags = make(map[string]string) + } + nodeDB.Nodes[p].Ipmi.Tags[key] = val + } + for _, key := range set.IpmiTagDel { + delete(nodeDB.Nodes[p].Ipmi.Tags, key) + } + if _, ok := nodeDB.Nodes[p].NetDevs[set.Netdev]; ok { + for _, key := range set.NetTagDel { + delete(nodeDB.Nodes[p].NetDevs[set.Netdev].Tags, key) + } + for key, val := range set.TagAdd { + nodeDB.Nodes[p].NetDevs[set.Netdev].Tags[key] = val + } + } + count++ + } + } + return +} diff --git a/internal/pkg/api/profile/add.go b/internal/pkg/api/profile/add.go new file mode 100644 index 00000000..338ec047 --- /dev/null +++ b/internal/pkg/api/profile/add.go @@ -0,0 +1,42 @@ +package apiprofile + +import ( + "fmt" + + "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" + "github.com/hpcng/warewulf/internal/pkg/node" + "github.com/hpcng/warewulf/internal/pkg/util" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" +) + +/* +Adds a new profile with the given name +*/ +func ProfileAdd(nsp *wwapiv1.NodeAddParameter) error { + if nsp == nil { + return fmt.Errorf("NodeAddParameter is nill") + } + nodeDB, err := node.New() + if err != nil { + return errors.Wrap(err, "Could not open database") + } + for _, p := range nsp.NodeNames { + if util.InSlice(nodeDB.ListAllProfiles(), p) { + return errors.New(fmt.Sprintf("profile with name %s already exists", p)) + } + pNew, err := nodeDB.AddProfile(p) + if err != nil { + return err + } + err = yaml.Unmarshal([]byte(nsp.NodeConfYaml), &pNew) + if err != nil { + return errors.Wrap(err, "failed to add profile") + } + } + err = nodeDB.Persist() + if err != nil { + return errors.Wrap(err, "failed to persist new profile") + } + return nil +} diff --git a/internal/pkg/api/profile/delete.go b/internal/pkg/api/profile/delete.go index b1b846da..6f5dfc94 100644 --- a/internal/pkg/api/profile/delete.go +++ b/internal/pkg/api/profile/delete.go @@ -2,7 +2,6 @@ package apiprofile import ( "fmt" - "os" "github.com/pkg/errors" "github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1" @@ -14,36 +13,22 @@ import ( // ProfileDelete adds profile deletion for management by Warewulf. func ProfileDelete(ndp *wwapiv1.NodeDeleteParameter) (err error) { - - var profileList []node.NodeInfo - profileList, err = ProfileDeleteParameterCheck(ndp, false) + nodeDB, profileList, err := ProfileDeleteParameterCheck(ndp, false) if err != nil { return } - - nodeDB, err := node.New() - if err != nil { - wwlog.Error("Failed to open node database: %s\n", err) - return - } if nodeDB.StringHash() != ndp.Hash && !ndp.Force { return fmt.Errorf("got wrong hash, not modifying profile database") } for _, p := range profileList { - err := nodeDB.DelProfile(p.Id.Get()) - if err != nil { - wwlog.Error("%s\n", err) - } else { - //count++ - wwlog.Verbose("Deleting profile: %s\n", p.Id.Print()) - } + delete(nodeDB.NodeProfiles, p) + wwlog.Verbose("Deleting profile: %s", p) } err = nodeDB.Persist() if err != nil { return errors.Wrap(err, "failed to persist nodedb") } - err = warewulfd.DaemonReload() if err != nil { return errors.Wrap(err, "failed to reload warewulf daemon") @@ -54,43 +39,36 @@ func ProfileDelete(ndp *wwapiv1.NodeDeleteParameter) (err error) { // ProfileDeleteParameterCheck does error checking on ProfileDeleteParameter. // Output to the console if console is true. // Returns the profiles to delete. -func ProfileDeleteParameterCheck(ndp *wwapiv1.NodeDeleteParameter, console bool) (profileList []node.NodeInfo, err error) { +func ProfileDeleteParameterCheck(ndp *wwapiv1.NodeDeleteParameter, console bool) (nodeDB node.NodeYaml, profileList []string, err error) { if ndp == nil { - err = fmt.Errorf("ProfileDeleteParameter is nil") + err = fmt.Errorf("profileDeleteParameter is nil") return } - nodeDB, err := node.New() + nodeDB, err = node.New() if err != nil { - wwlog.Error("Failed to open node database: %s\n", err) + wwlog.Error("failed to open node database: %s\n", err) return } - - profiles, err := nodeDB.FindAllProfiles() - if err != nil { - wwlog.Error("Could not get node list: %s\n", err) - return - } - - node_args := hostlist.Expand(ndp.NodeNames) - - for _, r := range node_args { - var match bool - for _, p := range profiles { - if p.Id.Get() == r { + profileList = nodeDB.ListAllProfiles() + profileArgs := hostlist.Expand(ndp.NodeNames) + for _, r := range profileArgs { + match := false + for _, p := range profileList { + if p == r { profileList = append(profileList, p) match = true } } if !match { - fmt.Fprintf(os.Stderr, "ERROR: No match for node: %s\n", r) + wwlog.Error("no match for profile: %s", r) } } if len(profileList) == 0 { - fmt.Printf("No s found\n") + wwlog.Warn("no profiles found\n") } return } diff --git a/internal/pkg/api/profile/edit.go b/internal/pkg/api/profile/edit.go index 06c24a25..465aa356 100644 --- a/internal/pkg/api/profile/edit.go +++ b/internal/pkg/api/profile/edit.go @@ -39,7 +39,7 @@ func FilteredProfiles(profileList *wwapiv1.NodeList) *wwapiv1.NodeYaml { os.Exit(1) } profileMap := nodeDB.NodeProfiles - profileMap = node.FilterMapByName(profileMap, profileList.Output) + profileMap = node.FilterProfilesByName(profileMap, profileList.Output) buffer, _ := yaml.Marshal(profileMap) retVal := wwapiv1.NodeYaml{ NodeConfMapYaml: string(buffer), @@ -59,7 +59,7 @@ func ProfileAddFromYaml(nodeList *wwapiv1.NodeAddParameter) (err error) { return fmt.Errorf("got wrong hash, not modifying profile database") } - profileMap := make(map[string]*node.NodeConf) + profileMap := make(map[string]*node.ProfileConf) err = yaml.Unmarshal([]byte(nodeList.NodeConfYaml), profileMap) if err != nil { return errors.Wrap(err, "Could not unmarshall Yaml: %s\n") diff --git a/internal/pkg/api/profile/list.go b/internal/pkg/api/profile/list.go index 0d833573..df46866f 100644 --- a/internal/pkg/api/profile/list.go +++ b/internal/pkg/api/profile/list.go @@ -18,18 +18,15 @@ func ProfileList(ShowOpt *wwapiv1.GetProfileList) (profileList wwapiv1.ProfileLi profileList.Output = []string{} nodeDB, err := node.New() if err != nil { - wwlog.Error("Could not open node configuration: %s", err) return } - profiles, err := nodeDB.FindAllProfiles() if err != nil { - wwlog.Error("Could not find all profiles: %s", err) return } profiles = node.FilterByName(profiles, ShowOpt.Profiles) sort.Slice(profiles, func(i, j int) bool { - return profiles[i].Id.Get() < profiles[j].Id.Get() + return profiles[i].Id() < profiles[j].Id() }) if ShowOpt.ShowAll || ShowOpt.ShowFullAll { for _, p := range profiles { diff --git a/internal/pkg/api/profile/profile.go b/internal/pkg/api/profile/profile.go deleted file mode 100644 index c6f807a6..00000000 --- a/internal/pkg/api/profile/profile.go +++ /dev/null @@ -1,197 +0,0 @@ -package apiprofile - -import ( - "fmt" - "os" - - "github.com/pkg/errors" - apinode "github.com/warewulf/warewulf/internal/pkg/api/node" - "github.com/warewulf/warewulf/internal/pkg/api/routes/wwapiv1" - "github.com/warewulf/warewulf/internal/pkg/node" - "github.com/warewulf/warewulf/internal/pkg/util" - "github.com/warewulf/warewulf/internal/pkg/wwlog" - "gopkg.in/yaml.v2" -) - -// NodeSet is the wwapiv1 implmentation for updating nodeinfo fields. -func ProfileSet(set *wwapiv1.ProfileSetParameter) (err error) { - if set == nil { - return fmt.Errorf("NodeAddParameter is nil") - } - - var nodeDB node.NodeYaml - nodeDB, _, err = ProfileSetParameterCheck(set, false) - if err != nil { - return errors.Wrap(err, "Could not open database") - } - dbError := apinode.DbSave(&nodeDB) - return dbError -} - -// ProfileSetParameterCheck does error checking on ProfileSetParameter. -// Output to the console if console is true. -// TODO: Determine if the console switch does wwlog or not. -// - console may end up being textOutput? -func ProfileSetParameterCheck(set *wwapiv1.ProfileSetParameter, console bool) (nodeDB node.NodeYaml, profileCount uint, err error) { - if set == nil { - err = fmt.Errorf("profile set parameter is nil") - if console { - fmt.Printf("%v\n", err) - return - } - } - - if set.ProfileNames == nil { - err = fmt.Errorf("profile set parameter: ProfileNames is nil") - if console { - fmt.Printf("%v\n", err) - return - } - } - - nodeDB, err = node.New() - if err != nil { - wwlog.Error("Could not open configuration: %s", err) - return - } - - profiles, err := nodeDB.FindAllProfiles() - if err != nil { - wwlog.Error("Could not get profile list: %s", err) - return - } - - // Note: This does not do expansion on the nodes. - - if set.AllProfiles || (len(set.ProfileNames) == 0) { - if console { - fmt.Printf("\n*** WARNING: This command will modify all profiles! ***\n\n") - } - } - - if len(profiles) == 0 { - if console { - fmt.Printf("No profiles found\n") - } - return - } - var pConf node.NodeConf - err = yaml.Unmarshal([]byte(set.NodeConfYaml), &pConf) - if err != nil { - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - - for _, p := range profiles { - if util.InSlice(set.ProfileNames, p.Id.Get()) { - wwlog.Verbose("Evaluating profile: %s", p.Id.Get()) - p.SetFrom(&pConf) - if set.NetdevDelete != "" { - if _, ok := p.NetDevs[set.NetdevDelete]; !ok { - err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Profile: %s, Deleting network device: %s", p.Id.Get(), set.NetdevDelete) - delete(p.NetDevs, set.NetdevDelete) - } - if set.PartitionDelete != "" { - deletedPart := false - for diskname, disk := range p.Disks { - if _, ok := disk.Partitions[set.PartitionDelete]; ok { - wwlog.Verbose("Node: %s, on disk %, deleting partition: %s", p.Id.Get(), diskname, set.PartitionDelete) - deletedPart = true - delete(disk.Partitions, set.PartitionDelete) - } - if !deletedPart { - wwlog.Error(fmt.Sprintf("%v", err.Error())) - err = fmt.Errorf("partition doesn't exist: %s", set.PartitionDelete) - return - } - } - } - if set.DiskDelete != "" { - if _, ok := p.Disks[set.DiskDelete]; !ok { - err = fmt.Errorf("disk doesn't exist: %s", set.DiskDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Node: %s, deleting disk: %s", p.Id.Get(), set.DiskDelete) - delete(p.Disks, set.DiskDelete) - } - if set.FilesystemDelete != "" { - if _, ok := p.FileSystems[set.FilesystemDelete]; !ok { - err = fmt.Errorf("disk doesn't exist: %s", set.FilesystemDelete) - wwlog.Error(fmt.Sprintf("%v", err.Error())) - return - } - wwlog.Verbose("Node: %s, deleting filesystem: %s", p.Id.Get(), set.FilesystemDelete) - delete(p.FileSystems, set.FilesystemDelete) - } - - for _, key := range pConf.TagsDel { - delete(p.Tags, key) - } - for _, key := range pConf.Ipmi.TagsDel { - delete(p.Ipmi.Tags, key) - } - for net := range pConf.NetDevs { - for _, key := range pConf.NetDevs[net].TagsDel { - if _, ok := p.NetDevs[net]; ok { - delete(p.NetDevs[net].Tags, key) - } - } - } - err := nodeDB.ProfileUpdate(p) - if err != nil { - wwlog.Error("%s", err) - os.Exit(1) - } - - profileCount++ - } - } - return -} - -/* -Adds a new profile with the given name -*/ - -func AddProfile(nsp *wwapiv1.ProfileSetParameter) error { - if nsp == nil { - return fmt.Errorf("NodeSetParameter is nill") - } - - nodeDB, err := node.New() - if err != nil { - return errors.Wrap(err, "Could not open database") - } - - if util.InSlice(nodeDB.ListAllProfiles(), nsp.ProfileNames[0]) { - return errors.New(fmt.Sprintf("profile with name %s already exists", nsp.ProfileNames[0])) - } - - var nodeConf node.NodeConf - err = yaml.Unmarshal([]byte(nsp.NodeConfYaml), &nodeConf) - if err != nil { - return errors.Wrap(err, "failed to decode nodeConf") - } - - n, err := nodeDB.AddProfile(nsp.ProfileNames[0]) - if err != nil { - return errors.Wrap(err, "failed to add node") - } - n.SetFrom(&nodeConf) - - err = nodeDB.ProfileUpdate(n) - if err != nil { - return errors.Wrap(err, "failed to update nodedb") - } - - err = nodeDB.Persist() - if err != nil { - return errors.Wrap(err, "failed to persist new profile") - } - return nil -} diff --git a/internal/pkg/api/profile/set.go b/internal/pkg/api/profile/set.go new file mode 100644 index 00000000..44ddb7b6 --- /dev/null +++ b/internal/pkg/api/profile/set.go @@ -0,0 +1,139 @@ +package apiprofile + +import ( + "fmt" + + "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" + "github.com/hpcng/warewulf/internal/pkg/node" + "github.com/hpcng/warewulf/internal/pkg/util" + "github.com/hpcng/warewulf/internal/pkg/warewulfd" + "github.com/hpcng/warewulf/internal/pkg/wwlog" + "github.com/pkg/errors" + "gopkg.in/yaml.v2" +) + +// NodeSet is the wwapiv1 implmentation for updating nodeinfo fields. +func ProfileSet(set *wwapiv1.ConfSetParameter) (err error) { + if set == nil { + return fmt.Errorf("ProfileAddParameter is nil") + } + nodeDB, _, err := ProfileSetParameterCheck(set) + if err != nil { + return errors.Wrap(err, "profile set parameters are wrong") + } + if err = nodeDB.Persist(); err != nil { + return err + } + if err = warewulfd.DaemonReload(); err != nil { + return err + } + return +} + +/* +NodeSetParameterCheck does error checking and returns a modified +NodeYml which than can be persisted +*/ +func ProfileSetParameterCheck(set *wwapiv1.ConfSetParameter) (nodeDB node.NodeYaml, count uint, err error) { + nodeDB, err = node.New() + if err != nil { + wwlog.Error("Could not open configuration: %s", err) + return + } + //func AbstractSetParameterCheck(set *wwapiv1.ConfSetParameter, confMap map[string]*node.NodeConf, confs []string) (count uint, err error) { + if set == nil { + err = fmt.Errorf("profile set parameter is nil") + return + } + if set.ConfList == nil { + err = fmt.Errorf("node nodes to set!") + return + } + confs := nodeDB.ListAllProfiles() + // Note: This does not do expansion on the nodes. + if set.AllConfs || (len(set.ConfList) == 0) { + wwlog.Warn("this command will modify all nodes/profiles") + } else if len(confs) == 0 { + wwlog.Warn("no nodes/profiles found") + return + } else { + confs = set.ConfList + } + //var confobject node.NodeConf + for _, p := range set.ConfList { + if util.InSlice(set.ConfList, p) { + wwlog.Verbose("evaluating profile: %s", p) + if _, ok := nodeDB.NodeProfiles[p]; !ok { + continue + } + err = yaml.Unmarshal([]byte(set.NodeConfYaml), nodeDB.NodeProfiles[p]) + if err != nil { + return + } + if set.NetdevDelete != "" { + if _, ok := nodeDB.NodeProfiles[p].NetDevs[set.NetdevDelete]; !ok { + err = fmt.Errorf("network device name doesn't exist: %s", set.NetdevDelete) + wwlog.Error(fmt.Sprintf("%v", err.Error())) + return + } + wwlog.Verbose("Profile: %s, Deleting network device: %s", p, set.NetdevDelete) + delete(nodeDB.NodeProfiles[p].NetDevs, set.NetdevDelete) + } + if set.PartitionDelete != "" { + for diskname, disk := range nodeDB.NodeProfiles[p].Disks { + if _, ok := disk.Partitions[set.PartitionDelete]; ok { + wwlog.Verbose("Node: %s, on disk %, deleting partition: %s", p, diskname, set.PartitionDelete) + delete(disk.Partitions, set.PartitionDelete) + } else { + return nodeDB, count, fmt.Errorf("partition doesn't exist: %s", set.PartitionDelete) + + } + } + } + if set.DiskDelete != "" { + if _, ok := nodeDB.NodeProfiles[p].Disks[set.DiskDelete]; ok { + wwlog.Verbose("Node: %s, deleting disk: %s", p, set.DiskDelete) + delete(nodeDB.NodeProfiles[p].Disks, set.DiskDelete) + } else { + return nodeDB, count, fmt.Errorf("disk doesn't exist: %s", set.DiskDelete) + } + } + if set.FilesystemDelete != "" { + if _, ok := nodeDB.NodeProfiles[p].FileSystems[set.FilesystemDelete]; ok { + wwlog.Verbose("Node: %s, deleting filesystem: %s", p, set.FilesystemDelete) + delete(nodeDB.NodeProfiles[p].FileSystems, set.FilesystemDelete) + } else { + return nodeDB, count, fmt.Errorf("disk doesn't exist: %s", set.FilesystemDelete) + } + } + for _, key := range set.TagDel { + delete(nodeDB.NodeProfiles[p].Tags, key) + } + for key, val := range set.TagAdd { + if nodeDB.NodeProfiles[p].Tags == nil { + nodeDB.NodeProfiles[p].Tags = make(map[string]string) + } + nodeDB.NodeProfiles[p].Tags[key] = val + } + for key, val := range set.IpmiTagAdd { + if nodeDB.NodeProfiles[p].Ipmi.Tags == nil { + nodeDB.NodeProfiles[p].Ipmi.Tags = make(map[string]string) + } + nodeDB.NodeProfiles[p].Ipmi.Tags[key] = val + } + for _, key := range set.IpmiTagDel { + delete(nodeDB.NodeProfiles[p].Ipmi.Tags, key) + } + if _, ok := nodeDB.NodeProfiles[p].NetDevs[set.Netdev]; ok { + for _, key := range set.NetTagDel { + delete(nodeDB.NodeProfiles[p].NetDevs[set.Netdev].Tags, key) + } + for key, val := range set.TagAdd { + nodeDB.NodeProfiles[p].NetDevs[set.Netdev].Tags[key] = val + } + } + count++ + } + } + return +} diff --git a/internal/pkg/api/routes/v1/routes.proto b/internal/pkg/api/routes/v1/routes.proto index 3a3411c4..19d92f25 100644 --- a/internal/pkg/api/routes/v1/routes.proto +++ b/internal/pkg/api/routes/v1/routes.proto @@ -192,28 +192,25 @@ message NodeDeleteParameter { // NodeSetParameter contains all fields for updating aspects of nodes managed // by Warewulf. -message NodeSetParameter { +message ConfSetParameter { string nodeConfYaml = 1; string netdevDelete = 2; string diskDelete = 3; string partitionDelete = 4; string filesystemDelete = 5; - bool allNodes = 6; + bool allConfs = 6; bool force = 7; - repeated string nodeNames = 8; -} -// ProfileSetParameter contains all fields for updating aspects of profiles managed. Basically a copy of NodeSetParameters -// by Warewulf. -message ProfileSetParameter { - string nodeConfYaml = 1; - string netdevDelete = 2; - string diskDelete = 3; - string partitionDelete = 4; - string filesystemDelete = 5; - bool allProfiles = 6; - bool force = 7; - repeated string profileNames = 8; + repeated string confList = 8; + map tagAdd = 9; + map netTagAdd = 10; + map ipmiTagAdd = 11; + repeated string tagDel = 12; + repeated string netTagDel = 13; + repeated string ipmiTagDel = 14; + string netdev = 15; + } + // NodeStatus contains information about the imaging status per node. message NodeStatus { string nodeName = 1; // Name (Id) of the node. @@ -325,7 +322,7 @@ service WWApi { } // NodeSet updates node fields for one or more nodes. - rpc NodeSet(NodeSetParameter) returns (NodeListResponse) { + rpc NodeSet(ConfSetParameter) returns (NodeListResponse) { option (google.api.http) = { post: "/v1/nodeset" // TODO: This should be a patch. Had trouble getting patch to work at all. body: "*" diff --git a/internal/pkg/api/routes/wwapiv1/routes.pb.go b/internal/pkg/api/routes/wwapiv1/routes.pb.go index 2af3742c..6f1c6c5f 100644 --- a/internal/pkg/api/routes/wwapiv1/routes.pb.go +++ b/internal/pkg/api/routes/wwapiv1/routes.pb.go @@ -1546,23 +1546,30 @@ func (x *NodeDeleteParameter) GetHash() string { // NodeSetParameter contains all fields for updating aspects of nodes managed // by Warewulf. -type NodeSetParameter struct { +type ConfSetParameter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NodeConfYaml string `protobuf:"bytes,1,opt,name=nodeConfYaml,proto3" json:"nodeConfYaml,omitempty"` - NetdevDelete string `protobuf:"bytes,2,opt,name=netdevDelete,proto3" json:"netdevDelete,omitempty"` - DiskDelete string `protobuf:"bytes,3,opt,name=diskDelete,proto3" json:"diskDelete,omitempty"` - PartitionDelete string `protobuf:"bytes,4,opt,name=partitionDelete,proto3" json:"partitionDelete,omitempty"` - FilesystemDelete string `protobuf:"bytes,5,opt,name=filesystemDelete,proto3" json:"filesystemDelete,omitempty"` - AllNodes bool `protobuf:"varint,6,opt,name=allNodes,proto3" json:"allNodes,omitempty"` - Force bool `protobuf:"varint,7,opt,name=force,proto3" json:"force,omitempty"` - NodeNames []string `protobuf:"bytes,8,rep,name=nodeNames,proto3" json:"nodeNames,omitempty"` + NodeConfYaml string `protobuf:"bytes,1,opt,name=nodeConfYaml,proto3" json:"nodeConfYaml,omitempty"` + NetdevDelete string `protobuf:"bytes,2,opt,name=netdevDelete,proto3" json:"netdevDelete,omitempty"` + DiskDelete string `protobuf:"bytes,3,opt,name=diskDelete,proto3" json:"diskDelete,omitempty"` + PartitionDelete string `protobuf:"bytes,4,opt,name=partitionDelete,proto3" json:"partitionDelete,omitempty"` + FilesystemDelete string `protobuf:"bytes,5,opt,name=filesystemDelete,proto3" json:"filesystemDelete,omitempty"` + AllConfs bool `protobuf:"varint,6,opt,name=allConfs,proto3" json:"allConfs,omitempty"` + Force bool `protobuf:"varint,7,opt,name=force,proto3" json:"force,omitempty"` + ConfList []string `protobuf:"bytes,8,rep,name=confList,proto3" json:"confList,omitempty"` + TagAdd map[string]string `protobuf:"bytes,9,rep,name=tagAdd,proto3" json:"tagAdd,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + NetTagAdd map[string]string `protobuf:"bytes,10,rep,name=netTagAdd,proto3" json:"netTagAdd,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + IpmiTagAdd map[string]string `protobuf:"bytes,11,rep,name=ipmiTagAdd,proto3" json:"ipmiTagAdd,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + TagDel []string `protobuf:"bytes,12,rep,name=tagDel,proto3" json:"tagDel,omitempty"` + NetTagDel []string `protobuf:"bytes,13,rep,name=netTagDel,proto3" json:"netTagDel,omitempty"` + IpmiTagDel []string `protobuf:"bytes,14,rep,name=ipmiTagDel,proto3" json:"ipmiTagDel,omitempty"` + Netdev string `protobuf:"bytes,15,opt,name=netdev,proto3" json:"netdev,omitempty"` } -func (x *NodeSetParameter) Reset() { - *x = NodeSetParameter{} +func (x *ConfSetParameter) Reset() { + *x = ConfSetParameter{} if protoimpl.UnsafeEnabled { mi := &file_routes_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1570,13 +1577,13 @@ func (x *NodeSetParameter) Reset() { } } -func (x *NodeSetParameter) String() string { +func (x *ConfSetParameter) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NodeSetParameter) ProtoMessage() {} +func (*ConfSetParameter) ProtoMessage() {} -func (x *NodeSetParameter) ProtoReflect() protoreflect.Message { +func (x *ConfSetParameter) ProtoReflect() protoreflect.Message { mi := &file_routes_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1588,172 +1595,116 @@ func (x *NodeSetParameter) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use NodeSetParameter.ProtoReflect.Descriptor instead. -func (*NodeSetParameter) Descriptor() ([]byte, []int) { +// Deprecated: Use ConfSetParameter.ProtoReflect.Descriptor instead. +func (*ConfSetParameter) Descriptor() ([]byte, []int) { return file_routes_proto_rawDescGZIP(), []int{23} } -func (x *NodeSetParameter) GetNodeConfYaml() string { +func (x *ConfSetParameter) GetNodeConfYaml() string { if x != nil { return x.NodeConfYaml } return "" } -func (x *NodeSetParameter) GetNetdevDelete() string { +func (x *ConfSetParameter) GetNetdevDelete() string { if x != nil { return x.NetdevDelete } return "" } -func (x *NodeSetParameter) GetDiskDelete() string { +func (x *ConfSetParameter) GetDiskDelete() string { if x != nil { return x.DiskDelete } return "" } -func (x *NodeSetParameter) GetPartitionDelete() string { +func (x *ConfSetParameter) GetPartitionDelete() string { if x != nil { return x.PartitionDelete } return "" } -func (x *NodeSetParameter) GetFilesystemDelete() string { +func (x *ConfSetParameter) GetFilesystemDelete() string { if x != nil { return x.FilesystemDelete } return "" } -func (x *NodeSetParameter) GetAllNodes() bool { +func (x *ConfSetParameter) GetAllConfs() bool { if x != nil { - return x.AllNodes + return x.AllConfs } return false } -func (x *NodeSetParameter) GetForce() bool { +func (x *ConfSetParameter) GetForce() bool { if x != nil { return x.Force } return false } -func (x *NodeSetParameter) GetNodeNames() []string { +func (x *ConfSetParameter) GetConfList() []string { if x != nil { - return x.NodeNames + return x.ConfList } return nil } -// ProfileSetParameter contains all fields for updating aspects of profiles managed. Basically a copy of NodeSetParameters -// by Warewulf. -type ProfileSetParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeConfYaml string `protobuf:"bytes,1,opt,name=nodeConfYaml,proto3" json:"nodeConfYaml,omitempty"` - NetdevDelete string `protobuf:"bytes,2,opt,name=netdevDelete,proto3" json:"netdevDelete,omitempty"` - DiskDelete string `protobuf:"bytes,3,opt,name=diskDelete,proto3" json:"diskDelete,omitempty"` - PartitionDelete string `protobuf:"bytes,4,opt,name=partitionDelete,proto3" json:"partitionDelete,omitempty"` - FilesystemDelete string `protobuf:"bytes,5,opt,name=filesystemDelete,proto3" json:"filesystemDelete,omitempty"` - AllProfiles bool `protobuf:"varint,6,opt,name=allProfiles,proto3" json:"allProfiles,omitempty"` - Force bool `protobuf:"varint,7,opt,name=force,proto3" json:"force,omitempty"` - ProfileNames []string `protobuf:"bytes,8,rep,name=profileNames,proto3" json:"profileNames,omitempty"` -} - -func (x *ProfileSetParameter) Reset() { - *x = ProfileSetParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_routes_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProfileSetParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProfileSetParameter) ProtoMessage() {} - -func (x *ProfileSetParameter) ProtoReflect() protoreflect.Message { - mi := &file_routes_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProfileSetParameter.ProtoReflect.Descriptor instead. -func (*ProfileSetParameter) Descriptor() ([]byte, []int) { - return file_routes_proto_rawDescGZIP(), []int{24} -} - -func (x *ProfileSetParameter) GetNodeConfYaml() string { +func (x *ConfSetParameter) GetTagAdd() map[string]string { if x != nil { - return x.NodeConfYaml - } - return "" -} - -func (x *ProfileSetParameter) GetNetdevDelete() string { - if x != nil { - return x.NetdevDelete - } - return "" -} - -func (x *ProfileSetParameter) GetDiskDelete() string { - if x != nil { - return x.DiskDelete - } - return "" -} - -func (x *ProfileSetParameter) GetPartitionDelete() string { - if x != nil { - return x.PartitionDelete - } - return "" -} - -func (x *ProfileSetParameter) GetFilesystemDelete() string { - if x != nil { - return x.FilesystemDelete - } - return "" -} - -func (x *ProfileSetParameter) GetAllProfiles() bool { - if x != nil { - return x.AllProfiles - } - return false -} - -func (x *ProfileSetParameter) GetForce() bool { - if x != nil { - return x.Force - } - return false -} - -func (x *ProfileSetParameter) GetProfileNames() []string { - if x != nil { - return x.ProfileNames + return x.TagAdd } return nil } +func (x *ConfSetParameter) GetNetTagAdd() map[string]string { + if x != nil { + return x.NetTagAdd + } + return nil +} + +func (x *ConfSetParameter) GetIpmiTagAdd() map[string]string { + if x != nil { + return x.IpmiTagAdd + } + return nil +} + +func (x *ConfSetParameter) GetTagDel() []string { + if x != nil { + return x.TagDel + } + return nil +} + +func (x *ConfSetParameter) GetNetTagDel() []string { + if x != nil { + return x.NetTagDel + } + return nil +} + +func (x *ConfSetParameter) GetIpmiTagDel() []string { + if x != nil { + return x.IpmiTagDel + } + return nil +} + +func (x *ConfSetParameter) GetNetdev() string { + if x != nil { + return x.Netdev + } + return "" +} + // NodeStatus contains information about the imaging status per node. type NodeStatus struct { state protoimpl.MessageState @@ -1770,7 +1721,7 @@ type NodeStatus struct { func (x *NodeStatus) Reset() { *x = NodeStatus{} if protoimpl.UnsafeEnabled { - mi := &file_routes_proto_msgTypes[25] + mi := &file_routes_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1783,7 +1734,7 @@ func (x *NodeStatus) String() string { func (*NodeStatus) ProtoMessage() {} func (x *NodeStatus) ProtoReflect() protoreflect.Message { - mi := &file_routes_proto_msgTypes[25] + mi := &file_routes_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1796,7 +1747,7 @@ func (x *NodeStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use NodeStatus.ProtoReflect.Descriptor instead. func (*NodeStatus) Descriptor() ([]byte, []int) { - return file_routes_proto_rawDescGZIP(), []int{25} + return file_routes_proto_rawDescGZIP(), []int{24} } func (x *NodeStatus) GetNodeName() string { @@ -1846,7 +1797,7 @@ type NodeStatusResponse struct { func (x *NodeStatusResponse) Reset() { *x = NodeStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_routes_proto_msgTypes[26] + mi := &file_routes_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1859,7 +1810,7 @@ func (x *NodeStatusResponse) String() string { func (*NodeStatusResponse) ProtoMessage() {} func (x *NodeStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_routes_proto_msgTypes[26] + mi := &file_routes_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1872,7 +1823,7 @@ func (x *NodeStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NodeStatusResponse.ProtoReflect.Descriptor instead. func (*NodeStatusResponse) Descriptor() ([]byte, []int) { - return file_routes_proto_rawDescGZIP(), []int{26} + return file_routes_proto_rawDescGZIP(), []int{25} } func (x *NodeStatusResponse) GetNodeStatus() []*NodeStatus { @@ -1896,7 +1847,7 @@ type VersionResponse struct { func (x *VersionResponse) Reset() { *x = VersionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_routes_proto_msgTypes[27] + mi := &file_routes_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1909,7 +1860,7 @@ func (x *VersionResponse) String() string { func (*VersionResponse) ProtoMessage() {} func (x *VersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_routes_proto_msgTypes[27] + mi := &file_routes_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1922,7 +1873,7 @@ func (x *VersionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead. func (*VersionResponse) Descriptor() ([]byte, []int) { - return file_routes_proto_rawDescGZIP(), []int{27} + return file_routes_proto_rawDescGZIP(), []int{26} } func (x *VersionResponse) GetApiPrefix() string { @@ -1958,7 +1909,7 @@ type CanWriteConfig struct { func (x *CanWriteConfig) Reset() { *x = CanWriteConfig{} if protoimpl.UnsafeEnabled { - mi := &file_routes_proto_msgTypes[28] + mi := &file_routes_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1971,7 +1922,7 @@ func (x *CanWriteConfig) String() string { func (*CanWriteConfig) ProtoMessage() {} func (x *CanWriteConfig) ProtoReflect() protoreflect.Message { - mi := &file_routes_proto_msgTypes[28] + mi := &file_routes_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1984,7 +1935,7 @@ func (x *CanWriteConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use CanWriteConfig.ProtoReflect.Descriptor instead. func (*CanWriteConfig) Descriptor() ([]byte, []int) { - return file_routes_proto_rawDescGZIP(), []int{28} + return file_routes_proto_rawDescGZIP(), []int{27} } func (x *CanWriteConfig) GetCanWriteConfig() bool { @@ -2196,7 +2147,7 @@ var file_routes_proto_rawDesc = []byte{ 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, - 0xa0, 0x02, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x99, 0x06, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x59, 0x61, 0x6d, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x59, 0x61, 0x6d, 0x6c, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x64, @@ -2209,139 +2160,151 @@ var file_routes_proto_rawDesc = []byte{ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x14, + 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, - 0x6f, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x22, 0xaf, 0x02, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, - 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, - 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x59, 0x61, 0x6d, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x59, 0x61, 0x6d, 0x6c, 0x12, 0x22, - 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x64, 0x65, 0x76, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x65, 0x74, 0x64, 0x65, 0x76, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x10, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, - 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, - 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x61, - 0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x61, 0x64, 0x64, - 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x73, 0x65, 0x65, 0x6e, 0x22, 0x4a, 0x0a, - 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x6e, - 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x79, 0x0a, 0x0f, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x61, 0x70, 0x69, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x61, 0x70, 0x69, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, - 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x77, 0x61, - 0x72, 0x65, 0x77, 0x75, 0x6c, 0x66, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x61, 0x72, 0x65, 0x77, 0x75, 0x6c, 0x66, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x61, 0x6e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x63, 0x61, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xfe, - 0x09, 0x0a, 0x05, 0x57, 0x57, 0x41, 0x70, 0x69, 0x12, 0x73, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x12, 0x21, 0x2e, 0x77, 0x77, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, - 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x2e, - 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x64, 0x0a, - 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x15, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x12, 0x67, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x43, 0x6f, 0x70, 0x79, 0x12, 0x20, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x70, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1c, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x63, 0x6f, 0x70, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x0f, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, - 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x5f, - 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, - 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x6d, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, - 0x12, 0x20, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x77, 0x12, 0x6d, - 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x56, 0x0a, - 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x12, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x6f, 0x72, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x66, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x66, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x3e, 0x0a, 0x06, 0x74, 0x61, 0x67, 0x41, 0x64, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x54, 0x61, 0x67, + 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x74, 0x61, 0x67, 0x41, 0x64, 0x64, + 0x12, 0x47, 0x0a, 0x09, 0x6e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x18, 0x0a, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, + 0x4e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, + 0x6e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x12, 0x4a, 0x0a, 0x0a, 0x69, 0x70, 0x6d, + 0x69, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x53, 0x65, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x49, 0x70, 0x6d, 0x69, 0x54, 0x61, + 0x67, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x70, 0x6d, 0x69, 0x54, + 0x61, 0x67, 0x41, 0x64, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x18, + 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x12, 0x1c, 0x0a, + 0x09, 0x6e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x6e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x69, + 0x70, 0x6d, 0x69, 0x54, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0a, 0x69, 0x70, 0x6d, 0x69, 0x54, 0x61, 0x67, 0x44, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x65, 0x74, 0x64, 0x65, 0x76, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x65, 0x74, + 0x64, 0x65, 0x76, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, + 0x0a, 0x0e, 0x4e, 0x65, 0x74, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, + 0x49, 0x70, 0x6d, 0x69, 0x54, 0x61, 0x67, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x86, 0x01, 0x0a, 0x0a, + 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, + 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, + 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x6e, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x69, 0x70, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x69, 0x70, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, + 0x73, 0x65, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, + 0x73, 0x65, 0x65, 0x6e, 0x22, 0x4a, 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x6e, 0x6f, + 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0x79, 0x0a, 0x0f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x69, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x70, 0x69, 0x50, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x77, 0x61, 0x72, 0x65, 0x77, 0x75, 0x6c, 0x66, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x61, 0x72, 0x65, + 0x77, 0x75, 0x6c, 0x66, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x0e, 0x43, + 0x61, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, + 0x0e, 0x63, 0x61, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x63, 0x61, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xfe, 0x09, 0x0a, 0x05, 0x57, 0x57, 0x41, 0x70, 0x69, 0x12, + 0x73, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x75, 0x69, 0x6c, + 0x64, 0x12, 0x21, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x22, 0x12, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x64, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x2a, 0x0d, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x67, 0x0a, 0x0d, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x70, 0x79, 0x12, 0x20, 0x2e, 0x77, 0x77, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x43, 0x6f, 0x70, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x63, 0x6f, 0x70, 0x79, + 0x3a, 0x01, 0x2a, 0x12, 0x70, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x12, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x5f, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1f, + 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x6d, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x20, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x77, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1f, 0x2e, 0x77, 0x77, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x68, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x73, 0x68, 0x6f, 0x77, 0x12, 0x6d, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x72, 0x65, 0x6e, 0x61, 0x6d, + 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x56, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x64, 0x64, 0x12, + 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x41, + 0x64, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1a, 0x2e, 0x77, 0x77, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, + 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x55, 0x0a, 0x0a, + 0x4e, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x77, 0x77, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x2a, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, + 0x6f, 0x64, 0x65, 0x12, 0x4d, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x13, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x22, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, - 0x64, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x55, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0a, 0x2a, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x4d, 0x0a, 0x08, - 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x1a, 0x2e, - 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x12, 0x59, 0x0a, 0x07, 0x4e, - 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x1a, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, - 0x73, 0x65, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x57, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x1a, 0x1c, 0x2e, 0x77, 0x77, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, - 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x4e, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, - 0x29, 0x5a, 0x27, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x2f, 0x77, 0x77, 0x61, 0x70, 0x69, - 0x76, 0x31, 0x3b, 0x77, 0x77, 0x61, 0x70, 0x69, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, + 0x64, 0x65, 0x12, 0x59, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x74, 0x12, 0x1a, 0x2e, + 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x53, 0x65, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x1a, 0x1a, 0x2e, 0x77, 0x77, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x22, 0x0b, 0x2f, + 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x65, 0x74, 0x3a, 0x01, 0x2a, 0x12, 0x57, 0x0a, + 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x2e, 0x77, 0x77, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x1a, 0x1c, 0x2e, 0x77, 0x77, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4e, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x77, 0x77, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x29, 0x5a, 0x27, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, + 0x73, 0x2f, 0x77, 0x77, 0x61, 0x70, 0x69, 0x76, 0x31, 0x3b, 0x77, 0x77, 0x61, 0x70, 0x69, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2357,7 +2320,7 @@ func file_routes_proto_rawDescGZIP() []byte { } var file_routes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_routes_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_routes_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_routes_proto_goTypes = []interface{}{ (GetNodeList_ListType)(0), // 0: wwapi.v1.GetNodeList.ListType (*NodeDBHash)(nil), // 1: wwapi.v1.NodeDBHash @@ -2383,68 +2346,73 @@ var file_routes_proto_goTypes = []interface{}{ (*NodeAddParameter)(nil), // 21: wwapi.v1.NodeAddParameter (*NodeYaml)(nil), // 22: wwapi.v1.NodeYaml (*NodeDeleteParameter)(nil), // 23: wwapi.v1.NodeDeleteParameter - (*NodeSetParameter)(nil), // 24: wwapi.v1.NodeSetParameter - (*ProfileSetParameter)(nil), // 25: wwapi.v1.ProfileSetParameter - (*NodeStatus)(nil), // 26: wwapi.v1.NodeStatus - (*NodeStatusResponse)(nil), // 27: wwapi.v1.NodeStatusResponse - (*VersionResponse)(nil), // 28: wwapi.v1.VersionResponse - (*CanWriteConfig)(nil), // 29: wwapi.v1.CanWriteConfig - nil, // 30: wwapi.v1.NetDev.FieldEntry - nil, // 31: wwapi.v1.NetDev.TagsEntry - nil, // 32: wwapi.v1.NodeInfo.FieldsEntry - nil, // 33: wwapi.v1.NodeInfo.NetDevsEntry - nil, // 34: wwapi.v1.NodeInfo.TagsEntry - nil, // 35: wwapi.v1.NodeInfo.KeysEntry - (*emptypb.Empty)(nil), // 36: google.protobuf.Empty + (*ConfSetParameter)(nil), // 24: wwapi.v1.ConfSetParameter + (*NodeStatus)(nil), // 25: wwapi.v1.NodeStatus + (*NodeStatusResponse)(nil), // 26: wwapi.v1.NodeStatusResponse + (*VersionResponse)(nil), // 27: wwapi.v1.VersionResponse + (*CanWriteConfig)(nil), // 28: wwapi.v1.CanWriteConfig + nil, // 29: wwapi.v1.NetDev.FieldEntry + nil, // 30: wwapi.v1.NetDev.TagsEntry + nil, // 31: wwapi.v1.NodeInfo.FieldsEntry + nil, // 32: wwapi.v1.NodeInfo.NetDevsEntry + nil, // 33: wwapi.v1.NodeInfo.TagsEntry + nil, // 34: wwapi.v1.NodeInfo.KeysEntry + nil, // 35: wwapi.v1.ConfSetParameter.TagAddEntry + nil, // 36: wwapi.v1.ConfSetParameter.NetTagAddEntry + nil, // 37: wwapi.v1.ConfSetParameter.IpmiTagAddEntry + (*emptypb.Empty)(nil), // 38: google.protobuf.Empty } var file_routes_proto_depIdxs = []int32{ 6, // 0: wwapi.v1.ContainerListResponse.containers:type_name -> wwapi.v1.ContainerInfo - 30, // 1: wwapi.v1.NetDev.Field:type_name -> wwapi.v1.NetDev.FieldEntry - 31, // 2: wwapi.v1.NetDev.Tags:type_name -> wwapi.v1.NetDev.TagsEntry - 32, // 3: wwapi.v1.NodeInfo.Fields:type_name -> wwapi.v1.NodeInfo.FieldsEntry - 33, // 4: wwapi.v1.NodeInfo.NetDevs:type_name -> wwapi.v1.NodeInfo.NetDevsEntry - 34, // 5: wwapi.v1.NodeInfo.Tags:type_name -> wwapi.v1.NodeInfo.TagsEntry - 35, // 6: wwapi.v1.NodeInfo.Keys:type_name -> wwapi.v1.NodeInfo.KeysEntry + 29, // 1: wwapi.v1.NetDev.Field:type_name -> wwapi.v1.NetDev.FieldEntry + 30, // 2: wwapi.v1.NetDev.Tags:type_name -> wwapi.v1.NetDev.TagsEntry + 31, // 3: wwapi.v1.NodeInfo.Fields:type_name -> wwapi.v1.NodeInfo.FieldsEntry + 32, // 4: wwapi.v1.NodeInfo.NetDevs:type_name -> wwapi.v1.NodeInfo.NetDevsEntry + 33, // 5: wwapi.v1.NodeInfo.Tags:type_name -> wwapi.v1.NodeInfo.TagsEntry + 34, // 6: wwapi.v1.NodeInfo.Keys:type_name -> wwapi.v1.NodeInfo.KeysEntry 15, // 7: wwapi.v1.NodeListResponse.nodes:type_name -> wwapi.v1.NodeInfo 0, // 8: wwapi.v1.GetNodeList.type:type_name -> wwapi.v1.GetNodeList.ListType - 26, // 9: wwapi.v1.NodeStatusResponse.nodeStatus:type_name -> wwapi.v1.NodeStatus - 13, // 10: wwapi.v1.NetDev.FieldEntry.value:type_name -> wwapi.v1.NodeField - 13, // 11: wwapi.v1.NetDev.TagsEntry.value:type_name -> wwapi.v1.NodeField - 13, // 12: wwapi.v1.NodeInfo.FieldsEntry.value:type_name -> wwapi.v1.NodeField - 14, // 13: wwapi.v1.NodeInfo.NetDevsEntry.value:type_name -> wwapi.v1.NetDev - 13, // 14: wwapi.v1.NodeInfo.TagsEntry.value:type_name -> wwapi.v1.NodeField - 13, // 15: wwapi.v1.NodeInfo.KeysEntry.value:type_name -> wwapi.v1.NodeField - 2, // 16: wwapi.v1.WWApi.ContainerBuild:input_type -> wwapi.v1.ContainerBuildParameter - 3, // 17: wwapi.v1.WWApi.ContainerDelete:input_type -> wwapi.v1.ContainerDeleteParameter - 4, // 18: wwapi.v1.WWApi.ContainerCopy:input_type -> wwapi.v1.ContainerCopyParameter - 5, // 19: wwapi.v1.WWApi.ContainerImport:input_type -> wwapi.v1.ContainerImportParameter - 36, // 20: wwapi.v1.WWApi.ContainerList:input_type -> google.protobuf.Empty - 8, // 21: wwapi.v1.WWApi.ContainerShow:input_type -> wwapi.v1.ContainerShowParameter - 11, // 22: wwapi.v1.WWApi.ContainerRename:input_type -> wwapi.v1.ContainerRenameParameter - 21, // 23: wwapi.v1.WWApi.NodeAdd:input_type -> wwapi.v1.NodeAddParameter - 23, // 24: wwapi.v1.WWApi.NodeDelete:input_type -> wwapi.v1.NodeDeleteParameter - 12, // 25: wwapi.v1.WWApi.NodeList:input_type -> wwapi.v1.NodeNames - 24, // 26: wwapi.v1.WWApi.NodeSet:input_type -> wwapi.v1.NodeSetParameter - 12, // 27: wwapi.v1.WWApi.NodeStatus:input_type -> wwapi.v1.NodeNames - 36, // 28: wwapi.v1.WWApi.Version:input_type -> google.protobuf.Empty - 7, // 29: wwapi.v1.WWApi.ContainerBuild:output_type -> wwapi.v1.ContainerListResponse - 36, // 30: wwapi.v1.WWApi.ContainerDelete:output_type -> google.protobuf.Empty - 36, // 31: wwapi.v1.WWApi.ContainerCopy:output_type -> google.protobuf.Empty - 7, // 32: wwapi.v1.WWApi.ContainerImport:output_type -> wwapi.v1.ContainerListResponse - 7, // 33: wwapi.v1.WWApi.ContainerList:output_type -> wwapi.v1.ContainerListResponse - 9, // 34: wwapi.v1.WWApi.ContainerShow:output_type -> wwapi.v1.ContainerShowResponse - 36, // 35: wwapi.v1.WWApi.ContainerRename:output_type -> google.protobuf.Empty - 16, // 36: wwapi.v1.WWApi.NodeAdd:output_type -> wwapi.v1.NodeListResponse - 36, // 37: wwapi.v1.WWApi.NodeDelete:output_type -> google.protobuf.Empty - 16, // 38: wwapi.v1.WWApi.NodeList:output_type -> wwapi.v1.NodeListResponse - 16, // 39: wwapi.v1.WWApi.NodeSet:output_type -> wwapi.v1.NodeListResponse - 27, // 40: wwapi.v1.WWApi.NodeStatus:output_type -> wwapi.v1.NodeStatusResponse - 28, // 41: wwapi.v1.WWApi.Version:output_type -> wwapi.v1.VersionResponse - 29, // [29:42] is the sub-list for method output_type - 16, // [16:29] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 35, // 9: wwapi.v1.ConfSetParameter.tagAdd:type_name -> wwapi.v1.ConfSetParameter.TagAddEntry + 36, // 10: wwapi.v1.ConfSetParameter.netTagAdd:type_name -> wwapi.v1.ConfSetParameter.NetTagAddEntry + 37, // 11: wwapi.v1.ConfSetParameter.ipmiTagAdd:type_name -> wwapi.v1.ConfSetParameter.IpmiTagAddEntry + 25, // 12: wwapi.v1.NodeStatusResponse.nodeStatus:type_name -> wwapi.v1.NodeStatus + 13, // 13: wwapi.v1.NetDev.FieldEntry.value:type_name -> wwapi.v1.NodeField + 13, // 14: wwapi.v1.NetDev.TagsEntry.value:type_name -> wwapi.v1.NodeField + 13, // 15: wwapi.v1.NodeInfo.FieldsEntry.value:type_name -> wwapi.v1.NodeField + 14, // 16: wwapi.v1.NodeInfo.NetDevsEntry.value:type_name -> wwapi.v1.NetDev + 13, // 17: wwapi.v1.NodeInfo.TagsEntry.value:type_name -> wwapi.v1.NodeField + 13, // 18: wwapi.v1.NodeInfo.KeysEntry.value:type_name -> wwapi.v1.NodeField + 2, // 19: wwapi.v1.WWApi.ContainerBuild:input_type -> wwapi.v1.ContainerBuildParameter + 3, // 20: wwapi.v1.WWApi.ContainerDelete:input_type -> wwapi.v1.ContainerDeleteParameter + 4, // 21: wwapi.v1.WWApi.ContainerCopy:input_type -> wwapi.v1.ContainerCopyParameter + 5, // 22: wwapi.v1.WWApi.ContainerImport:input_type -> wwapi.v1.ContainerImportParameter + 38, // 23: wwapi.v1.WWApi.ContainerList:input_type -> google.protobuf.Empty + 8, // 24: wwapi.v1.WWApi.ContainerShow:input_type -> wwapi.v1.ContainerShowParameter + 11, // 25: wwapi.v1.WWApi.ContainerRename:input_type -> wwapi.v1.ContainerRenameParameter + 21, // 26: wwapi.v1.WWApi.NodeAdd:input_type -> wwapi.v1.NodeAddParameter + 23, // 27: wwapi.v1.WWApi.NodeDelete:input_type -> wwapi.v1.NodeDeleteParameter + 12, // 28: wwapi.v1.WWApi.NodeList:input_type -> wwapi.v1.NodeNames + 24, // 29: wwapi.v1.WWApi.NodeSet:input_type -> wwapi.v1.ConfSetParameter + 12, // 30: wwapi.v1.WWApi.NodeStatus:input_type -> wwapi.v1.NodeNames + 38, // 31: wwapi.v1.WWApi.Version:input_type -> google.protobuf.Empty + 7, // 32: wwapi.v1.WWApi.ContainerBuild:output_type -> wwapi.v1.ContainerListResponse + 38, // 33: wwapi.v1.WWApi.ContainerDelete:output_type -> google.protobuf.Empty + 38, // 34: wwapi.v1.WWApi.ContainerCopy:output_type -> google.protobuf.Empty + 7, // 35: wwapi.v1.WWApi.ContainerImport:output_type -> wwapi.v1.ContainerListResponse + 7, // 36: wwapi.v1.WWApi.ContainerList:output_type -> wwapi.v1.ContainerListResponse + 9, // 37: wwapi.v1.WWApi.ContainerShow:output_type -> wwapi.v1.ContainerShowResponse + 38, // 38: wwapi.v1.WWApi.ContainerRename:output_type -> google.protobuf.Empty + 16, // 39: wwapi.v1.WWApi.NodeAdd:output_type -> wwapi.v1.NodeListResponse + 38, // 40: wwapi.v1.WWApi.NodeDelete:output_type -> google.protobuf.Empty + 16, // 41: wwapi.v1.WWApi.NodeList:output_type -> wwapi.v1.NodeListResponse + 16, // 42: wwapi.v1.WWApi.NodeSet:output_type -> wwapi.v1.NodeListResponse + 26, // 43: wwapi.v1.WWApi.NodeStatus:output_type -> wwapi.v1.NodeStatusResponse + 27, // 44: wwapi.v1.WWApi.Version:output_type -> wwapi.v1.VersionResponse + 32, // [32:45] is the sub-list for method output_type + 19, // [19:32] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_routes_proto_init() } @@ -2730,7 +2698,7 @@ func file_routes_proto_init() { } } file_routes_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NodeSetParameter); i { + switch v := v.(*ConfSetParameter); i { case 0: return &v.state case 1: @@ -2742,18 +2710,6 @@ func file_routes_proto_init() { } } file_routes_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProfileSetParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_routes_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NodeStatus); i { case 0: return &v.state @@ -2765,7 +2721,7 @@ func file_routes_proto_init() { return nil } } - file_routes_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_routes_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NodeStatusResponse); i { case 0: return &v.state @@ -2777,7 +2733,7 @@ func file_routes_proto_init() { return nil } } - file_routes_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_routes_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*VersionResponse); i { case 0: return &v.state @@ -2789,7 +2745,7 @@ func file_routes_proto_init() { return nil } } - file_routes_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_routes_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CanWriteConfig); i { case 0: return &v.state @@ -2808,7 +2764,7 @@ func file_routes_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_routes_proto_rawDesc, NumEnums: 1, - NumMessages: 35, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/pkg/api/routes/wwapiv1/routes.pb.gw.go b/internal/pkg/api/routes/wwapiv1/routes.pb.gw.go index 041633c5..60e6b30a 100644 --- a/internal/pkg/api/routes/wwapiv1/routes.pb.gw.go +++ b/internal/pkg/api/routes/wwapiv1/routes.pb.gw.go @@ -365,7 +365,7 @@ func local_request_WWApi_NodeList_0(ctx context.Context, marshaler runtime.Marsh } func request_WWApi_NodeSet_0(ctx context.Context, marshaler runtime.Marshaler, client WWApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq NodeSetParameter + var protoReq ConfSetParameter var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -382,7 +382,7 @@ func request_WWApi_NodeSet_0(ctx context.Context, marshaler runtime.Marshaler, c } func local_request_WWApi_NodeSet_0(ctx context.Context, marshaler runtime.Marshaler, server WWApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq NodeSetParameter + var protoReq ConfSetParameter var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) diff --git a/internal/pkg/api/routes/wwapiv1/routes_grpc.pb.go b/internal/pkg/api/routes/wwapiv1/routes_grpc.pb.go index ee7a12c7..a322c627 100644 --- a/internal/pkg/api/routes/wwapiv1/routes_grpc.pb.go +++ b/internal/pkg/api/routes/wwapiv1/routes_grpc.pb.go @@ -44,7 +44,7 @@ type WWApiClient interface { // NodeList lists some or all nodes managed by Warewulf. NodeList(ctx context.Context, in *NodeNames, opts ...grpc.CallOption) (*NodeListResponse, error) // NodeSet updates node fields for one or more nodes. - NodeSet(ctx context.Context, in *NodeSetParameter, opts ...grpc.CallOption) (*NodeListResponse, error) + NodeSet(ctx context.Context, in *ConfSetParameter, opts ...grpc.CallOption) (*NodeListResponse, error) // NodeStatus returns the imaging state for nodes. // This requires warewulfd. NodeStatus(ctx context.Context, in *NodeNames, opts ...grpc.CallOption) (*NodeStatusResponse, error) @@ -151,7 +151,7 @@ func (c *wWApiClient) NodeList(ctx context.Context, in *NodeNames, opts ...grpc. return out, nil } -func (c *wWApiClient) NodeSet(ctx context.Context, in *NodeSetParameter, opts ...grpc.CallOption) (*NodeListResponse, error) { +func (c *wWApiClient) NodeSet(ctx context.Context, in *ConfSetParameter, opts ...grpc.CallOption) (*NodeListResponse, error) { out := new(NodeListResponse) err := c.cc.Invoke(ctx, "/wwapi.v1.WWApi/NodeSet", in, out, opts...) if err != nil { @@ -203,7 +203,7 @@ type WWApiServer interface { // NodeList lists some or all nodes managed by Warewulf. NodeList(context.Context, *NodeNames) (*NodeListResponse, error) // NodeSet updates node fields for one or more nodes. - NodeSet(context.Context, *NodeSetParameter) (*NodeListResponse, error) + NodeSet(context.Context, *ConfSetParameter) (*NodeListResponse, error) // NodeStatus returns the imaging state for nodes. // This requires warewulfd. NodeStatus(context.Context, *NodeNames) (*NodeStatusResponse, error) @@ -247,7 +247,7 @@ func (UnimplementedWWApiServer) NodeDelete(context.Context, *NodeDeleteParameter func (UnimplementedWWApiServer) NodeList(context.Context, *NodeNames) (*NodeListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeList not implemented") } -func (UnimplementedWWApiServer) NodeSet(context.Context, *NodeSetParameter) (*NodeListResponse, error) { +func (UnimplementedWWApiServer) NodeSet(context.Context, *ConfSetParameter) (*NodeListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeSet not implemented") } func (UnimplementedWWApiServer) NodeStatus(context.Context, *NodeNames) (*NodeStatusResponse, error) { @@ -450,7 +450,7 @@ func _WWApi_NodeList_Handler(srv interface{}, ctx context.Context, dec func(inte } func _WWApi_NodeSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeSetParameter) + in := new(ConfSetParameter) if err := dec(in); err != nil { return nil, err } @@ -462,7 +462,7 @@ func _WWApi_NodeSet_Handler(srv interface{}, ctx context.Context, dec func(inter FullMethod: "/wwapi.v1.WWApi/NodeSet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(WWApiServer).NodeSet(ctx, req.(*NodeSetParameter)) + return srv.(WWApiServer).NodeSet(ctx, req.(*ConfSetParameter)) } return interceptor(ctx, in, info, handler) }