broker

package
v0.0.0-...-ae28096 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoClientConfigured = errors.New("This broker is not configured to support binding to additional instances. Contact your Cloud Foundry operator for details.")
)

Functions

This section is empty.

Types

type BindParameters

type BindParameters struct {
	// Set AdditionalInstances to bind credentials that have permission to
	// access multiple s3 buckets, not just one. This is useful when copying
	// files between buckets. The contents should be a list of service
	// instance names.
	AdditionalInstances []string `json:"additional_instances"`
}

type BrokerCatalog

type BrokerCatalog struct {
	Services []Service `yaml:"services,omitempty"`
}

func (BrokerCatalog) FindService

func (c BrokerCatalog) FindService(serviceID string) (service Service, found bool)

func (BrokerCatalog) FindServicePlan

func (c BrokerCatalog) FindServicePlan(planID string) (plan ServicePlan, found bool)

func (BrokerCatalog) ListServicePlans

func (c BrokerCatalog) ListServicePlans() []ServicePlan

func (BrokerCatalog) Validate

func (c BrokerCatalog) Validate() error

type Catalog

type Catalog interface {
	Validate() error
	FindService(serviceID string) (service Service, found bool)
	FindServicePlan(planID string) (plan ServicePlan, found bool)
	ListServicePlans() []ServicePlan
}

type CatalogExternal

type CatalogExternal struct {
	Services []brokerapi.Service `json:"services"`
}

type Config

type Config struct {
	Region                       string        `yaml:"region"`
	Endpoint                     string        `yaml:"endpoint"`
	InsecureSkipVerify           bool          `yaml:"insecure_skip_verify"`
	Provider                     string        `yaml:"provider"`
	IamPath                      string        `yaml:"iam_path"`
	UserPrefix                   string        `yaml:"user_prefix"`
	PolicyPrefix                 string        `yaml:"policy_prefix"`
	BucketPrefix                 string        `yaml:"bucket_prefix"`
	AwsPartition                 string        `yaml:"aws_partition"`
	AllowUserProvisionParameters bool          `yaml:"allow_user_provision_parameters"`
	AllowUserUpdateParameters    bool          `yaml:"allow_user_update_parameters"`
	Catalog                      BrokerCatalog `yaml:"catalog"`
}

func (Config) Validate

func (c Config) Validate() error

type Credentials

type Credentials struct {
	URI                string   `json:"uri"`
	InsecureSkipVerify bool     `json:"insecure_skip_verify"`
	AccessKeyID        string   `json:"access_key_id"`
	SecretAccessKey    string   `json:"secret_access_key"`
	Region             string   `json:"region"`
	Bucket             string   `json:"bucket"`
	Endpoint           string   `json:"endpoint"`
	FIPSEndpoint       string   `json:"fips_endpoint"`
	AdditionalBuckets  []string `json:"additional_buckets"`
}

type ProvisionParameters

type ProvisionParameters struct {
	ObjectOwnership string `json:"object_ownership"`
}

type S3Broker

type S3Broker struct {
	// contains filtered or unexported fields
}

func New

func New(
	config Config,
	provider provider.Provider,
	bucket awss3.Bucket,
	user awsiam.User,
	cfClient *cf.Client,
	logger lager.Logger,
	tagManager brokertags.TagManager,
) *S3Broker

func (*S3Broker) Bind

func (b *S3Broker) Bind(
	context context.Context,
	instanceID string,
	bindingID string,
	details domain.BindDetails,
	asyncAllowed bool,
) (domain.Binding, error)

func (*S3Broker) Deprovision

func (b *S3Broker) Deprovision(
	context context.Context,
	instanceID string,
	details domain.DeprovisionDetails,
	asyncAllowed bool,
) (domain.DeprovisionServiceSpec, error)

func (*S3Broker) GetBinding

func (b *S3Broker) GetBinding(
	ctx context.Context,
	instanceID,
	bindingID string,
	details domain.FetchBindingDetails,
) (domain.GetBindingSpec, error)

func (*S3Broker) GetBucketURI

func (b *S3Broker) GetBucketURI(credentials Credentials) string

func (*S3Broker) GetInstance

func (b *S3Broker) GetInstance(
	ctx context.Context,
	instanceID string,
	details domain.FetchInstanceDetails,
) (domain.GetInstanceDetailsSpec, error)

func (*S3Broker) LastBindingOperation

func (b *S3Broker) LastBindingOperation(
	ctx context.Context,
	instanceID,
	bindingID string,
	details domain.PollDetails,
) (domain.LastOperation, error)

func (*S3Broker) LastOperation

func (b *S3Broker) LastOperation(
	ctx context.Context,
	instanceID string,
	details domain.PollDetails,
) (domain.LastOperation, error)

func (*S3Broker) Provision

func (b *S3Broker) Provision(
	context context.Context,
	instanceID string,
	details domain.ProvisionDetails,
	asyncAllowed bool,
) (domain.ProvisionedServiceSpec, error)

func (*S3Broker) Services

func (b *S3Broker) Services(context context.Context) ([]brokerapi.Service, error)

func (*S3Broker) Unbind

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

func (*S3Broker) Update

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

type S3Properties

type S3Properties struct {
	IamPolicy    string `yaml:"iam_policy,omitempty"`
	BucketPolicy string `yaml:"bucket_policy,omitempty"`
	Encryption   string `yaml:"encryption,omitempty"`
}

func (S3Properties) Validate

func (eq S3Properties) Validate() error

type Service

type Service struct {
	ID              string                            `yaml:"id"`
	Name            string                            `yaml:"name"`
	Description     string                            `yaml:"description"`
	Bindable        bool                              `yaml:"bindable"`
	Tags            []string                          `yaml:"tags,omitempty"`
	PlanUpdatable   bool                              `yaml:"plan_updateable"`
	Plans           []ServicePlan                     `yaml:"plans"`
	Requires        []brokerapi.RequiredPermission    `yaml:"requires,omitempty"`
	Metadata        *brokerapi.ServiceMetadata        `yaml:"metadata,omitempty"`
	DashboardClient *brokerapi.ServiceDashboardClient `yaml:"dashboard_client,omitempty"`
}

func (Service) Validate

func (s Service) Validate() error

type ServicePlan

type ServicePlan struct {
	ID            string                         `yaml:"id"`
	Name          string                         `yaml:"name"`
	Description   string                         `yaml:"description"`
	Free          bool                           `yaml:"free"`
	Metadata      *brokerapi.ServicePlanMetadata `yaml:"metadata,omitempty"`
	PlanDeletable bool                           `yaml:"deletable,omitempty"`
	S3Properties  S3Properties                   `yaml:"s3_properties,omitempty"`
}

func (ServicePlan) Validate

func (sp ServicePlan) Validate() error

type UpdateParameters

type UpdateParameters struct {
	ApplyImmediately bool `json:"apply_immediately"`
}

Jump to

Keyboard shortcuts

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