示例#1
0
文件: app.go 项目: logdns/conoha-iso
func (app *ConoHaIso) eject(flags []cli.Flag) cli.Command {
	cmd := cli.Command{
		Name:  "eject",
		Usage: "Eject an ISO image from 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.Eject()
			if err != nil {
				app.lastError = err
				return
			}
			log.Info("ISO file was ejected.")
		},
	}
	return cmd
}