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

Method Create

cf/api/service_brokers.go:76–96  ·  view source on GitHub ↗
(name, url, username, password, spaceGUID string)

Source from the content-addressed store, hash-verified

74}
75
76func (repo CloudControllerServiceBrokerRepository) Create(name, url, username, password, spaceGUID string) error {
77 path := "/v2/service_brokers"
78 args := struct {
79 Name string `json:"name"`
80 URL string `json:"broker_url"`
81 Username string `json:"auth_username"`
82 Password string `json:"auth_password"`
83 SpaceGUID string `json:"space_guid,omitempty"`
84 }{
85 name,
86 url,
87 username,
88 password,
89 spaceGUID,
90 }
91 bs, err := json.Marshal(args)
92 if err != nil {
93 return err
94 }
95 return repo.gateway.CreateResource(repo.config.APIEndpoint(), path, bytes.NewReader(bs))
96}
97
98func (repo CloudControllerServiceBrokerRepository) Update(serviceBroker models.ServiceBroker) (apiErr error) {
99 path := fmt.Sprintf("/v2/service_brokers/%s", serviceBroker.GUID)

Callers

nothing calls this directly

Calls 2

CreateResourceMethod · 0.80
APIEndpointMethod · 0.65

Tested by

no test coverage detected