rdsbroker

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MasterPasswordLength = 32
View Source
const MasterUsernameLength = 16
View Source
const StateReboot = "PendingReboot"
View Source
const StateResetUserPassword = "PendingResetUserPassword"
View Source
const StateUpdateSettings = "PendingUpdateSettings"
View Source
const TagOrganizationID = "Organization ID"
View Source
const TagPlanID = "Plan ID"
View Source
const TagRestoredFromSnapshot = "Restored From Snapshot"
View Source
const TagServiceID = "Service ID"
View Source
const TagSkipFinalSnapshot = "SkipFinalSnapshot"
View Source
const TagSpaceID = "Space ID"

Variables

View Source
var (
	ErrEncryptionNotUpdateable = errors.New("instance can not be updated to a plan with different encryption settings")
)

Functions

This section is empty.

Types

type BindParameters

type BindParameters struct {
}

type Catalog

type Catalog struct {
	Services       []Service `json:"services,omitempty"`
	ExcludeEngines []Engine  `json:"exclude_engines"`
}

func (Catalog) FindService

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

func (Catalog) FindServicePlan

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

func (Catalog) Validate

func (c Catalog) Validate() error

type CatalogExternal

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

type Config

type Config struct {
	Region                       string  `json:"region"`
	DBPrefix                     string  `json:"db_prefix"`
	BrokerName                   string  `json:"broker_name"`
	AWSPartition                 string  `json:"aws_partition"`
	MasterPasswordSeed           string  `json:"master_password_seed"`
	AllowUserProvisionParameters bool    `json:"allow_user_provision_parameters"`
	AllowUserUpdateParameters    bool    `json:"allow_user_update_parameters"`
	AllowUserBindParameters      bool    `json:"allow_user_bind_parameters"`
	Catalog                      Catalog `json:"catalog"`
}

func (*Config) FillDefaults

func (c *Config) FillDefaults()

func (Config) Validate

func (c Config) Validate() error

type Credentials

type Credentials struct {
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string `json:"password"`
	URI      string `json:"uri"`
	JDBCURI  string `json:"jdbcuri"`
}

type Engine

type Engine struct {
	Engine        string `json:"engine"`
	EngineVersion string `json:"engine_version"`
}

type ProvisionParameters

type ProvisionParameters struct {
	BackupRetentionPeriod       int64   `json:"backup_retention_period"`
	CharacterSetName            string  `json:"character_set_name"`
	DBName                      string  `json:"dbname"`
	PreferredBackupWindow       string  `json:"preferred_backup_window"`
	PreferredMaintenanceWindow  string  `json:"preferred_maintenance_window"`
	SkipFinalSnapshot           *bool   `json:"skip_final_snapshot"`
	RestoreFromLatestSnapshotOf *string `json:"restore_from_latest_snapshot_of"`
}

func (*ProvisionParameters) Validate

func (pp *ProvisionParameters) Validate() error

type RDSBroker

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

func New

func New(
	config Config,
	dbInstance awsrds.DBInstance,
	sqlProvider sqlengine.Provider,
	logger lager.Logger,
) *RDSBroker

func (*RDSBroker) Bind

func (b *RDSBroker) Bind(
	ctx context.Context,
	instanceID, bindingID string,
	details brokerapi.BindDetails,
) (brokerapi.Binding, error)

func (*RDSBroker) CheckAndRotateCredentials

func (b *RDSBroker) CheckAndRotateCredentials()

func (*RDSBroker) Deprovision

func (b *RDSBroker) Deprovision(
	ctx context.Context,
	instanceID string,
	details brokerapi.DeprovisionDetails,
	asyncAllowed bool,
) (brokerapi.DeprovisionServiceSpec, error)

func (*RDSBroker) LastOperation

func (b *RDSBroker) LastOperation(
	ctx context.Context,
	instanceID, operationData string,
) (brokerapi.LastOperation, error)

func (*RDSBroker) PostRestoreTasks

