asset

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddAssetCmd = &subcommands.Command{
	UsageLine: "asset [options...]",
	ShortDesc: "Add an asset(Chromebook, Servo, Labstation)",
	LongDesc:  cmdhelp.AddAssetLongDesc,
	CommandRun: func() subcommands.CommandRun {
		c := &addAsset{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)

		c.Flags.BoolVar(&c.interactive, "i", false, "Interactive mode")
		c.Flags.BoolVar(&c.scan, "scan", false, "scan location followed by asset using a barcode scanner")
		c.Flags.StringVar(&c.newSpecsFile, "f", "", cmdhelp.AddAssetFileText)
		c.Flags.StringVar(&c.name, "name", "", "Asset tag of the asset")
		c.Flags.StringVar(&c.location, "location", "", "location of the asset in barcode format")
		c.Flags.StringVar(&c.zone, "zone", "", "Zone that the asset is in. "+cmdhelp.ZoneFilterHelpText)
		c.Flags.StringVar(&c.aisle, "aisle", "", "Aisle that the asset is in")
		c.Flags.StringVar(&c.row, "row", "", "Row that the asset is in")
		c.Flags.StringVar(&c.rack, "rack", "", "Rack that the asset is in")
		c.Flags.StringVar(&c.shelf, "shelf", "", "Shelf on the rack that the asset is in")
		c.Flags.StringVar(&c.position, "position", "", "Position that the asset is in")
		c.Flags.StringVar(&c.model, "model", "", "model of the asset")
		c.Flags.StringVar(&c.board, "board", "", "board/build target of the device")
		c.Flags.StringVar(&c.assetType, "type", "", "Type of asset. "+cmdhelp.AssetTypesHelpText)
		c.Flags.StringVar(&c.tags, "tags", "", "comma separated tags. You can only append/add new tags here.")
		return c
	},
}

AddAssetCmd add an asset to database

View Source
var DeleteAssetCmd = &subcommands.Command{
	UsageLine: "asset {assetname}...",
	ShortDesc: "Delete an asset(Chromebook, Servo, Labstation)",
	LongDesc: `Delete an asset.

Example:
shivas delete asset {assetname}

shivas delete asset {assetname1} {assetname2}

shivas delete asset -scan

Deletes the Asset(s).`,
	CommandRun: func() subcommands.CommandRun {
		c := &deleteAsset{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.Flags.BoolVar(&c.scan, "scan", false, "Use barcode scanner to delete multiple assets.")
		return c
	},
}

DeleteAssetCmd delete a asset on a machine.

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

Example:

shivas get asset {name1} {name2}

shivas get asset -zone atl97

Gets the asset and prints the output in the user-specified format.`,
	CommandRun: func() subcommands.CommandRun {
		c := &getAsset{}
		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.assettypes), "assettype", "Name(s) of a assettype to filter by. Can be specified multiple times."+cmdhelp.AssetTypesHelpText)
		c.Flags.Var(flag.StringSlice(&c.models), "model", "Name(s) of a model to filter by. Can be specified multiple times.")
		c.Flags.Var(flag.StringSlice(&c.buildTargets), "board", "Name(s) of a build target/board to filter by. Can be specified multiple times.")
		c.Flags.Var(flag.StringSlice(&c.phases), "phase", "Name(s) of a phase 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.")
		return c
	},
}

GetAssetCmd get asset by given name.

View Source
var RenameAssetCmd = rename.GenGenericRenameCmd("asset", renameAsset, printAsset)

RenameAssetCmd rename asset by given name.

View Source
var UpdateAssetCmd = &subcommands.Command{
	UsageLine: "asset [Options...]",
	ShortDesc: "Update a asset(Chromebook, Servo, Labstation)",
	LongDesc:  cmdhelp.UpdateAssetLongDesc,
	CommandRun: func() subcommands.CommandRun {
		c := &updateAsset{}
		c.authFlags.Register(&c.Flags, site.DefaultAuthOptions)
		c.envFlags.Register(&c.Flags)
		c.commonFlags.Register(&c.Flags)

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

		c.Flags.StringVar(&c.name, "name", "", "Asset tag of the asset")
		c.Flags.StringVar(&c.location, "location", "", "location of the asset in barcode format. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.zone, "zone", "", "Zone that the asset is in. "+cmdhelp.ZoneFilterHelpText)
		c.Flags.StringVar(&c.aisle, "aisle", "", "Aisle that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.row, "row", "", "Row that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.rack, "rack", "", "Rack name that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.racknumber, "racknumber", "", "Rack number that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.position, "position", "", "Position that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.shelf, "shelf", "", "Shelf that the asset is in. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.barcode, "barcode", "", "barcode of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.assetType, "type", "", "Type of asset. "+cmdhelp.AssetTypesHelpText)
		c.Flags.StringVar(&c.model, "model", "", "model of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.costcenter, "costcenter", "", "Cost center of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.gcn, "gcn", "", "Google code name of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.board, "board", "", "board/build target of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.reference, "reference", "", "Reference board of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.mac, "mac", "", "Mac address of the asset. "+cmdhelp.ClearFieldHelpText)
		c.Flags.StringVar(&c.phase, "phase", "", "Phase of the asset. "+cmdhelp.ClearFieldHelpText)
		return c
	},
}

UpdateAssetCmd Update asset 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