brokers

package
v5.0.0-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUserInput        = brokerapi.NewFailureResponse(errors.New(invalidUserInputMsg), http.StatusBadRequest, "parsing-user-request")
	ErrGetInstancesUnsupported = brokerapi.NewFailureResponse(errors.New("the service_instances endpoint is unsupported"), http.StatusBadRequest, "unsupported")
	ErrGetBindingsUnsupported  = brokerapi.NewFailureResponse(errors.New("the service_bindings endpoint is unsupported"), http.StatusBadRequest, "unsupported")
)

Functions

This section is empty.

Types

type BrokerConfig

type BrokerConfig struct {
	HttpConfig *jwt.Config
	ProjectId  string
	Registry   broker.BrokerRegistry
}

func NewBrokerConfigFromEnv

func NewBrokerConfigFromEnv() (*BrokerConfig, error)

type GCPServiceBroker

type GCPServiceBroker struct {
	Logger lager.Logger
	// contains filtered or unexported fields
}

GCPServiceBroker is a brokerapi.ServiceBroker that can be used to generate an OSB compatible service broker.

func New

func New(cfg *BrokerConfig, logger lager.Logger) (*GCPServiceBroker, error)

New creates a GCPServiceBroker. Exactly one of GCPServiceBroker or error will be nil when returned.

func (*GCPServiceBroker) Bind

func (gcpBroker *GCPServiceBroker) Bind(ctx context.Context, instanceID, bindingID string, details brokerapi.BindDetails, clientSupportsAsync bool) (brokerapi.Binding, error)

Bind creates an account with credentials to access an instance of a service. It is bound to the `PUT /v2/service_instances/:instance_id/service_bindings/:binding_id` endpoint and can be called using the `cf bind-service` command.

func (*GCPServiceBroker) Deprovision

func (gcpBroker *GCPServiceBroker) Deprovision(ctx context.Context, instanceID string, details brokerapi.DeprovisionDetails, clientSupportsAsync bool) (response brokerapi.DeprovisionServiceSpec, err error)

Deprovision destroys an existing instance of a service. It is bound to the `DELETE /v2/service_instances/:instance_id` endpoint and can be called using the `cf delete-service` command. If a deprovision is asynchronous, the returned DeprovisionServiceSpec will contain the operation ID for tracking its progress.

func (*GCPServiceBroker) GetBinding

func (broker *GCPServiceBroker) GetBinding(ctx context.Context, instanceID, bindingID string) (brokerapi.GetBindingSpec, error)

GetBinding fetches an existing service binding. GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}

NOTE: This functionality is not implemented.

func (*GCPServiceBroker) GetInstance

func (broker *GCPServiceBroker) GetInstance(ctx context.Context, instanceID string) (brokerapi.GetInstanceDetailsSpec, error)

GetInstance fetches information about a service instance GET /v2/service_instances/{instance_id}

NOTE: This functionality is not implemented.

func (*GCPServiceBroker) LastBindingOperation

func (broker *GCPServiceBroker) LastBindingOperation(ctx context.Context, instanceID, bindingID string, details brokerapi.PollDetails) (brokerapi.LastOperation, error)

LastBindingOperation fetches last operation state for a service binding. GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation

NOTE: This functionality is not implemented.

func (*GCPServiceBroker) LastOperation

func (gcpBroker *GCPServiceBroker) LastOperation(ctx context.Context, instanceID string, details brokerapi.PollDetails) (brokerapi.LastOperation, error)

LastOperation fetches last operation state for a service instance. It is bound to the `GET /v2/service_instances/:instance_id/last_operation` endpoint. It is called by `cf create-service` or `cf delete-service` if the operation was asynchronous.

func (*GCPServiceBroker) Provision

func (gcpBroker *GCPServiceBroker) Provision(ctx context.Context, instanceID string, details brokerapi.ProvisionDetails, clientSupportsAsync bool) (brokerapi.ProvisionedServiceSpec, error)

Provision creates a new instance of a service. It is bound to the `PUT /v2/service_instances/:instance_id` endpoint and can be called using the `cf create-service` command.

func (*GCPServiceBroker) Services

func (gcpBroker *GCPServiceBroker) Services(ctx context.Context) ([]brokerapi.Service, error)

Services lists services in the broker's catalog. It is called through the `GET /v2/catalog` endpoint or the `cf marketplace` command.

func (*GCPServiceBroker) Unbind

func (gcpBroker *GCPServiceBroker) Unbind(ctx context.Context, instanceID, bindingID string, details brokerapi.UnbindDetails, asyncSupported bool) (brokerapi.UnbindSpec, error)

Unbind destroys an account and credentials with access to an instance of a service. It is bound to the `DELETE /v2/service_instances/:instance_id/service_bindings/:binding_id` endpoint and can be called using the `cf unbind-service` command.

func (*GCPServiceBroker) Update

func (gcpBroker *GCPServiceBroker) Update(ctx context.Context, instanceID string, details brokerapi.UpdateDetails, asyncAllowed bool) (brokerapi.UpdateServiceSpec, error)

Update a service instance plan. This functionality is not implemented and will return an error indicating that plan changes are not supported.

Jump to

Keyboard shortcuts

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