github.com/arunkumar7540/cli@v6.45.0+incompatible/actor/v7action/service_broker.go (about)

     1  package v7action
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
     5  )
     6  
     7  type ServiceBroker ccv3.ServiceBroker
     8  
     9  type ServiceBrokerCredentials ccv3.ServiceBrokerCredentials
    10  
    11  func (actor Actor) GetServiceBrokers() ([]ServiceBroker, Warnings, error) {
    12  	ccv3ServiceBrokers, warnings, err := actor.CloudControllerClient.GetServiceBrokers()
    13  	if err != nil {
    14  		return nil, Warnings(warnings), err
    15  	}
    16  
    17  	var serviceBrokers []ServiceBroker
    18  	for _, broker := range ccv3ServiceBrokers {
    19  		serviceBrokers = append(serviceBrokers, ServiceBroker(broker))
    20  	}
    21  
    22  	return serviceBrokers, Warnings(warnings), nil
    23  }
    24  
    25  func (actor Actor) CreateServiceBroker(credentials ServiceBrokerCredentials) (Warnings, error) {
    26  	warnings, err := actor.CloudControllerClient.CreateServiceBroker(ccv3.ServiceBrokerCredentials(credentials))
    27  	return Warnings(warnings), err
    28  }