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

Method DisableServiceAccess

actor/v7action/service_access.go:145–185  ·  view source on GitHub ↗
(offeringName, brokerName, orgName, planName string)

Source from the content-addressed store, hash-verified

143}
144
145func (actor *Actor) DisableServiceAccess(offeringName, brokerName, orgName, planName string) (SkippedPlans, Warnings, error) {
146 var allWarnings Warnings
147
148 offering, offeringWarnings, err := actor.CloudControllerClient.GetServiceOfferingByNameAndBroker(offeringName, brokerName)
149 allWarnings = append(allWarnings, offeringWarnings...)
150 if err != nil {
151 return SkippedPlans{}, allWarnings, actionerror.EnrichAPIErrors(err)
152 }
153
154 plansQuery := buildPlansFilterForUpdate(offering.GUID, planName)
155 plans, planWarnings, err := actor.CloudControllerClient.GetServicePlans(plansQuery...)
156 allWarnings = append(allWarnings, planWarnings...)
157 if err != nil {
158 return SkippedPlans{}, allWarnings, err
159 }
160
161 if len(plans) == 0 {
162 return SkippedPlans{}, allWarnings, actionerror.ServicePlanNotFoundError{
163 PlanName: planName,
164 OfferingName: offeringName,
165 }
166 }
167
168 if offeringIsSpaceScoped(plans) {
169 return SkippedPlans{}, allWarnings, actionerror.ServicePlanVisibilityTypeError{}
170 }
171
172 var (
173 disableWarnings Warnings
174 skipped SkippedPlans
175 )
176
177 if orgName != "" {
178 skipped, disableWarnings, err = actor.disableOrganizationServiceAccess(plans, orgName)
179 } else {
180 skipped, disableWarnings, err = actor.disableAllServiceAccess(plans)
181 }
182
183 allWarnings = append(allWarnings, disableWarnings...)
184 return skipped, allWarnings, err
185}
186
187func (actor *Actor) disableAllServiceAccess(plans []resources.ServicePlan) (SkippedPlans, Warnings, error) {
188 var (

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 7

EnrichAPIErrorsFunction · 0.92
offeringIsSpaceScopedFunction · 0.85
GetServicePlansMethod · 0.65

Tested by

no test coverage detected