Documentation ¶
Index ¶
- type CloudSQLBroker
- func (b *CloudSQLBroker) Bind(instanceID, bindingID string, details brokerapi.BindDetails) (models.ServiceBindingCredentials, error)
- func (b *CloudSQLBroker) BuildInstanceCredentials(bindDetails models.ServiceBindingCredentials, ...) (map[string]string, error)
- func (b *CloudSQLBroker) Deprovision(ctx context.Context, instance models.ServiceInstanceDetails, ...) error
- func (b *CloudSQLBroker) DeprovisionsAsync() bool
- func (b *CloudSQLBroker) LastOperationWasDelete(instanceId string) (bool, error)
- func (b *CloudSQLBroker) PollInstance(instanceId string) (bool, error)
- func (b *CloudSQLBroker) Provision(instanceId string, details brokerapi.ProvisionDetails, plan models.ServicePlan) (models.ServiceInstanceDetails, error)
- func (b *CloudSQLBroker) ProvisionsAsync() bool
- func (b *CloudSQLBroker) Unbind(creds models.ServiceBindingCredentials) error
- type InstanceInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudSQLBroker ¶
type CloudSQLBroker struct { HttpConfig *jwt.Config ProjectId string Logger lager.Logger AccountManager models.AccountManager SaAccountManager models.AccountManager }
CloudSQLBroker is the service-broker back-end for creating and binding CloudSQL instances.
func (*CloudSQLBroker) Bind ¶
func (b *CloudSQLBroker) Bind(instanceID, bindingID string, details brokerapi.BindDetails) (models.ServiceBindingCredentials, error)
Bind creates a new username, password, and set of ssl certs for the given instance. The function may be slow to return because CloudSQL operations are asynchronous. The default PCF service broker timeout may need to be raised to 90 or 120 seconds to accommodate the long bind time.
func (*CloudSQLBroker) BuildInstanceCredentials ¶
func (b *CloudSQLBroker) BuildInstanceCredentials(bindDetails models.ServiceBindingCredentials, instanceDetails models.ServiceInstanceDetails) (map[string]string, error)
func (*CloudSQLBroker) Deprovision ¶
func (b *CloudSQLBroker) Deprovision(ctx context.Context, instance models.ServiceInstanceDetails, details brokerapi.DeprovisionDetails) error
Deprovision issues a delete call on the database instance.
func (*CloudSQLBroker) DeprovisionsAsync ¶
func (b *CloudSQLBroker) DeprovisionsAsync() bool
DeprovisionsAsync indicates that CloudSQL uses asynchronous deprovisioning.
func (*CloudSQLBroker) LastOperationWasDelete ¶
func (b *CloudSQLBroker) LastOperationWasDelete(instanceId string) (bool, error)
LastOperationWasDelete checks if the last async operation was a deletion (as opposed to a provision).
func (*CloudSQLBroker) PollInstance ¶
func (b *CloudSQLBroker) PollInstance(instanceId string) (bool, error)
PollInstance gets the last operation for this instance and checks its status.
func (*CloudSQLBroker) Provision ¶
func (b *CloudSQLBroker) Provision(instanceId string, details brokerapi.ProvisionDetails, plan models.ServicePlan) (models.ServiceInstanceDetails, error)
Provision creates a new CloudSQL instance from the settings in the user-provided details and service plan.
func (*CloudSQLBroker) ProvisionsAsync ¶
func (b *CloudSQLBroker) ProvisionsAsync() bool
ProvisionsAsync indicates that CloudSQL uses asynchronous provisioning.
func (*CloudSQLBroker) Unbind ¶
func (b *CloudSQLBroker) Unbind(creds models.ServiceBindingCredentials) error
Unbind deletes the database user, service account and invalidates the ssl certs associated with this binding.
type InstanceInformation ¶
type InstanceInformation struct { InstanceName string `json:"instance_name"` DatabaseName string `json:"database_name"` Host string `json:"host"` Region string `json:"region"` LastMasterOperationId string `json:"last_master_operation_id"` }
InstanceInformation holds the details needed to bind a service account to a CloudSQL instance after it has been provisioned.