brokers

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCredentialsFromEnv

func GetCredentialsFromEnv() (models.GCPCredentials, error)

reads the service account json string from the environment variable ROOT_SERVICE_ACCOUNT_JSON, writes it to a file, and then exports the file location to the environment variable GOOGLE_APPLICATION_CREDENTIALS, making it visible to all google cloud apis

func InitCatalogFromEnv

func InitCatalogFromEnv() ([]models.Service, error)

pulls SERVICES, PLANS, and PRECONFIGURED_PLANS environment variables to construct catalog and save plans to db

Types

type GCPAsyncServiceBroker

type GCPAsyncServiceBroker struct {
	GCPServiceBroker
	ShouldProvisionAsync bool
}

func New

func New(Logger lager.Logger) (*GCPAsyncServiceBroker, error)

returns a new service broker and nil if no errors occur else nil and the error

func (*GCPAsyncServiceBroker) Deprovision

func (gcpBroker *GCPAsyncServiceBroker) Deprovision(instanceID string, details models.DeprovisionDetails, asyncAllowed bool) (models.IsAsync, error)

cf delete-service Deletes the given instance

func (*GCPAsyncServiceBroker) Provision

func (gcpBroker *GCPAsyncServiceBroker) Provision(instanceID string, details models.ProvisionDetails, asyncAllowed bool) (models.ProvisionedServiceSpec, error)

cf create-service creates a new service instance. What a "new service instance" means varies based on the service type CloudSQL: a new database instance and database BigQuery: a new dataset Storage: a new bucket PubSub: a new topic Bigtable: a new instance

type GCPServiceBroker

type GCPServiceBroker struct {
	RootGCPCredentials *models.GCPCredentials
	GCPClient          *http.Client
	Catalog            *[]models.Service
	ServiceBrokerMap   map[string]models.ServiceBrokerHelper

	InstanceLimit int

	Logger lager.Logger
}

func (*GCPServiceBroker) Bind

func (gcpBroker *GCPServiceBroker) Bind(instanceID string, bindingID string, details models.BindDetails) (models.Binding, error)

cf bind-service for cloudSql instances, Bind creates a new user and ssl cert for all other services, Bind creates a new service account with the IAM role listed in details.Parameters["permissions"] a complete list of IAM roles is available here: https://cloud.google.com/iam/docs/understanding-roles

func (*GCPServiceBroker) LastOperation

func (gcpBroker *GCPServiceBroker) LastOperation(instanceID string) (models.LastOperation, error)

if a service is provisioned asynchronously, LastOperation is called until the provisioning attempt times out or success or failure is returned

func (*GCPServiceBroker) Services

func (gcpBroker *GCPServiceBroker) Services() []models.Service

cf marketplace lists services in the broker's catalog

func (*GCPServiceBroker) Unbind

func (gcpBroker *GCPServiceBroker) Unbind(instanceID, bindingID string, details models.UnbindDetails) error

cf unbind-service for cloudSql instances, Unbind deletes the associated user and ssl certs for all other services, Unbind deletes the associated service account

func (*GCPServiceBroker) Update

func (gcpBroker *GCPServiceBroker) Update(instanceID string, details models.UpdateDetails, asyncAllowed bool) (models.IsAsync, error)

updates a service instance plan. This functionality is not implemented and will return an error indicating that plan changes are not supported.

Directories

Path Synopsis
modelsfakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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