MCPcopy Create free account
hub / github.com/cloudfoundry/cli / Requirements

Method Requirements

cf/commands/service/bind_route_service.go:67–86  ·  view source on GitHub ↗
(requirementsFactory requirements.Factory, fc flags.FlagContext)

Source from the content-addressed store, hash-verified

65}
66
67func (cmd *BindRouteService) Requirements(requirementsFactory requirements.Factory, fc flags.FlagContext) ([]requirements.Requirement, error) {
68 if len(fc.Args()) != 2 {
69 cmd.ui.Failed(T("Incorrect Usage. Requires DOMAIN and SERVICE_INSTANCE as arguments\n\n") + commandregistry.Commands.CommandUsage("bind-route-service"))
70 return nil, fmt.Errorf("Incorrect usage: %d arguments of %d required", len(fc.Args()), 2)
71 }
72
73 domainName := fc.Args()[0]
74 cmd.domainReq = requirementsFactory.NewDomainRequirement(domainName)
75
76 serviceName := fc.Args()[1]
77 cmd.serviceInstanceReq = requirementsFactory.NewServiceInstanceRequirement(serviceName)
78
79 reqs := []requirements.Requirement{
80 requirementsFactory.NewLoginRequirement(),
81 requirementsFactory.NewTargetedSpaceRequirement(),
82 cmd.domainReq,
83 cmd.serviceInstanceReq,
84 }
85 return reqs, nil
86}
87
88func (cmd *BindRouteService) SetDependency(deps commandregistry.Dependency, pluginCall bool) commandregistry.Command {
89 cmd.ui = deps.UI

Callers

nothing calls this directly

Calls 7

CommandUsageMethod · 0.80
ArgsMethod · 0.65
FailedMethod · 0.65
NewDomainRequirementMethod · 0.65
NewLoginRequirementMethod · 0.65

Tested by

no test coverage detected