ref: 79803b98b551ad1d924594263038bc901f684233 cisco/csc/cmd/instance/set/type.go -rw-r--r-- 482 bytes View raw
                                                                                
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
package instanceset

import (
	"cisco/csc/cmd/instance"
	"cisco/sdk"
	"fmt"
	"github.com/spf13/cobra"
)

var instanceSetType = &cobra.Command{
	Use:   "type",
	Short: "Changes the type of an instance",
	Args:  cobra.ExactArgs(2),
	Run: func(cmd *cobra.Command, args []string) {
		err := cisco.SetTypeInstance(args[0], args[1])

		if err != nil {
			fmt.Printf("Error: %s\n", err.Error())
			return
		}
	},
}

func init() {
	instance.InstanceSetRootCmd.AddCommand(instanceSetType)
}