Add a new OpenAPI v3 REST API to warewulfd at /api
Co-authored-by: jason yang <jasonyangshadow@gmail.com> Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -459,27 +459,9 @@ nodes:
|
||||
stdout: `
|
||||
{
|
||||
"n01": {
|
||||
"Discoverable": "",
|
||||
"AssetKey": "",
|
||||
"Profiles": [
|
||||
"profiles": [
|
||||
"default"
|
||||
],
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
]
|
||||
}
|
||||
}
|
||||
`,
|
||||
@@ -498,50 +480,14 @@ nodes:
|
||||
stdout: `
|
||||
{
|
||||
"n01": {
|
||||
"Discoverable": "",
|
||||
"AssetKey": "",
|
||||
"Profiles": [
|
||||
"profiles": [
|
||||
"default"
|
||||
],
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
]
|
||||
},
|
||||
"n02": {
|
||||
"Discoverable": "",
|
||||
"AssetKey": "",
|
||||
"Profiles": [
|
||||
"profiles": [
|
||||
"default"
|
||||
],
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
]
|
||||
}
|
||||
}
|
||||
`,
|
||||
|
||||
@@ -153,25 +153,7 @@ nodes:
|
||||
args: []string{"-j"},
|
||||
output: `
|
||||
{
|
||||
"default": {
|
||||
"Profiles": null,
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
}
|
||||
"default": {}
|
||||
}
|
||||
`,
|
||||
inDb: `
|
||||
@@ -205,44 +187,8 @@ nodes:
|
||||
args: []string{"-j"},
|
||||
output: `
|
||||
{
|
||||
"default": {
|
||||
"Profiles": null,
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
},
|
||||
"test": {
|
||||
"Profiles": null,
|
||||
"Comment": "",
|
||||
"ClusterName": "",
|
||||
"ImageName": "",
|
||||
"Ipxe": "",
|
||||
"RuntimeOverlay": null,
|
||||
"SystemOverlay": null,
|
||||
"Kernel": null,
|
||||
"Ipmi": null,
|
||||
"Init": "",
|
||||
"Root": "",
|
||||
"NetDevs": null,
|
||||
"Tags": null,
|
||||
"PrimaryNetDev": "",
|
||||
"Disks": null,
|
||||
"FileSystems": null,
|
||||
"Resources": null
|
||||
}
|
||||
"default": {},
|
||||
"test": {}
|
||||
}
|
||||
`,
|
||||
inDb: `
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
|
||||
"github.com/warewulf/warewulf/internal/pkg/warewulfd"
|
||||
"github.com/warewulf/warewulf/internal/pkg/warewulfd/server"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -31,7 +32,7 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
if err := warewulfd.DaemonInitLogging(); err != nil {
|
||||
return fmt.Errorf("failed to configure logging: %w", err)
|
||||
}
|
||||
if err := warewulfd.RunServer(); err != nil {
|
||||
if err := server.RunServer(); err != nil {
|
||||
return fmt.Errorf("failed to start Warewulf server: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user