示例#1
0
文件: app.go 项目: logdns/conoha-iso
func (app *ConoHaIso) insert(flags []cli.Flag) cli.Command {
	cmd := cli.Command{
		Name:  "insert",
		Usage: "Insert an ISO images to the VPS.",
		Flags: flags,
		After: app.afterAction,
		Action: func(c *cli.Context) {
			ident, err := app.auth(c)
			if err != nil {
				app.lastError = err
				return
			}

			var compute *command.Compute
			compute = command.NewCompute(ident)

			err = compute.Insert()
			if err != nil {
				app.lastError = err
				return
			}
			log.Info("ISO file was inserted and changed boot device.")
		},
	}
	return cmd
}