Documentation ¶
Index ¶
- Variables
- func APIResponseError(rctx *reqcontext.ReqContext, err error) error
- type Broker
- func (b Broker) Bind(rctx *reqcontext.ReqContext, instanceID, bindingID, planID string) (domain.Binding, error)
- func (b Broker) Deprovision(rctx *reqcontext.ReqContext, instanceID, planID string) (domain.DeprovisionServiceSpec, error)
- func (b Broker) GetBinding(rctx *reqcontext.ReqContext, instanceID, bindingID string) (domain.GetBindingSpec, error)
- func (b Broker) GetInstance(rctx *reqcontext.ReqContext, instanceID string) (domain.GetInstanceDetailsSpec, error)
- func (b Broker) LastOperation(rctx *reqcontext.ReqContext, instanceID, planID string) (domain.LastOperation, error)
- func (b Broker) Provision(rctx *reqcontext.ReqContext, instanceID, planID string, params json.RawMessage) (domain.ProvisionedServiceSpec, error)
- func (b Broker) Services(rctx *reqcontext.ReqContext) ([]domain.Service, error)
- func (b Broker) Unbind(rctx *reqcontext.ReqContext, instanceID, bindingID, planID string) (domain.UnbindSpec, error)
- func (b Broker) Update(rctx *reqcontext.ReqContext, ...) (domain.UpdateServiceSpec, error)
- type BrokerAPI
- func (b BrokerAPI) Bind(ctx context.Context, instanceID, bindingID string, details domain.BindDetails, ...) (domain.Binding, error)
- func (b BrokerAPI) Deprovision(ctx context.Context, instanceID string, details domain.DeprovisionDetails, ...) (domain.DeprovisionServiceSpec, error)
- func (b BrokerAPI) GetBinding(ctx context.Context, instanceID, bindingID string) (domain.GetBindingSpec, error)
- func (b BrokerAPI) GetInstance(ctx context.Context, instanceID string) (domain.GetInstanceDetailsSpec, error)
- func (b BrokerAPI) LastBindingOperation(ctx context.Context, instanceID, bindingID string, details domain.PollDetails) (domain.LastOperation, error)
- func (b BrokerAPI) LastOperation(ctx context.Context, instanceID string, details domain.PollDetails) (domain.LastOperation, error)
- func (b BrokerAPI) Provision(ctx context.Context, instanceID string, details domain.ProvisionDetails, ...) (domain.ProvisionedServiceSpec, error)
- func (b BrokerAPI) Services(ctx context.Context) ([]domain.Service, error)
- func (b BrokerAPI) Unbind(ctx context.Context, instanceID, bindingID string, ...) (domain.UnbindSpec, error)
- func (b BrokerAPI) Update(ctx context.Context, instanceID string, details domain.UpdateDetails, ...) (domain.UpdateServiceSpec, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrServiceUpdateNotPermitted when updating an instance ErrServiceUpdateNotPermitted = errors.New("service update not permitted") // ErrPlanChangeNotPermitted when updating an instance's plan (only premium<->standard is permitted) ErrPlanChangeNotPermitted = errors.New("plan change not permitted") )
Functions ¶
func APIResponseError ¶
func APIResponseError(rctx *reqcontext.ReqContext, err error) error
APIResponseError converts an error to a proper API error
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker implements the service broker
func (Broker) Bind ¶
func (b Broker) Bind(rctx *reqcontext.ReqContext, instanceID, bindingID, planID string) (domain.Binding, error)
Bind creates a binding between a provisioned service instance and an application.
func (Broker) Deprovision ¶
func (b Broker) Deprovision(rctx *reqcontext.ReqContext, instanceID, planID string) (domain.DeprovisionServiceSpec, error)
Deprovision removes a provisioned instance.
func (Broker) GetBinding ¶
func (b Broker) GetBinding(rctx *reqcontext.ReqContext, instanceID, bindingID string) (domain.GetBindingSpec, error)
GetBinding retrieves a binding to get credentials.
func (Broker) GetInstance ¶
func (b Broker) GetInstance(rctx *reqcontext.ReqContext, instanceID string) (domain.GetInstanceDetailsSpec, error)
GetInstance gets a provisioned instance.
func (Broker) LastOperation ¶
func (b Broker) LastOperation(rctx *reqcontext.ReqContext, instanceID, planID string) (domain.LastOperation, error)
LastOperation retrieves an instance's status.
func (Broker) Provision ¶
func (b Broker) Provision(rctx *reqcontext.ReqContext, instanceID, planID string, params json.RawMessage) (domain.ProvisionedServiceSpec, error)
Provision creates a new service instance.
func (Broker) Services ¶
func (b Broker) Services(rctx *reqcontext.ReqContext) ([]domain.Service, error)
Services retrieves registered services and plans.
func (Broker) Unbind ¶
func (b Broker) Unbind(rctx *reqcontext.ReqContext, instanceID, bindingID, planID string) (domain.UnbindSpec, error)
Unbind removes a binding.
func (Broker) Update ¶
func (b Broker) Update(rctx *reqcontext.ReqContext, instanceID, serviceID, oldPlanID, newPlanID string) (domain.UpdateServiceSpec, error)
Update allows to change the SLA level from standard -> premium (and vice-versa).
type BrokerAPI ¶
type BrokerAPI struct {
// contains filtered or unexported fields
}
BrokerAPI implements a ServiceBroker.
func New ¶
func New(cp *crossplane.Crossplane, logger lager.Logger) *BrokerAPI
New sets up a new broker api
func (BrokerAPI) Bind ¶
func (b BrokerAPI) Bind(ctx context.Context, instanceID, bindingID string, details domain.BindDetails, asyncAllowed bool) (domain.Binding, error)
Bind creates a new service binding
PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}
func (BrokerAPI) Deprovision ¶
func (b BrokerAPI) Deprovision(ctx context.Context, instanceID string, details domain.DeprovisionDetails, asyncAllowed bool) (domain.DeprovisionServiceSpec, error)
Deprovision deletes an existing service instance
DELETE /v2/service_instances/{instance_id}
func (BrokerAPI) GetBinding ¶
func (b BrokerAPI) GetBinding(ctx context.Context, instanceID, bindingID string) (domain.GetBindingSpec, error)
GetBinding fetches an existing service binding
GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}
TODO(mw): adjust to use details.PlanID when https://github.com/pivotal-cf/brokerapi/pull/138 is merged.
func (BrokerAPI) GetInstance ¶
func (b BrokerAPI) GetInstance(ctx context.Context, instanceID string) (domain.GetInstanceDetailsSpec, error)
GetInstance fetches information about a service instance
GET /v2/service_instances/{instance_id}
func (BrokerAPI) LastBindingOperation ¶
func (b BrokerAPI) LastBindingOperation(ctx context.Context, instanceID, bindingID string, details domain.PollDetails) (domain.LastOperation, error)
LastBindingOperation fetches last operation state for a service binding
GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation
func (BrokerAPI) LastOperation ¶
func (b BrokerAPI) LastOperation(ctx context.Context, instanceID string, details domain.PollDetails) (domain.LastOperation, error)
LastOperation fetches last operation state for a service instance
GET /v2/service_instances/{instance_id}/last_operation
func (BrokerAPI) Provision ¶
func (b BrokerAPI) Provision(ctx context.Context, instanceID string, details domain.ProvisionDetails, asyncAllowed bool) (domain.ProvisionedServiceSpec, error)
Provision creates a new service instance
PUT /v2/service_instances/{instance_id}
func (BrokerAPI) Services ¶
Services gets the catalog of services offered by the service broker
GET /v2/catalog