-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: atulpatel261194 <Atul.Patel@intel.com>
- Loading branch information
1 parent
e4af793
commit de1bf20
Showing
31 changed files
with
516 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. | ||
|
||
// Package cmd implements the ipsec related CLI commands | ||
package cmd | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
"github.com/opiproject/godpu/cmd/inventory" | ||
"github.com/opiproject/godpu/cmd/ipsec" | ||
"github.com/opiproject/godpu/cmd/network" | ||
"github.com/opiproject/godpu/cmd/storage" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// AddrCmdLineArg cmdline arg name for address | ||
const AddrCmdLineArg = "addr" | ||
|
||
// TLSFiles cmdline arg name for tls files | ||
const TLSFiles = "tlsfiles" | ||
|
||
// NewCommand handles the cli for evpn, ipsec, invetory and storage | ||
func NewCommand() *cobra.Command { | ||
// | ||
// This is the root command for the CLI | ||
// | ||
|
||
c := &cobra.Command{ | ||
Use: "godpu", | ||
Short: "godpu - DPUs and IPUs cli commands", | ||
Run: func(cmd *cobra.Command, _ []string) { | ||
err := cmd.Help() | ||
if err != nil { | ||
log.Fatalf("[ERROR] %s", err.Error()) | ||
} | ||
os.Exit(1) | ||
}, | ||
} | ||
c.AddCommand(inventory.NewInventoryCommand()) | ||
c.AddCommand(ipsec.NewIPSecCommand()) | ||
c.AddCommand(storage.NewStorageCommand()) | ||
c.AddCommand(network.NewEvpnCommand()) | ||
|
||
flags := c.PersistentFlags() | ||
flags.String(AddrCmdLineArg, "localhost:50151", "address of OPI gRPC server") | ||
flags.String(TLSFiles, "", "TLS files in client_cert:client_key:ca_cert format.") | ||
|
||
return c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.