-
Notifications
You must be signed in to change notification settings - Fork 30
/
root.go
41 lines (34 loc) · 935 Bytes
/
root.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
// SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
//
// SPDX-License-Identifier: Apache-2.0
package kpimon
import (
"github.com/onosproject/onos-lib-go/pkg/cli"
loglib "github.com/onosproject/onos-lib-go/pkg/logging/cli"
"github.com/spf13/cobra"
)
const (
configName = "kpimon"
defaultAddress = "onos-kpimon:5150"
)
// init initializes the command line
func init() {
cli.InitConfig(configName)
}
// Init is a hook called after cobra initialization
func Init() {
// noop for now
}
// GetCommand returns the root command for the RAN service
func GetCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "kpimon {get/set} [args]",
Short: "ONOS KPIMON subsystem commands",
}
cli.AddConfigFlags(cmd, defaultAddress)
cmd.AddCommand(getListCommand())
cmd.AddCommand(getWatchCommand())
cmd.AddCommand(getSetCommand())
cmd.AddCommand(loglib.GetCommand())
return cmd
}