Documentation ¶
Index ¶
- Variables
- func AddFlags(o *Options)
- func AwsDdbClientGetter(sess *session.Session) *dynamodb.DynamoDB
- func AwsIamClientGetter(sess *session.Session) iamiface.IAMAPI
- func AwsLambdaClientGetter(sess *session.Session) lambdaiface.LambdaAPI
- func AwsSessionGetter(keyid string, secretkey string, region string, accountId string, ...) *session.Session
- func AwsSsmClientGetter(sess *session.Session) ssmiface.SSMAPI
- func AwsStsClientGetter(sess *session.Session) *sts.STS
- func GetCallerId(svc stsiface.STSAPI) (*sts.GetCallerIdentityOutput, error)
- func ListTemplates(s3source *BucketDetailsRequest, b *AwsBroker) (*[]ServiceLastUpdate, error)
- func ListingUpdate(l *[]ServiceLastUpdate, c cache.Cache) error
- func MetadataUpdate(l cache.Cache, c cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, ...) error
- func PollUpdate(interval int, l cache.Cache, c cache.Cache, bd BucketDetailsRequest, ...)
- func UpdateCatalog(listingcache cache.Cache, catalogcache cache.Cache, bd BucketDetailsRequest, ...) error
- type AwsBroker
- func (b *AwsBroker) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
- func (b *AwsBroker) BindingLastOperation(request *osb.BindingLastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
- func (b *AwsBroker) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
- func (b *AwsBroker) GetBinding(request *osb.GetBindingRequest, c *broker.RequestContext) (*broker.GetBindingResponse, error)
- func (b *AwsBroker) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
- func (b *AwsBroker) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
- func (b *AwsBroker) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
- func (b *AwsBroker) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
- func (b *AwsBroker) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
- func (b *AwsBroker) ValidateBrokerAPIVersion(version string) error
- type AwsClients
- type AwsTags
- type BucketDetailsRequest
- type CfnClient
- type CfnCost
- type CfnServicePlan
- type CfnTemplate
- type DataStore
- type Db
- type GetAwsSession
- type GetCallerIder
- type GetCfnClient
- type GetDdbClient
- type GetIamClient
- type GetLambdaClient
- type GetS3Client
- type GetSsmClient
- type GetStsClient
- type ListTemplateser
- type ListingUpdater
- type MetadataUpdater
- type MetricsCollector
- type OpenshiftFormDefinition
- type Options
- type PollUpdater
- type S3Client
- type ServiceLastUpdate
- type ServiceNeedsUpdate
- type UpdateCataloger
Constants ¶
This section is empty.
Variables ¶
var CacheTTL = 1 * time.Hour
CacheTTL TTL for catalog cache record expiry
Functions ¶
func AwsLambdaClientGetter ¶ added in v1.0.3
func AwsLambdaClientGetter(sess *session.Session) lambdaiface.LambdaAPI
func AwsSessionGetter ¶
func AwsSessionGetter(keyid string, secretkey string, region string, accountId string, profile string, params map[string]string) *session.Session
Create AWS Session
func GetCallerId ¶
func GetCallerId(svc stsiface.STSAPI) (*sts.GetCallerIdentityOutput, error)
func ListTemplates ¶
func ListTemplates(s3source *BucketDetailsRequest, b *AwsBroker) (*[]ServiceLastUpdate, error)
func ListingUpdate ¶
func ListingUpdate(l *[]ServiceLastUpdate, c cache.Cache) error
func MetadataUpdate ¶
func MetadataUpdate(l cache.Cache, c cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, metadataUpdate MetadataUpdater, templatefilter string) error
func PollUpdate ¶
func PollUpdate(interval int, l cache.Cache, c cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, bl AwsBroker, updateCatalog UpdateCataloger, listTemplates ListTemplateser)
func UpdateCatalog ¶
func UpdateCatalog(listingcache cache.Cache, catalogcache cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, bl AwsBroker, listTemplates ListTemplateser, listingUpdate ListingUpdater, metadataUpdate MetadataUpdater) error
Types ¶
type AwsBroker ¶
type AwsBroker struct { sync.RWMutex GetSession GetAwsSession Clients AwsClients // contains filtered or unexported fields }
AwsBroker holds configuration, caches and aws service clients
func NewAWSBroker ¶
func NewAWSBroker(o Options, awssess GetAwsSession, clients AwsClients, getCallerId GetCallerIder, updateCatalog UpdateCataloger, pollUpdate PollUpdater, mc *MetricsCollector) (*AwsBroker, error)
Runs at startup and bootstraps the broker
func (*AwsBroker) Bind ¶
func (b *AwsBroker) Bind(request *osb.BindRequest, c *broker.RequestContext) (*broker.BindResponse, error)
Bind is executed when the OSB API receives `PUT /v2/service_instances/:instance_id/service_bindings/:binding_id` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#request-4).
func (*AwsBroker) BindingLastOperation ¶
func (b *AwsBroker) BindingLastOperation(request *osb.BindingLastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
BindingLastOperation is not implemented, as async binding is not supported.
func (*AwsBroker) Deprovision ¶
func (b *AwsBroker) Deprovision(request *osb.DeprovisionRequest, c *broker.RequestContext) (*broker.DeprovisionResponse, error)
Deprovision is executed when the OSB API receives `DELETE /v2/service_instances/:instance_id` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#deprovisioning).
func (*AwsBroker) GetBinding ¶
func (b *AwsBroker) GetBinding(request *osb.GetBindingRequest, c *broker.RequestContext) (*broker.GetBindingResponse, error)
GetBinding is not implemented, as async binding is not supported.
func (*AwsBroker) GetCatalog ¶
func (b *AwsBroker) GetCatalog(c *broker.RequestContext) (*broker.CatalogResponse, error)
GetCatalog is executed on a /v2/catalog/ osb api call https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#catalog-management
func (*AwsBroker) LastOperation ¶
func (b *AwsBroker) LastOperation(request *osb.LastOperationRequest, c *broker.RequestContext) (*broker.LastOperationResponse, error)
LastOperation is executed when the OSB API receives `GET /v2/service_instances/:instance_id/last_operation` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#polling-last-operation).
func (*AwsBroker) Provision ¶
func (b *AwsBroker) Provision(request *osb.ProvisionRequest, c *broker.RequestContext) (*broker.ProvisionResponse, error)
Provision is executed when the OSB API receives `PUT /v2/service_instances/:instance_id` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#provisioning).
func (*AwsBroker) Unbind ¶
func (b *AwsBroker) Unbind(request *osb.UnbindRequest, c *broker.RequestContext) (*broker.UnbindResponse, error)
Unbind is executed when the OSB API receives `DELETE /v2/service_instances/:instance_id/service_bindings/:binding_id` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#request-5).
func (*AwsBroker) Update ¶
func (b *AwsBroker) Update(request *osb.UpdateInstanceRequest, c *broker.RequestContext) (*broker.UpdateInstanceResponse, error)
Update is executed when the OSB API receives `PATCH /v2/service_instances/:instance_id` (https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#updating-a-service-instance).
func (*AwsBroker) ValidateBrokerAPIVersion ¶
ValidateBrokerAPIVersion still to determine supported api versions
type AwsClients ¶
type AwsClients struct { NewCfn GetCfnClient NewSsm GetSsmClient NewS3 GetS3Client NewDdb GetDdbClient NewSts GetStsClient NewIam GetIamClient NewLambda GetLambdaClient }
type BucketDetailsRequest ¶
type BucketDetailsRequest struct {
// contains filtered or unexported fields
}
BucketDetailsRequest describes the details required to fetch metadata and templates from s3
type CfnClient ¶
type CfnClient struct {
Client cloudformationiface.CloudFormationAPI
}
func AwsCfnClientGetter ¶
type CfnServicePlan ¶ added in v1.0.3
type CfnServicePlan struct { DisplayName string `yaml:"DisplayName,omitempty"` Description string `yaml:"Description,omitempty"` LongDescription string `yaml:"LongDescription,omitempty"` Cost string `yaml:"Cost,omitempty"` Costs []CfnCost `yaml:"Costs,omitempty"` ParameterValues map[string]string `yaml:"ParameterValues,omitempty"` ParameterDefaults map[string]string `yaml:"ParameterDefaults,omitempty"` }
type CfnTemplate ¶
type CfnTemplate struct { Description string `yaml:"Description,omitempty"` Parameters map[string]struct { Description string `yaml:"Description,omitempty"` Type string `yaml:"Type,omitempty"` Default *string `yaml:"Default,omitempty"` AllowedValues []string `yaml:"AllowedValues,omitempty"` } `yaml:"Parameters,omitempty"` Outputs map[string]struct { Description string `yaml:"Description,omitempty"` } `yaml:"Outputs,omitempty"` Metadata struct { Spec struct { Version string `yaml:"Version,omitempty"` Tags []string `yaml:"Tags,omitempty"` Name string `yaml:"Name,omitempty"` DisplayName string `yaml:"DisplayName,omitempty"` LongDescription string `yaml:"LongDescription,omitempty"` ImageUrl string `yaml:"ImageUrl,omitempty"` DocumentationUrl string `yaml:"DocumentationUrl,omitempty"` ProviderDisplayName string `yaml:"ProviderDisplayName,omitempty"` OutputsAsIs bool `yaml:"OutputsAsIs,omitempty"` CloudFoundry bool `yaml:"CloudFoundry,omitempty"` BindViaLambda bool `yaml:"BindViaLambda"` Bindings struct { IAM struct { AddKeypair bool `yaml:"AddKeypair,omitempty"` Policies []struct { PolicyDocument map[string]interface{} `yaml:"PolicyDocument,omitempty"` } `yaml:"Policies,omitempty"` } `yaml:"IAM,omitempty"` CFNOutputs []string `yaml:"CFNOutputs,omitempty"` } `yaml:"Bindings,omitempty"` ServicePlans map[string]CfnServicePlan `yaml:"ServicePlans,omitempty"` UpdatableParameters []string `yaml:"UpdatableParameters,omitempty"` } `yaml:"AWS::ServiceBroker::Specification,omitempty"` Interface struct { ParameterGroups []struct { Label struct { Name string `yaml:"default,omitempty"` } `yaml:"Label,omitempty"` Parameters []string `yaml:"Parameters,omitempty"` } `yaml:"ParameterGroups,omitempty"` ParameterLabels map[string]struct { Label string `yaml:"default,omitempty"` } `yaml:"ParameterLabels,omitempty"` } `yaml:"AWS::CloudFormation::Interface,omitempty"` } `yaml:"Metadata,omitempty"` }
type DataStore ¶
type DataStore interface { PutServiceDefinition(sd osb.Service) error GetParam(paramname string) (value string, err error) PutParam(paramname string, paramvalue string) error GetServiceDefinition(serviceuuid string) (*osb.Service, error) GetServiceInstance(sid string) (*serviceinstance.ServiceInstance, error) PutServiceInstance(si serviceinstance.ServiceInstance) error DeleteServiceInstance(sid string) error GetServiceBinding(id string) (*serviceinstance.ServiceBinding, error) PutServiceBinding(sb serviceinstance.ServiceBinding) error DeleteServiceBinding(id string) error }
DataStore port, any backend datastore must provide at least these interfaces
type Db ¶
Db configuration
func (Db) ServiceDefinitionToOsb ¶
func (db Db) ServiceDefinitionToOsb(sd CfnTemplate) osb.Service
ServiceDefinitionToOsb converts apb service definition into osb.Service struct
type GetAwsSession ¶
type GetCallerIder ¶
type GetCallerIder func(svc stsiface.STSAPI) (*sts.GetCallerIdentityOutput, error)
type GetCfnClient ¶
type GetLambdaClient ¶ added in v1.0.3
type GetLambdaClient func(sess *session.Session) lambdaiface.LambdaAPI
type GetS3Client ¶
type ListTemplateser ¶
type ListTemplateser func(s3source *BucketDetailsRequest, b *AwsBroker) (*[]ServiceLastUpdate, error)
type ListingUpdater ¶
type ListingUpdater func(l *[]ServiceLastUpdate, c cache.Cache) error
type MetadataUpdater ¶
type MetadataUpdater func(l cache.Cache, c cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, metadataUpdate MetadataUpdater, templatefilter string) error
type MetricsCollector ¶ added in v1.0.4
type MetricsCollector struct {
Actions *prom.CounterVec
}
MetricsCollector is a prometheus metrics collector that is capable of providing better (more fine grained) action counts that the OSBMetricsCollector provided by the osb-broker-lib library - mainly it exists so that we don't reuse the same metric name, and we don't conflict with the metric gathering in that library.
func NewMetricsCollector ¶ added in v1.0.4
func NewMetricsCollector() *MetricsCollector
New initialises the MetricsCollector with a counter vec.
func (*MetricsCollector) Collect ¶ added in v1.0.4
func (c *MetricsCollector) Collect(ch chan<- prom.Metric)
Collect returns the current state of all metrics of the collector.
func (*MetricsCollector) Describe ¶ added in v1.0.4
func (c *MetricsCollector) Describe(ch chan<- *prom.Desc)
Describe returns all descriptions of the collector.
type OpenshiftFormDefinition ¶
type Options ¶
type Options struct { CatalogPath string KeyID string SecretKey string Profile string TableName string S3Bucket string S3Region string S3Key string TemplateFilter string Region string BrokerID string RoleArn string PrescribeOverrides bool }
Options cli options
type PollUpdater ¶
type PollUpdater func(interval int, l cache.Cache, c cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, bl AwsBroker, updateCatalog UpdateCataloger, listTemplates ListTemplateser)
type S3Client ¶
func AwsS3ClientGetter ¶
type ServiceLastUpdate ¶
ServiceLastUpdate date when a service exposed by the broker was last updated from s3
type ServiceNeedsUpdate ¶
ServiceNeedsUpdate if Update == true the metadata should be refreshed from s3
type UpdateCataloger ¶
type UpdateCataloger func(listingcache cache.Cache, catalogcache cache.Cache, bd BucketDetailsRequest, s3svc S3Client, db Db, bl AwsBroker, listTemplates ListTemplateser, listingUpdate ListingUpdater, metadataUpdate MetadataUpdater) error