func (b *RDSBroker) PostRestoreTasks(instanceID string, dbInstanceDetails *awsrds.DBInstanceDetails) (asyncOperarionTriggered bool, err error)

func (*RDSBroker) Provision

func (b *RDSBroker) Provision(
	ctx context.Context,
	instanceID string,
	details brokerapi.ProvisionDetails,
	asyncAllowed bool,
) (brokerapi.ProvisionedServiceSpec, error)

func (*RDSBroker) Services

func (b *RDSBroker) Services(ctx context.Context) []brokerapi.Service

func (*RDSBroker) Unbind

func (b *RDSBroker) Unbind(
	ctx context.Context,
	instanceID, bindingID string,
	details brokerapi.UnbindDetails,
) error

func (*RDSBroker) Update

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

type RDSProperties

type RDSProperties struct {
	DBInstanceClass            string   `json:"db_instance_class"`
	Engine                     string   `json:"engine"`
	EngineVersion              string   `json:"engine_version"`
	AllocatedStorage           int64    `json:"allocated_storage"`
	AutoMinorVersionUpgrade    bool     `json:"auto_minor_version_upgrade,omitempty"`
	AvailabilityZone           string   `json:"availability_zone,omitempty"`
	BackupRetentionPeriod      int64    `json:"backup_retention_period,omitempty"`
	CharacterSetName           string   `json:"character_set_name,omitempty"`
	DBParameterGroupName       string   `json:"db_parameter_group_name,omitempty"`
	DBSecurityGroups           []string `json:"db_security_groups,omitempty"`
	DBSubnetGroupName          string   `json:"db_subnet_group_name,omitempty"`
	LicenseModel               string   `json:"license_model,omitempty"`
	MultiAZ                    bool     `json:"multi_az,omitempty"`
	OptionGroupName            string   `json:"option_group_name,omitempty"`
	Port                       int64    `json:"port,omitempty"`
	PreferredBackupWindow      string   `json:"preferred_backup_window,omitempty"`
	PreferredMaintenanceWindow string   `json:"preferred_maintenance_window,omitempty"`
	PubliclyAccessible         bool     `json:"publicly_accessible,omitempty"`
	StorageEncrypted           bool     `json:"storage_encrypted,omitempty"`
	KmsKeyID                   string   `json:"kms_key_id,omitempty"`
	StorageType                string   `json:"storage_type,omitempty"`
	Iops                       int64    `json:"iops,omitempty"`
	VpcSecurityGroupIds        []string `json:"vpc_security_group_ids,omitempty"`
	CopyTagsToSnapshot         bool     `json:"copy_tags_to_snapshot,omitempty"`
	SkipFinalSnapshot          bool     `json:"skip_final_snapshot,omitempty"`
	PostgresExtensions         []string `json:"postgres_extensions,omitempty"`
}

func (RDSProperties) Validate

func (rp RDSProperties) Validate(c Catalog) error

type Service

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

func (Service) Validate

func (s Service) Validate(c Catalog) error

type ServicePlan

type ServicePlan struct {
	ID            string                         `json:"id"`
	Name          string                         `json:"name"`
	Description   string                         `json:"description"`
	Free          *bool                          `json:"free,omitempty"`
	Metadata      *brokerapi.ServicePlanMetadata `json:"metadata,omitempty"`
	RDSProperties RDSProperties                  `json:"rds_properties,omitempty"`
}

func (ServicePlan) Validate

func (sp ServicePlan) Validate(c Catalog) error

type UpdateParameters

type UpdateParameters struct {
	ApplyAtMaintenanceWindow   bool   `json:"apply_at_maintenance_window"`
	BackupRetentionPeriod      int64  `json:"backup_retention_period"`
	PreferredBackupWindow      string `json:"preferred_backup_window"`
	PreferredMaintenanceWindow string `json:"preferred_maintenance_window"`
	SkipFinalSnapshot          *bool  `json:"skip_final_snapshot"`
}

func (*UpdateParameters) Validate

func (pp *UpdateParameters) Validate() error

Jump to

Keyboard shortcuts

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