Documentation ¶
Overview ¶
Package broker holds the code that users of the skeleton write for their broker. To make a broker, fill out:
- The Options type, which holds options for the broker
- The AddFlags function, which adds CLI flags for an Options
- The methods of the BusinessLogic type, which implements the broker's business logic
- The NewBusinessLogic function, which creates a BusinessLogic from the Options the program is run with
Index ¶
- func AddFlags(o *Options)
- func ApplyParamsToStatement(statement string, args ...string) string
- func CanBeDeleted(status string) bool
- func CanBeModified(status string) bool
- func CanGetBindings(status string) bool
- func ConflictErrorWithMessage(description string) error
- func CrudeOSBIHacks(router *mux.Router, b *BusinessLogic)
- func FinishedTask(storage Storage, taskId string, retries int64, result string, status string)
- func HttpWrite(w http.ResponseWriter, status int, obj interface{})
- func InProgress(status string) bool
- func InternalServerError() error
- func IsAvailable(status string) bool
- func IsReady(status string) bool
- func IsReadyKubernetes(dep *v1apps.Deployment) bool
- func NotFound() error
- func RandomString(n int) string
- func RestoreBackup(storage Storage, instance *Instance, namePrefix string, backup string) error
- func RunBackgroundTasks(ctx context.Context, o Options) error
- func RunPreprovisionTasks(ctx context.Context, o Options, namePrefix string, storage Storage, wait int64)
- func RunWorkerTasks(ctx context.Context, o Options, namePrefix string, storage Storage) error
- func TickTocPreprovisionTasks(ctx context.Context, o Options, namePrefix string, storage Storage)
- func UnprocessableEntity() error
- func UnprocessableEntityWithMessage(err string, description string) error
- func UpdateTaskStatus(storage Storage, taskId string, retries int64, result string, status string)
- func UpgradeAcrossProviders(storage Storage, from *Instance, toPlanId string, namePrefix string) (string, error)
- func UpgradeWithinProviders(storage Storage, fromDb *Instance, toPlanId string, namePrefix string) (string, error)
- type AWSInstanceMemcachedProvider
- func (provider AWSInstanceMemcachedProvider) CreateBackup(*Instance) (*BackupSpec, error)
- func (provider AWSInstanceMemcachedProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
- func (provider AWSInstanceMemcachedProvider) Flush(Instance *Instance) error
- func (provider AWSInstanceMemcachedProvider) GetBackup(*Instance, string) (*BackupSpec, error)
- func (provider AWSInstanceMemcachedProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
- func (provider AWSInstanceMemcachedProvider) GetUrl(instance *Instance) map[string]interface{}
- func (provider AWSInstanceMemcachedProvider) ListBackups(*Instance) ([]BackupSpec, error)
- func (provider AWSInstanceMemcachedProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
- func (provider AWSInstanceMemcachedProvider) PerformPostProvision(db *Instance) (*Instance, error)
- func (provider AWSInstanceMemcachedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
- func (provider AWSInstanceMemcachedProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *elasticache.CreateCacheClusterInput) (*Instance, error)
- func (provider AWSInstanceMemcachedProvider) Restart(Instance *Instance) error
- func (provider AWSInstanceMemcachedProvider) RestoreBackup(*Instance, string) error
- func (provider AWSInstanceMemcachedProvider) Stats(Instance *Instance) ([]Stat, error)
- func (provider AWSInstanceMemcachedProvider) Tag(Instance *Instance, Name string, Value string) error
- func (provider AWSInstanceMemcachedProvider) Untag(Instance *Instance, Name string) error
- type AWSInstanceRedisProvider
- func (provider AWSInstanceRedisProvider) CreateBackup(instance *Instance) (*BackupSpec, error)
- func (provider AWSInstanceRedisProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
- func (provider AWSInstanceRedisProvider) Flush(Instance *Instance) error
- func (provider AWSInstanceRedisProvider) GetBackup(instance *Instance, Id string) (*BackupSpec, error)
- func (provider AWSInstanceRedisProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
- func (provider AWSInstanceRedisProvider) GetUrl(instance *Instance) map[string]interface{}
- func (provider AWSInstanceRedisProvider) ListBackups(instance *Instance) ([]BackupSpec, error)
- func (provider AWSInstanceRedisProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
- func (provider AWSInstanceRedisProvider) ModifyWithSettings(instance *Instance, plan *ProviderPlan, ...) (*Instance, error)
- func (provider AWSInstanceRedisProvider) PerformPostProvision(db *Instance) (*Instance, error)
- func (provider AWSInstanceRedisProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
- func (provider AWSInstanceRedisProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *elasticache.CreateCacheClusterInput) (*Instance, error)
- func (provider AWSInstanceRedisProvider) Restart(Instance *Instance) error
- func (provider AWSInstanceRedisProvider) RestoreBackup(instance *Instance, Id string) error
- func (provider AWSInstanceRedisProvider) Stats(Instance *Instance) ([]Stat, error)
- func (provider AWSInstanceRedisProvider) Tag(Instance *Instance, Name string, Value string) error
- func (provider AWSInstanceRedisProvider) Untag(Instance *Instance, Name string) error
- type Action
- type ActionBase
- func (b *ActionBase) ActionSchemaHandler(w http.ResponseWriter, r *http.Request)
- func (b *ActionBase) AddActions(name string, path string, method string, ...) error
- func (b *ActionBase) ConvertActionsToExtensions(serviceId string) []osb.ExtensionAPI
- func (b *ActionBase) RouteActions(router *mux.Router) error
- type BackupSpec
- type BusinessLogic
- func (b *BusinessLogic) ActionCreateBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionFlushData(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionGetStats(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionListBackups(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionRestart(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) ActionRestoreBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
- func (b *BusinessLogic) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
- func (b *BusinessLogic) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
- func (b *BusinessLogic) GetBinding(request *osb.GetBindingRequest, context *broker.RequestContext) (*osb.GetBindingResponse, error)
- func (b *BusinessLogic) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
- func (b *BusinessLogic) GetInstanceById(Id string) (*Instance, error)
- func (b *BusinessLogic) GetUnclaimedInstance(PlanId string, InstanceId string) (*Instance, error)
- func (b *BusinessLogic) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
- func (b *BusinessLogic) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
- func (b *BusinessLogic) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
- func (b *BusinessLogic) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
- func (b *BusinessLogic) ValidateBrokerAPIVersion(version string) error
- type ChangePlansTaskMetadata
- type ChangeProvidersTaskMetadata
- type Entry
- type Instance
- type KubernetesInstanceMemcachedProvider
- func (provider KubernetesInstanceMemcachedProvider) CreateBackup(*Instance) (*BackupSpec, error)
- func (provider KubernetesInstanceMemcachedProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
- func (provider KubernetesInstanceMemcachedProvider) Flush(Instance *Instance) error
- func (provider KubernetesInstanceMemcachedProvider) GetBackup(*Instance, string) (*BackupSpec, error)
- func (provider KubernetesInstanceMemcachedProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
- func (provider KubernetesInstanceMemcachedProvider) GetUrl(instance *Instance) map[string]interface{}
- func (provider KubernetesInstanceMemcachedProvider) ListBackups(*Instance) ([]BackupSpec, error)
- func (provider KubernetesInstanceMemcachedProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
- func (provider KubernetesInstanceMemcachedProvider) PerformPostProvision(db *Instance) (*Instance, error)
- func (provider KubernetesInstanceMemcachedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
- func (provider KubernetesInstanceMemcachedProvider) Restart(Instance *Instance) error
- func (provider KubernetesInstanceMemcachedProvider) RestoreBackup(*Instance, string) error
- func (provider KubernetesInstanceMemcachedProvider) Stats(Instance *Instance) ([]Stat, error)
- func (provider KubernetesInstanceMemcachedProvider) Tag(Instance *Instance, Name string, Value string) error
- func (provider KubernetesInstanceMemcachedProvider) Untag(Instance *Instance, Name string) error
- type KubernetesInstanceRedisProvider
- func (provider KubernetesInstanceRedisProvider) CreateBackup(*Instance) (*BackupSpec, error)
- func (provider KubernetesInstanceRedisProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
- func (provider KubernetesInstanceRedisProvider) Flush(Instance *Instance) error
- func (provider KubernetesInstanceRedisProvider) GetBackup(*Instance, string) (*BackupSpec, error)
- func (provider KubernetesInstanceRedisProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
- func (provider KubernetesInstanceRedisProvider) GetUrl(instance *Instance) map[string]interface{}
- func (provider KubernetesInstanceRedisProvider) ListBackups(*Instance) ([]BackupSpec, error)
- func (provider KubernetesInstanceRedisProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
- func (provider KubernetesInstanceRedisProvider) PerformPostProvision(db *Instance) (*Instance, error)
- func (provider KubernetesInstanceRedisProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
- func (provider KubernetesInstanceRedisProvider) Restart(Instance *Instance) error
- func (provider KubernetesInstanceRedisProvider) RestoreBackup(*Instance, string) error
- func (provider KubernetesInstanceRedisProvider) Stats(Instance *Instance) ([]Stat, error)
- func (provider KubernetesInstanceRedisProvider) Tag(Instance *Instance, Name string, Value string) error
- func (provider KubernetesInstanceRedisProvider) Untag(Instance *Instance, Name string) error
- type MemcachedProviderPlan
- type Options
- type PostgresStorage
- func (b *PostgresStorage) AddInstance(Instance *Instance) error
- func (b *PostgresStorage) AddTask(Id string, action TaskAction, metadata string) (string, error)
- func (b *PostgresStorage) DeleteInstance(Instance *Instance) error
- func (b *PostgresStorage) GetInstance(Id string) (*Entry, error)
- func (b *PostgresStorage) GetPlanByID(planId string) (*ProviderPlan, error)
- func (b *PostgresStorage) GetPlans(serviceId string) ([]ProviderPlan, error)
- func (b *PostgresStorage) GetServices() ([]osb.Service, error)
- func (b *PostgresStorage) GetUnclaimedInstance(PlanId string, InstanceId string) (*Entry, error)
- func (b *PostgresStorage) IsRestoring(dbId string) (bool, error)
- func (b *PostgresStorage) IsUpgrading(dbId string) (bool, error)
- func (b *PostgresStorage) NukeInstance(Id string) error
- func (b *PostgresStorage) PopPendingTask() (*Task, error)
- func (b *PostgresStorage) ReturnClaimedInstance(Id string) error
- func (b *PostgresStorage) StartProvisioningTasks() ([]Entry, error)
- func (b *PostgresStorage) UpdateInstance(Instance *Instance, PlanId string) error
- func (b *PostgresStorage) UpdateTask(Id string, status *string, retries *int64, metadata *string, result *string, ...) error
- func (b *PostgresStorage) ValidateInstanceID(id string) error
- func (b *PostgresStorage) WarnOnUnfinishedTasks()
- type Provider
- type ProviderPlan
- type Providers
- type ResourceSpec
- type ResourceUrlSpec
- type RestoreTaskMetadata
- type Stat
- type Storage
- type Task
- type TaskAction
- type WebhookTaskMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyParamsToStatement ¶
func CanBeDeleted ¶
available, failed, incompatible-parameters, incompatible-network, restore-failed, recovering
func CanBeModified ¶
func CanGetBindings ¶
func CrudeOSBIHacks ¶
func CrudeOSBIHacks(router *mux.Router, b *BusinessLogic)
These are hacks to support more of V2.14 such as get service instance and get service bindings.
func FinishedTask ¶
func HttpWrite ¶
func HttpWrite(w http.ResponseWriter, status int, obj interface{})
func InProgress ¶
func InternalServerError ¶
func InternalServerError() error
func IsAvailable ¶
func IsReadyKubernetes ¶ added in v1.0.2
func IsReadyKubernetes(dep *v1apps.Deployment) bool
func RandomString ¶
func RestoreBackup ¶
func RunPreprovisionTasks ¶
func RunWorkerTasks ¶
func UnprocessableEntity ¶
func UnprocessableEntity() error
func UpdateTaskStatus ¶
func UpgradeAcrossProviders ¶
Types ¶
type AWSInstanceMemcachedProvider ¶
type AWSInstanceMemcachedProvider struct { Provider // contains filtered or unexported fields }
func NewAWSInstanceMemcachedProvider ¶
func NewAWSInstanceMemcachedProvider(namePrefix string) (*AWSInstanceMemcachedProvider, error)
func (AWSInstanceMemcachedProvider) CreateBackup ¶
func (provider AWSInstanceMemcachedProvider) CreateBackup(*Instance) (*BackupSpec, error)
func (AWSInstanceMemcachedProvider) Deprovision ¶
func (provider AWSInstanceMemcachedProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
func (AWSInstanceMemcachedProvider) Flush ¶
func (provider AWSInstanceMemcachedProvider) Flush(Instance *Instance) error
func (AWSInstanceMemcachedProvider) GetBackup ¶
func (provider AWSInstanceMemcachedProvider) GetBackup(*Instance, string) (*BackupSpec, error)
func (AWSInstanceMemcachedProvider) GetInstance ¶
func (provider AWSInstanceMemcachedProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
func (AWSInstanceMemcachedProvider) GetUrl ¶
func (provider AWSInstanceMemcachedProvider) GetUrl(instance *Instance) map[string]interface{}
func (AWSInstanceMemcachedProvider) ListBackups ¶
func (provider AWSInstanceMemcachedProvider) ListBackups(*Instance) ([]BackupSpec, error)
func (AWSInstanceMemcachedProvider) Modify ¶
func (provider AWSInstanceMemcachedProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
func (AWSInstanceMemcachedProvider) PerformPostProvision ¶
func (provider AWSInstanceMemcachedProvider) PerformPostProvision(db *Instance) (*Instance, error)
func (AWSInstanceMemcachedProvider) Provision ¶
func (provider AWSInstanceMemcachedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
func (AWSInstanceMemcachedProvider) ProvisionWithSettings ¶
func (provider AWSInstanceMemcachedProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *elasticache.CreateCacheClusterInput) (*Instance, error)
func (AWSInstanceMemcachedProvider) Restart ¶
func (provider AWSInstanceMemcachedProvider) Restart(Instance *Instance) error
func (AWSInstanceMemcachedProvider) RestoreBackup ¶
func (provider AWSInstanceMemcachedProvider) RestoreBackup(*Instance, string) error
func (AWSInstanceMemcachedProvider) Stats ¶
func (provider AWSInstanceMemcachedProvider) Stats(Instance *Instance) ([]Stat, error)
type AWSInstanceRedisProvider ¶
type AWSInstanceRedisProvider struct { Provider // contains filtered or unexported fields }
func NewAWSInstanceRedisProvider ¶
func NewAWSInstanceRedisProvider(namePrefix string) (*AWSInstanceRedisProvider, error)
func (AWSInstanceRedisProvider) CreateBackup ¶
func (provider AWSInstanceRedisProvider) CreateBackup(instance *Instance) (*BackupSpec, error)
func (AWSInstanceRedisProvider) Deprovision ¶
func (provider AWSInstanceRedisProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
func (AWSInstanceRedisProvider) Flush ¶
func (provider AWSInstanceRedisProvider) Flush(Instance *Instance) error
func (AWSInstanceRedisProvider) GetBackup ¶
func (provider AWSInstanceRedisProvider) GetBackup(instance *Instance, Id string) (*BackupSpec, error)
func (AWSInstanceRedisProvider) GetInstance ¶
func (provider AWSInstanceRedisProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
func (AWSInstanceRedisProvider) GetUrl ¶
func (provider AWSInstanceRedisProvider) GetUrl(instance *Instance) map[string]interface{}
func (AWSInstanceRedisProvider) ListBackups ¶
func (provider AWSInstanceRedisProvider) ListBackups(instance *Instance) ([]BackupSpec, error)
func (AWSInstanceRedisProvider) Modify ¶
func (provider AWSInstanceRedisProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
func (AWSInstanceRedisProvider) ModifyWithSettings ¶
func (provider AWSInstanceRedisProvider) ModifyWithSettings(instance *Instance, plan *ProviderPlan, settings *elasticache.CreateCacheClusterInput) (*Instance, error)
func (AWSInstanceRedisProvider) PerformPostProvision ¶
func (provider AWSInstanceRedisProvider) PerformPostProvision(db *Instance) (*Instance, error)
func (AWSInstanceRedisProvider) Provision ¶
func (provider AWSInstanceRedisProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
func (AWSInstanceRedisProvider) ProvisionWithSettings ¶
func (provider AWSInstanceRedisProvider) ProvisionWithSettings(Id string, plan *ProviderPlan, settings *elasticache.CreateCacheClusterInput) (*Instance, error)
func (AWSInstanceRedisProvider) Restart ¶
func (provider AWSInstanceRedisProvider) Restart(Instance *Instance) error
func (AWSInstanceRedisProvider) RestoreBackup ¶
func (provider AWSInstanceRedisProvider) RestoreBackup(instance *Instance, Id string) error
func (AWSInstanceRedisProvider) Stats ¶
func (provider AWSInstanceRedisProvider) Stats(Instance *Instance) ([]Stat, error)
type ActionBase ¶
func (*ActionBase) ActionSchemaHandler ¶
func (b *ActionBase) ActionSchemaHandler(w http.ResponseWriter, r *http.Request)
func (*ActionBase) AddActions ¶
func (*ActionBase) ConvertActionsToExtensions ¶
func (b *ActionBase) ConvertActionsToExtensions(serviceId string) []osb.ExtensionAPI
func (*ActionBase) RouteActions ¶
func (b *ActionBase) RouteActions(router *mux.Router) error
type BackupSpec ¶
type BackupSpec struct { Resource ResourceSpec `json:"resource"` Id *string `json:"id"` Progress *int64 `json:"progress"` Status *string `json:"status"` Created string `json:"created_at"` }
type BusinessLogic ¶
type BusinessLogic struct { ActionBase // contains filtered or unexported fields }
func NewBusinessLogic ¶
func NewBusinessLogic(ctx context.Context, o Options) (*BusinessLogic, error)
func (*BusinessLogic) ActionCreateBackup ¶
func (b *BusinessLogic) ActionCreateBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionFlushData ¶
func (b *BusinessLogic) ActionFlushData(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetBackup ¶
func (b *BusinessLogic) ActionGetBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionGetStats ¶
func (b *BusinessLogic) ActionGetStats(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionListBackups ¶
func (b *BusinessLogic) ActionListBackups(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionRestart ¶
func (b *BusinessLogic) ActionRestart(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) ActionRestoreBackup ¶
func (b *BusinessLogic) ActionRestoreBackup(InstanceID string, vars map[string]string, context *broker.RequestContext) (interface{}, error)
func (*BusinessLogic) Bind ¶
func (b *BusinessLogic) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
func (*BusinessLogic) Deprovision ¶
func (b *BusinessLogic) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
func (*BusinessLogic) GetBinding ¶
func (b *BusinessLogic) GetBinding(request *osb.GetBindingRequest, context *broker.RequestContext) (*osb.GetBindingResponse, error)
func (*BusinessLogic) GetCatalog ¶
func (b *BusinessLogic) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
func (*BusinessLogic) GetInstanceById ¶
func (b *BusinessLogic) GetInstanceById(Id string) (*Instance, error)
func (*BusinessLogic) GetUnclaimedInstance ¶
func (b *BusinessLogic) GetUnclaimedInstance(PlanId string, InstanceId string) (*Instance, error)
func (*BusinessLogic) LastOperation ¶
func (b *BusinessLogic) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
func (*BusinessLogic) Provision ¶
func (b *BusinessLogic) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
A peice of advice, never try to make this syncronous by waiting for a to return a response. The problem is that can take up to 10 minutes in my experience (depending on the provider), and aside from the API call timing out the other issue is it can cause the mutex lock to make the entire API unresponsive.
func (*BusinessLogic) Unbind ¶
func (b *BusinessLogic) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
func (*BusinessLogic) Update ¶
func (b *BusinessLogic) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
func (*BusinessLogic) ValidateBrokerAPIVersion ¶
func (b *BusinessLogic) ValidateBrokerAPIVersion(version string) error
type ChangePlansTaskMetadata ¶
type ChangePlansTaskMetadata struct {
Plan string `json:"plan"`
}
type ChangeProvidersTaskMetadata ¶
type ChangeProvidersTaskMetadata struct {
Plan string `json:"plan"`
}
type Instance ¶
type Instance struct { Id string `json:"id"` Name string `json:"name"` ProviderId string `json:"provider_id"` Plan *ProviderPlan `json:"plan,omitempty"` Username string `json:"username"` Password string `json:"password"` Endpoint string `json:"endpoint"` Status string `json:"status"` Ready bool `json:"ready"` Engine string `json:"engine"` EngineVersion string `json:"engine_version"` Scheme string `json:"scheme"` }
func GetInstanceById ¶
type KubernetesInstanceMemcachedProvider ¶ added in v1.0.2
type KubernetesInstanceMemcachedProvider struct { Provider // contains filtered or unexported fields }
func NewKubernetesInstanceMemcachedProvider ¶ added in v1.0.2
func NewKubernetesInstanceMemcachedProvider(namePrefix string) (*KubernetesInstanceMemcachedProvider, error)
func (KubernetesInstanceMemcachedProvider) CreateBackup ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) CreateBackup(*Instance) (*BackupSpec, error)
func (KubernetesInstanceMemcachedProvider) Deprovision ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
func (KubernetesInstanceMemcachedProvider) Flush ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Flush(Instance *Instance) error
func (KubernetesInstanceMemcachedProvider) GetBackup ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) GetBackup(*Instance, string) (*BackupSpec, error)
func (KubernetesInstanceMemcachedProvider) GetInstance ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
func (KubernetesInstanceMemcachedProvider) GetUrl ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) GetUrl(instance *Instance) map[string]interface{}
func (KubernetesInstanceMemcachedProvider) ListBackups ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) ListBackups(*Instance) ([]BackupSpec, error)
func (KubernetesInstanceMemcachedProvider) Modify ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
func (KubernetesInstanceMemcachedProvider) PerformPostProvision ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) PerformPostProvision(db *Instance) (*Instance, error)
func (KubernetesInstanceMemcachedProvider) Provision ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
func (KubernetesInstanceMemcachedProvider) Restart ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Restart(Instance *Instance) error
func (KubernetesInstanceMemcachedProvider) RestoreBackup ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) RestoreBackup(*Instance, string) error
func (KubernetesInstanceMemcachedProvider) Stats ¶ added in v1.0.2
func (provider KubernetesInstanceMemcachedProvider) Stats(Instance *Instance) ([]Stat, error)
type KubernetesInstanceRedisProvider ¶ added in v1.0.2
type KubernetesInstanceRedisProvider struct { Provider // contains filtered or unexported fields }
func NewKubernetesInstanceRedisProvider ¶ added in v1.0.2
func NewKubernetesInstanceRedisProvider(namePrefix string) (*KubernetesInstanceRedisProvider, error)
func (KubernetesInstanceRedisProvider) CreateBackup ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) CreateBackup(*Instance) (*BackupSpec, error)
func (KubernetesInstanceRedisProvider) Deprovision ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Deprovision(Instance *Instance, takeSnapshot bool) error
func (KubernetesInstanceRedisProvider) Flush ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Flush(Instance *Instance) error
func (KubernetesInstanceRedisProvider) GetBackup ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) GetBackup(*Instance, string) (*BackupSpec, error)
func (KubernetesInstanceRedisProvider) GetInstance ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) GetInstance(name string, plan *ProviderPlan) (*Instance, error)
func (KubernetesInstanceRedisProvider) GetUrl ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) GetUrl(instance *Instance) map[string]interface{}
func (KubernetesInstanceRedisProvider) ListBackups ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) ListBackups(*Instance) ([]BackupSpec, error)
func (KubernetesInstanceRedisProvider) Modify ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Modify(Instance *Instance, plan *ProviderPlan) (*Instance, error)
func (KubernetesInstanceRedisProvider) PerformPostProvision ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) PerformPostProvision(db *Instance) (*Instance, error)
func (KubernetesInstanceRedisProvider) Provision ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Provision(Id string, plan *ProviderPlan, Owner string) (*Instance, error)
func (KubernetesInstanceRedisProvider) Restart ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Restart(Instance *Instance) error
func (KubernetesInstanceRedisProvider) RestoreBackup ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) RestoreBackup(*Instance, string) error
func (KubernetesInstanceRedisProvider) Stats ¶ added in v1.0.2
func (provider KubernetesInstanceRedisProvider) Stats(Instance *Instance) ([]Stat, error)
type MemcachedProviderPlan ¶ added in v1.0.2
type PostgresStorage ¶
type PostgresStorage struct { Storage // contains filtered or unexported fields }
func InitStorage ¶
func InitStorage(ctx context.Context, o Options) (*PostgresStorage, error)
func (*PostgresStorage) AddInstance ¶
func (b *PostgresStorage) AddInstance(Instance *Instance) error
func (*PostgresStorage) AddTask ¶
func (b *PostgresStorage) AddTask(Id string, action TaskAction, metadata string) (string, error)
func (*PostgresStorage) DeleteInstance ¶
func (b *PostgresStorage) DeleteInstance(Instance *Instance) error
func (*PostgresStorage) GetInstance ¶
func (b *PostgresStorage) GetInstance(Id string) (*Entry, error)
func (*PostgresStorage) GetPlanByID ¶
func (b *PostgresStorage) GetPlanByID(planId string) (*ProviderPlan, error)
func (*PostgresStorage) GetPlans ¶
func (b *PostgresStorage) GetPlans(serviceId string) ([]ProviderPlan, error)
func (*PostgresStorage) GetServices ¶
func (b *PostgresStorage) GetServices() ([]osb.Service, error)
func (*PostgresStorage) GetUnclaimedInstance ¶
func (b *PostgresStorage) GetUnclaimedInstance(PlanId string, InstanceId string) (*Entry, error)
func (*PostgresStorage) IsRestoring ¶
func (b *PostgresStorage) IsRestoring(dbId string) (bool, error)
func (*PostgresStorage) IsUpgrading ¶
func (b *PostgresStorage) IsUpgrading(dbId string) (bool, error)
func (*PostgresStorage) NukeInstance ¶
func (b *PostgresStorage) NukeInstance(Id string) error
func (*PostgresStorage) PopPendingTask ¶
func (b *PostgresStorage) PopPendingTask() (*Task, error)
func (*PostgresStorage) ReturnClaimedInstance ¶
func (b *PostgresStorage) ReturnClaimedInstance(Id string) error
func (*PostgresStorage) StartProvisioningTasks ¶
func (b *PostgresStorage) StartProvisioningTasks() ([]Entry, error)
func (*PostgresStorage) UpdateInstance ¶
func (b *PostgresStorage) UpdateInstance(Instance *Instance, PlanId string) error
func (*PostgresStorage) UpdateTask ¶
func (*PostgresStorage) ValidateInstanceID ¶
func (b *PostgresStorage) ValidateInstanceID(id string) error
func (*PostgresStorage) WarnOnUnfinishedTasks ¶
func (b *PostgresStorage) WarnOnUnfinishedTasks()
type Provider ¶
type Provider interface { GetInstance(string, *ProviderPlan) (*Instance, error) Provision(string, *ProviderPlan, string) (*Instance, error) Deprovision(*Instance, bool) error Modify(*Instance, *ProviderPlan) (*Instance, error) Tag(*Instance, string, string) error Untag(*Instance, string) error Restart(*Instance) error PerformPostProvision(*Instance) (*Instance, error) GetUrl(*Instance) map[string]interface{} Flush(*Instance) error Stats(*Instance) ([]Stat, error) GetBackup(*Instance, string) (*BackupSpec, error) ListBackups(*Instance) ([]BackupSpec, error) CreateBackup(*Instance) (*BackupSpec, error) RestoreBackup(*Instance, string) error }
func GetProviderByPlan ¶
func GetProviderByPlan(namePrefix string, plan *ProviderPlan) (Provider, error)
type ProviderPlan ¶
type ResourceSpec ¶
type ResourceSpec struct {
Name string `json:"name"`
}
type ResourceUrlSpec ¶
type RestoreTaskMetadata ¶
type RestoreTaskMetadata struct {
Backup string `json:"backup"`
}
type Storage ¶
type Storage interface { GetPlans(string) ([]ProviderPlan, error) GetPlanByID(string) (*ProviderPlan, error) GetInstance(string) (*Entry, error) AddInstance(*Instance) error DeleteInstance(*Instance) error UpdateInstance(*Instance, string) error AddTask(string, TaskAction, string) (string, error) GetServices() ([]osb.Service, error) UpdateTask(string, *string, *int64, *string, *string, *time.Time, *time.Time) error PopPendingTask() (*Task, error) GetUnclaimedInstance(string, string) (*Entry, error) ReturnClaimedInstance(string) error StartProvisioningTasks() ([]Entry, error) NukeInstance(string) error WarnOnUnfinishedTasks() IsRestoring(string) (bool, error) IsUpgrading(string) (bool, error) ValidateInstanceID(string) error }
type TaskAction ¶
type TaskAction string
const ( DeleteTask TaskAction = "delete" ResyncFromProviderTask TaskAction = "resync-from-provider" ResyncFromProviderUntilAvailableTask TaskAction = "resync-until-available" NotifyCreateServiceWebhookTask TaskAction = "notify-create-service-webhook" NotifyCreateBindingWebhookTask TaskAction = "notify-create-binding-webhook" ChangeProvidersTask TaskAction = "change-providers" ChangePlansTask TaskAction = "change-plans" RestoreTask TaskAction = "restore" PerformPostProvisionTask TaskAction = "perform-post-provision" )
type WebhookTaskMetadata ¶
Click to show internal directories.
Click to hide internal directories.