broker

package
v0.0.0-...-51a7f25 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package broker holds the implementation of brokerapi.ServiceBroker interface.

Index

Constants

View Source
const (
	LogKeyAppID                      = "application-id"
	LogKeyServiceID                  = "service-id"
	LogKeyPlanID                     = "plan-id"
	LogKeyInstanceID                 = "instance-id"
	LogKeyBindID                     = "bind-id"
	LogKeyApplicationName            = "application-name"
	LogKeyPlatformApplicationName    = "platform-application-name"
	ApplicationDashboardURL          = "application-dashboard-url"
	ErrMsgUnableToStoreInstance      = "unable to store service instance in database"
	ErrActionDelAPP                  = "delete Application"
	ErrMsgUnableDelInstance          = "unable to delete service instance"
	ErrMsgUnableToGetBind            = "unable to retrieve Bind from the database"
	ErrMsgUnableToGenInputSchema     = "unable to generate %s plan input Schema"
	ErrMsgUnableToGenBindInputSchema = "unable to generate %s plan bind input Schema"
	ErrMsgInvalidPlanID              = "invalid plan id"
	ErrMsgUnableGenerateKeys         = "unable generate keys for application"
	ServiceID                        = "460F28F9-4D05-4889-970A-6BF5FB7D3CF8"
	ServiceName                      = "wso2apim-service"
	ServiceDescription               = "Manages WSO2 API Manager artifacts"
	ApplicationPlanID                = "00e851cd-ce8b-43eb-bc27-ac4d4fbb3204"
	ApplicationPlanName              = "app"
	ApplicationPlanDescription       = "Creates an Application with a set of subscription for a given set of APIs in WSO2 API Manager"
	DebugMsgDelInstance              = "delete instance"
	ApplicationPrefix                = "ServiceBroker_"
)

Variables

View Source
var (
	ErrNotSupported   = errors.New("not supported")
	ErrInvalidSVCPlan = errors.New("invalid service or getServices")
)

Functions

This section is empty.

Types

type API

type API struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

API struct represent an API.

type APIM

type APIM struct{}

APIM struct implements the interface brokerapi.ServiceBroker.

func (*APIM) Bind

func (apimBroker *APIM) Bind(ctx context.Context, svcInstanceID, bindingID string,
	bindDetails domain.BindDetails, asyncAllowed bool) (domain.Binding, error)

Bind method creates a Bind between given Service instance and the App.

func (*APIM) Deprovision

func (apimBroker *APIM) Deprovision(ctx context.Context, svcInstanceID string,
	serviceDetails domain.DeprovisionDetails, asyncAllowed bool) (domain.DeprovisionServiceSpec, error)

func (*APIM) GetBinding

func (apimBroker *APIM) GetBinding(ctx context.Context, svcInstanceID,
	bindingID string) (domain.GetBindingSpec, error)

func (*APIM) GetInstance

func (apimBroker *APIM) GetInstance(ctx context.Context,
	svcInstanceID string) (domain.GetInstanceDetailsSpec, error)

func (*APIM) Init

func (apimBroker *APIM) Init()

Init method initialize the API-M broker. If there is an error it will cause a panic.

func (*APIM) LastBindingOperation

func (apimBroker *APIM) LastBindingOperation(ctx context.Context, svcInstanceID,
	bindingID string, details domain.PollDetails) (domain.LastOperation, error)

func (*APIM) LastOperation

func (apimBroker *APIM) LastOperation(ctx context.Context, svcInstanceID string,
	details domain.PollDetails) (domain.LastOperation, error)

LastOperation ... If the broker provisions asynchronously, the Cloud Controller will poll this endpoint for the status of the provisioning operation.

func (*APIM) Provision

func (apimBroker *APIM) Provision(ctx context.Context, svcInstanceID string,
	provisionDetails domain.ProvisionDetails, asyncAllowed bool) (domain.ProvisionedServiceSpec, error)

func (*APIM) Services

func (apimBroker *APIM) Services(ctx context.Context) ([]domain.Service, error)

Services returns the getServices offered(catalog) by this broker.

func (*APIM) Unbind

func (apimBroker *APIM) Unbind(ctx context.Context, svcInstanceID, bindingID string,
	unbindDetails domain.UnbindDetails, asyncAllowed bool) (domain.UnbindSpec, error)

Unbind deletes the Bind from database and returns domain.UnbindSpec struct and any error encountered.

func (*APIM) Update

func (apimBroker *APIM) Update(cxt context.Context, svcInstanceID string,
	updateDetails domain.UpdateDetails, asyncAllowed bool) (domain.UpdateServiceSpec, error)

type ServiceParams

type ServiceParams struct {
	APIs []API `json:"apis" hash:"set"`
}

ServiceParams represents the SVC create and update parameter.

Jump to

Keyboard shortcuts

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