|
- package cluster
-
- import (
- "fmt"
-
- "github.com/spf13/cobra"
- cliapi "gitlink.org.cn/cloudream/jcs-pub/client/sdk/api/v1"
- "gitlink.org.cn/cloudream/jcs-pub/jcsctl/cmd"
- )
-
- func init() {
- var opt statusOpt
- cmd := cobra.Command{
- Use: "status",
- Args: cobra.ExactArgs(0),
- RunE: func(c *cobra.Command, args []string) error {
- ctx := cmd.GetCmdCtx(c)
- return status(c, ctx, opt, args)
- },
- }
- ClusterCmd.AddCommand(&cmd)
- }
-
- type statusOpt struct {
- }
-
- func status(c *cobra.Command, ctx *cmd.CommandContext, opt statusOpt, args []string) error {
- _, err := ctx.Client.Cluster().Status(cliapi.ClusterStatus{})
- if err != nil {
- return fmt.Errorf("get status: %v", err)
- }
-
- return nil
- }
|