// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.package spec

package cmd

import (
	"github.com/pingcap/tidb-cloud-manager/managerctl/cmd/util"
	"github.com/spf13/cobra"
)

// ClusterOptions contains the global options
type ClusterOptions struct {
	ClusterCfg string
	Namespace  string
}

// NewCmdCluster implements the cluster command for manager tidbcluster
func NewCmdCluster(cli util.Client) *cobra.Command {

	cmd := &cobra.Command{
		Use:   "cluster create|delete|get|list|resize|judge",
		Short: "Manage tidb cluster.",
		Long: `Manage tidb cluster.

The cluster commands sets for manage tidb cluster.`,
		Run: util.RunHelp,
	}

	// cluster manage subcommands
	cmd.AddCommand(NewCmdCreateCluster(cli))
	cmd.AddCommand(NewCmdDeleteCluster(cli))
	cmd.AddCommand(NewCmdResizeCluster(cli))
	cmd.AddCommand(NewCmdUpgradeCluster(cli))
	cmd.AddCommand(NewCmdGetCluster(cli))
	cmd.AddCommand(NewCmdListClusters(cli))
	cmd.AddCommand(NewCmdRestoreCluster(cli))

	return cmd
}
