(params CreateManagedServiceInstanceParams)
| 66 | } |
| 67 | |
| 68 | func (actor Actor) CreateManagedServiceInstance(params CreateManagedServiceInstanceParams) (chan PollJobEvent, Warnings, error) { |
| 69 | var ( |
| 70 | servicePlan resources.ServicePlan |
| 71 | jobURL ccv3.JobURL |
| 72 | ) |
| 73 | |
| 74 | warnings, err := railway.Sequentially( |
| 75 | func() (warnings ccv3.Warnings, err error) { |
| 76 | var v7Warnings Warnings |
| 77 | servicePlan, v7Warnings, err = actor.GetServicePlanByNameOfferingAndBroker( |
| 78 | params.ServicePlanName, |
| 79 | params.ServiceOfferingName, |
| 80 | params.ServiceBrokerName, |
| 81 | ) |
| 82 | return ccv3.Warnings(v7Warnings), err |
| 83 | }, |
| 84 | func() (warnings ccv3.Warnings, err error) { |
| 85 | serviceInstance := resources.ServiceInstance{ |
| 86 | Type: resources.ManagedServiceInstance, |
| 87 | Name: params.ServiceInstanceName, |
| 88 | ServicePlanGUID: servicePlan.GUID, |
| 89 | SpaceGUID: params.SpaceGUID, |
| 90 | Tags: params.Tags, |
| 91 | Parameters: params.Parameters, |
| 92 | } |
| 93 | |
| 94 | jobURL, warnings, err = actor.CloudControllerClient.CreateServiceInstance(serviceInstance) |
| 95 | return |
| 96 | }, |
| 97 | ) |
| 98 | switch e := err.(type) { |
| 99 | case nil: |
| 100 | return actor.PollJobToEventStream(jobURL), Warnings(warnings), nil |
| 101 | case actionerror.DuplicateServicePlanError: |
| 102 | return nil, Warnings(warnings), actionerror.ServiceBrokerNameRequiredError{ |
| 103 | ServiceOfferingName: e.ServiceOfferingName, |
| 104 | } |
| 105 | default: |
| 106 | return nil, Warnings(warnings), err |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func (actor Actor) UpdateManagedServiceInstance(params UpdateManagedServiceInstanceParams) (chan PollJobEvent, Warnings, error) { |
| 111 | var ( |
nothing calls this directly
no test coverage detected