func (cmd ListServices) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { reqs = append(reqs, reqFactory.NewLoginRequirement(), reqFactory.NewTargetedSpaceRequirement(), ) return }
func (cmd ListSpaces) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), reqFactory.NewTargetedOrgRequirement(), } return }
func (cmd Push) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), reqFactory.NewSpaceRequirement(), } return }
func (cmd PurgeServiceOffering) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("incorrect usage") cmd.ui.FailWithUsage(c, "purge-service-offering") } reqs = []requirements.Requirement{reqFactory.NewLoginRequirement()} return }
func (cmd CreateQuota) GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) ([]requirements.Requirement, error) { if len(context.Args()) != 1 { cmd.ui.FailWithUsage(context, "create-quota") } return []requirements.Requirement{ requirementsFactory.NewLoginRequirement(), }, nil }
func (cmd CreateUserProvidedService) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "create-user-provided-service") return } reqs = append(reqs, requirementsFactory.NewLoginRequirement()) return }
func (cmd CreateUserFields) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "create-user") } reqs = append(reqs, reqFactory.NewLoginRequirement()) return }
func (cmd DeleteServiceBroker) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "delete-service-broker") return } reqs = append(reqs, requirementsFactory.NewLoginRequirement()) return }
func (cmd *DeleteOrg) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "delete-org") return } reqs = []requirements.Requirement{requirementsFactory.NewLoginRequirement()} return }
func (cmd *RenameBuildpack) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "rename-buildpack") return } reqs = []requirements.Requirement{requirementsFactory.NewLoginRequirement()} return }
func (cmd DeleteServiceAuthToken) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect usage") cmd.ui.FailWithUsage(c, "delete-service-auth-token") return } reqs = append(reqs, reqFactory.NewLoginRequirement()) return }
func (cmd Authenticate) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "auth") return } reqs = append(reqs, reqFactory.NewApiEndpointRequirement()) return }
func (l *RecentLogs) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) == 0 { err = errors.New("Incorrect Usage") l.ui.FailWithUsage(c, "logs") return } l.appReq = reqFactory.NewApplicationRequirement(c.Args()[0]) reqs = []requirements.Requirement{l.appReq} return }
func (cmd DeleteUser) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Invalid usage") cmd.ui.FailWithUsage(c, "delete-user") return } reqs = append(reqs, reqFactory.NewLoginRequirement()) return }
func (cmd *Delete) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) == 0 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "delete") return } cmd.appReq = reqFactory.NewApplicationRequirement(c.Args()[0]) reqs = []requirements.Requirement{cmd.appReq} return }
func (cmd *CreateSharedDomain) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "create-shared-domain") return } reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), } return }
func (cmd Target) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 0 { err = errors.New("incorrect usage") cmd.ui.FailWithUsage(c, "target") return } if c.String("o") != "" || c.String("s") != "" { reqs = append(reqs, reqFactory.NewLoginRequirement()) } return }
func (s *Stop) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) == 0 { err = errors.New("Incorrect Usage") s.ui.FailWithUsage(c, "stop") return } s.appReq = reqFactory.NewApplicationRequirement(c.Args()[0]) reqs = []requirements.Requirement{s.appReq} return }
func (cmd CreateServiceAuthTokenFields) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 3 { err = errors.New("Incorrect usage") cmd.ui.FailWithUsage(c, "create-service-auth-token") return } reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), } return }
func (cmd *MigrateServiceInstances) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 5 { err = errors.New("incorrect usage") cmd.ui.FailWithUsage(c, "migrate-service-instances") return } reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), } return }
func (cmd *Curl) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect number of arguments") cmd.ui.FailWithUsage(c, "curl") return } reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), } return }
func (cmd *RenameOrg) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "rename-org") return } cmd.orgReq = reqFactory.NewOrganizationRequirement(c.Args()[0]) reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), cmd.orgReq, } return }
func (cmd CreateSpace) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) == 0 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "create-space") return } reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), reqFactory.NewTargetedOrgRequirement(), } return }
func (cmd *Push) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) > 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "push") return } reqs = []requirements.Requirement{ requirementsFactory.NewLoginRequirement(), requirementsFactory.NewTargetedSpaceRequirement(), } return }
func (cmd *OrgUsers) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect usage") cmd.ui.FailWithUsage(c, "org-users") return } orgName := c.Args()[0] cmd.orgReq = requirementsFactory.NewOrganizationRequirement(orgName) reqs = append(reqs, requirementsFactory.NewLoginRequirement(), cmd.orgReq) return }
func (cmd *ListDomains) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) > 0 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "domains") return } cmd.orgReq = reqFactory.NewTargetedOrgRequirement() reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), cmd.orgReq, } return }
func (cmd *DeleteBuildpack) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "delete-buildpack") return } loginReq := reqFactory.NewLoginRequirement() reqs = []requirements.Requirement{ loginReq, } return }
func (cmd *Env) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) < 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "env") return } cmd.appReq = reqFactory.NewApplicationRequirement(c.Args()[0]) reqs = []requirements.Requirement{ reqFactory.NewLoginRequirement(), cmd.appReq, } return }
func (cmd *UnbindService) GetRequirements(reqFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 2 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "unbind-service") return } appName := c.Args()[0] serviceName := c.Args()[1] cmd.appReq = reqFactory.NewApplicationRequirement(appName) cmd.serviceInstanceReq = reqFactory.NewServiceInstanceRequirement(serviceName) reqs = []requirements.Requirement{cmd.appReq, cmd.serviceInstanceReq} return }
func (cmd *UpdateUserProvidedService) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) { if len(c.Args()) != 1 { err = errors.New("Incorrect Usage") cmd.ui.FailWithUsage(c, "update-user-provided-service") return } cmd.serviceInstanceReq = requirementsFactory.NewServiceInstanceRequirement(c.Args()[0]) reqs = []requirements.Requirement{ requirementsFactory.NewLoginRequirement(), cmd.serviceInstanceReq, } return }