rack

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

		c.Flags.StringVar(&c.rackName, "name", "", "the name of the rack to add")
		c.Flags.IntVar(&c.bbNum, "bbnum", 0, "indicate the breadboard number of the rack")
		c.Flags.StringVar(&c.zoneName, "zone", "", cmdhelp.ZoneHelpText)
		c.Flags.IntVar(&c.capacity, "capacity_ru", 0, "indicate the size of the rack in rack units (U).")
		c.Flags.Var(flag.StringSlice(&c.tags), "tag", "Name(s) of tag(s). Can be specified multiple times.")
		return c
	},
}

AddRackCmd add Rack to the system.

View Source
var DeleteRackCmd = &subcommands.Command{
	UsageLine: "rack {Rack Name}",
	ShortDesc: "Delete a rack",
	LongDesc: `Delete a rack

Example:
shivas delete rack {Rack Name}
Deletes the given rack and deletes the switches, kvms and rpms associated with this rack.`,
	CommandRun: func() subcommands.CommandRun {
		c := &deleteRack{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.skipYes, "yes", true, "Skip yes option by saying yes.")
		return c
	},
}

DeleteRackCmd delete Rack by given name.

View Source
var GetRackCmd = &subcommands.Command{
	UsageLine: "rack ...",
	ShortDesc: "Get rack details by filters",
	LongDesc: `Get rack details by filters

Example:

shivas get rack name1 name2

shivas get rack -n 10

shivas get rack -zone atl97 -state serving

Gets the rack and prints the output in the user-specified format.`,
	CommandRun: func() subcommands.CommandRun {
		c := &getRack{}
		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.bbnums), "bbnum", "breadboard to filter by. Can be specified multiple times.")
		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.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
	},
}

GetRackCmd get rack by given name.

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

Example:

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

Renames the rack and prints the output in the user-specified format.`,
	CommandRun: func() subcommands.CommandRun {
		c := &renameRack{}
		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 rack to rename")
		c.Flags.StringVar(&c.newName, "new-name", "", "the new name of the rack")
		return c
	},
}

RenameRackCmd rename rack by given name.

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

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

		c.Flags.StringVar(&c.rackName, "name", "", "the name of the rack to update")
		c.Flags.StringVar(&c.zoneName, "zone", "", cmdhelp.ZoneHelpText)
		c.Flags.IntVar(&c.bbNum, "bbnum", 0, "indicate the breadboard number of the rack. To clear this field set it to -1.")
		c.Flags.IntVar(&c.capacity, "capacity_ru", 0, "indicate the size of the rack in rack units (U). "+"To clear this field set it to -1.")
		c.Flags.Var(flag.StringSlice(&c.tags), "tag", "Name(s) of tag(s). Can be specified multiple times. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.state, "state", "", cmdhelp.StateHelp)
		return c
	},
}

UpdateRackCmd update Rack 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