brokerapi

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2021 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewBroker

func NewBroker(cp *crossplane.Crossplane) *Broker

NewBroker sets up a new 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

func (b BrokerAPI) Services(ctx context.Context) ([]domain.Service, error)

Services gets the catalog of services offered by the service broker

GET /v2/catalog

func (BrokerAPI) Unbind

func (b BrokerAPI) Unbind(ctx context.Context, instanceID, bindingID string, details domain.UnbindDetails, asyncAllowed bool) (domain.UnbindSpec, error)

Unbind deletes an existing service binding

DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}

func (BrokerAPI) Update

func (b BrokerAPI) Update(ctx context.Context, instanceID string, details domain.UpdateDetails, asyncAllowed bool) (domain.UpdateServiceSpec, error)

Update modifies an existing service instance

PATCH /v2/service_instances/{instance_id}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL