MCPcopy Index your code
hub / github.com/cloudfoundry/cli / UpgradeManagedServiceInstance

Method UpgradeManagedServiceInstance

actor/v7action/service_instance.go:154–190  ·  view source on GitHub ↗
(serviceInstanceName string, spaceGUID string)

Source from the content-addressed store, hash-verified

152}
153
154func (actor Actor) UpgradeManagedServiceInstance(serviceInstanceName string, spaceGUID string) (chan PollJobEvent, Warnings, error) {
155 var (
156 serviceInstance resources.ServiceInstance
157 servicePlan resources.ServicePlan
158 jobURL ccv3.JobURL
159 stream chan PollJobEvent
160 )
161
162 warnings, err := railway.Sequentially(
163 func() (warnings ccv3.Warnings, err error) {
164 serviceInstance, _, warnings, err = actor.getServiceInstanceByNameAndSpace(serviceInstanceName, spaceGUID)
165 return
166 },
167 func() (warnings ccv3.Warnings, err error) {
168 if serviceInstance.UpgradeAvailable.Value != true {
169 err = actionerror.ServiceInstanceUpgradeNotAvailableError{}
170 }
171 return
172 },
173 func() (warnings ccv3.Warnings, err error) {
174 servicePlan, warnings, err = actor.CloudControllerClient.GetServicePlanByGUID(serviceInstance.ServicePlanGUID)
175 return
176 },
177 func() (warnings ccv3.Warnings, err error) {
178 jobURL, warnings, err = actor.CloudControllerClient.UpdateServiceInstance(serviceInstance.GUID, resources.ServiceInstance{
179 MaintenanceInfoVersion: servicePlan.MaintenanceInfoVersion,
180 })
181 return
182 },
183 func() (warnings ccv3.Warnings, err error) {
184 stream = actor.PollJobToEventStream(jobURL)
185 return
186 },
187 )
188
189 return stream, Warnings(warnings), err
190}
191
192func (actor Actor) RenameServiceInstance(currentServiceInstanceName, spaceGUID, newServiceInstanceName string) (Warnings, error) {
193 var (

Callers

nothing calls this directly

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 6

PollJobToEventStreamMethod · 0.95
SequentiallyFunction · 0.92
WarningsTypeAlias · 0.70
GetServicePlanByGUIDMethod · 0.65
UpdateServiceInstanceMethod · 0.65

Tested by

no test coverage detected