-
Notifications
You must be signed in to change notification settings - Fork 64
/
instance.go
51 lines (42 loc) · 1.29 KB
/
instance.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2023, Unikraft GmbH and The KraftKit Authors.
// Licensed under the BSD-3-Clause License (the "License").
// You may not use this file except in compliance with the License.
package instance
import (
"github.com/spf13/cobra"
"kraftkit.sh/cmdfactory"
"kraftkit.sh/cmd/kraft/cloud/instance/create"
"kraftkit.sh/cmd/kraft/cloud/instance/list"
"kraftkit.sh/cmd/kraft/cloud/instance/logs"
"kraftkit.sh/cmd/kraft/cloud/instance/remove"
"kraftkit.sh/cmd/kraft/cloud/instance/start"
"kraftkit.sh/cmd/kraft/cloud/instance/status"
"kraftkit.sh/cmd/kraft/cloud/instance/stop"
)
type Instance struct{}
func New() *cobra.Command {
cmd, err := cmdfactory.New(&Instance{}, cobra.Command{
Short: "Manage KraftCloud instances",
Use: "instance SUBCOMMAND",
Aliases: []string{"inst", "instances"},
Hidden: true,
Annotations: map[string]string{
cmdfactory.AnnotationHelpGroup: "kraftcloud-instance",
},
})
if err != nil {
panic(err)
}
cmd.AddCommand(create.New())
cmd.AddCommand(list.New())
cmd.AddCommand(logs.New())
cmd.AddCommand(remove.New())
cmd.AddCommand(start.New())
cmd.AddCommand(status.New())
cmd.AddCommand(stop.New())
return cmd
}
func (opts *Instance) Run(cmd *cobra.Command, _ []string) error {
return cmd.Help()
}