switches

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddSwitchCmd = &subcommands.Command{
	UsageLine: "switch [Options...]",
	ShortDesc: "Add a switch to a rack",
	LongDesc:  cmdhelp.AddSwitchLongDesc,
	CommandRun: func() subcommands.CommandRun {
		c := &addSwitch{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)

		c.Flags.StringVar(&c.newSpecsFile, "f", "", cmdhelp.SwitchFileText)
		c.Flags.BoolVar(&c.interactive, "i", false, "enable interactive mode for input")

		c.Flags.StringVar(&c.rackName, "rack", "", "name of the rack to associate the switch")
		c.Flags.StringVar(&c.switchName, "name", "", "the name of the switch to add")
		c.Flags.StringVar(&c.description, "desc", "", "the description of the switch to add")
		c.Flags.IntVar(&c.capacity, "capacity", 0, "indicate how many ports this switch support")
		c.Flags.StringVar(&c.tags, "tags", "", "comma separated tags. You can only append/add new tags here.")
		return c
	},
}

AddSwitchCmd add Switch in the lab.

View Source
var DeleteSwitchCmd = &subcommands.Command{
	UsageLine: "switch {Switch Name}",
	ShortDesc: "Delete a switch on a rack",
	LongDesc: `Delete a switch on a rack.

Example:
shivas delete switch {Switch Name}
Deletes the given switch.`,
	CommandRun: func() subcommands.CommandRun {
		c := &deleteSwitch{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		return c
	},
}

DeleteSwitchCmd delete Switch by given name.

View Source
var GetSwitchCmd = &subcommands.Command{
	UsageLine: "switch ...",
	ShortDesc: "get switch details by filters",
	LongDesc: `get switch details by filters.

Example:

shivas get switch name1 name2

shivas get switch -n 10

shivas get switch -rack rack1 -rack rack2 -state serving

Gets the switch and prints the output in user-specified format.`,
	CommandRun: func() subcommands.CommandRun {
		c := &getSwitch{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)
		c.outputFlags.Register(&c.Flags)

		c.Flags.IntVar(&c.pageSize, "n", 0, cmdhelp.ListPageSizeDesc)
		c.Flags.BoolVar(&c.keysOnly, "keys", false, cmdhelp.KeysOnlyText)

		c.Flags.Var(flag.StringSlice(&c.zones), "zone", "Name(s) of a zone to filter by. Can be specified multiple times."+cmdhelp.ZoneFilterHelpText)
		c.Flags.Var(flag.StringSlice(&c.racks), "rack", "Name(s) of a rack to filter by. Can be specified multiple times.")
		c.Flags.Var(flag.StringSlice(&c.tags), "tag", "Name(s) of a tag to filter by. Can be specified multiple times.")
		c.Flags.Var(flag.StringSlice(&c.states), "state", "Name(s) of a state to filter by. Can be specified multiple times."+cmdhelp.StateFilterHelpText)
		return c
	},
}

GetSwitchCmd get Switch by given name.

View Source
var RenameSwitchCmd = &subcommands.Command{
	UsageLine: "switch ...",
	ShortDesc: "Rename switch with new name",
	LongDesc: `Rename switch with new name.

Example:

shivas rename switch -name {oldName} -new-name {newName}

Renames the switch and prints the output in the user-specified format.`,
	CommandRun: func() subcommands.CommandRun {
		c := &renameSwitch{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)
		c.outputFlags.Register(&c.Flags)

		c.Flags.StringVar(&c.name, "name", "", "the name of the switch to rename")
		c.Flags.StringVar(&c.newName, "new-name", "", "the new name of the switch")
		return c
	},
}

RenameSwitchCmd rename switch by given name.

View Source
var UpdateSwitchCmd = &subcommands.Command{
	UsageLine: "switch [Options...]",
	ShortDesc: "Update a switch on a rack",
	LongDesc:  cmdhelp.UpdateSwitchLongDesc,
	CommandRun: func() subcommands.CommandRun {
		c := &updateSwitch{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)

		c.Flags.StringVar(&c.newSpecsFile, "f", "", cmdhelp.SwitchFileText)

		c.Flags.StringVar(&c.rackName, "rack", "", "name of the rack to associate the switch")
		c.Flags.StringVar(&c.switchName, "name", "", "the name of the switch to update")
		c.Flags.StringVar(&c.description, "desc", "", "the description of the switch to update ."+cmdhelp.ClearFieldHelpText)
		c.Flags.IntVar(&c.capacity, "capacity", 0, "indicate how many ports this switch support. "+"To clear this field set it to -1.")
		c.Flags.StringVar(&c.tags, "tags", "", "comma separated tags. You can only append/add new tags here. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.state, "state", "", cmdhelp.StateHelp)
		return c
	},
}

UpdateSwitchCmd Update switch by given name.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL