juju

package
v0.0.0-...-e22f67b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2013 License: BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Overview

Package juju provide utilities functions for interaction with Juju. It also provides a provisioner implementation for Juju.

In order to use the provisioner, just import tsuru's provision package and juju provision package. Then call provision.Get("juju") to get an instance of JujuProvisioner:

import (
    "github.com/globocom/tsuru/provision"
    _ "github.com/globocom/tsuru/provision/juju"
)
// ...
func main() {
    provisioner, err := provision.Get("juju")
    // Use provisioner.
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ELBManager

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

ELBManager manages load balancers within Amazon Elastic Load Balancer.

If juju:use-elb is true on tsuru.conf, this manager will be used for managing load balancers on tsuru.

It uses db package and adds a new collection to tsuru's DB. The name of the collection is also defined in the configuration file (juju:elb-collection).

func (*ELBManager) Addr

func (m *ELBManager) Addr(app provision.Named) (string, error)

Addr returns the dns-name of a load balancer, which is also the DNS name of the app.

func (*ELBManager) Create

func (m *ELBManager) Create(app provision.Named) error

Create creates a new Elastic Load Balancing instance for the given app. The name of the instance will be the same as the name of the app.

func (*ELBManager) Deregister

func (m *ELBManager) Deregister(app provision.Named, units ...provision.Unit) error

Deregister removes EC2 instances (represented as units) from a load balancer.

func (*ELBManager) Destroy

func (m *ELBManager) Destroy(app provision.Named) error

Destroy destroys an Elastic Load Balancing instance from AWS. It matches the name of the given app.

func (*ELBManager) Register

func (m *ELBManager) Register(app provision.Named, units ...provision.Unit) error

Register adds new EC2 instances (represented as units) to a load balancer.

type JujuProvisioner

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

JujuProvisioner is an implementation for the Provisioner interface. For more details on how a provisioner work, check the documentation of the provision package.

func (*JujuProvisioner) AddUnits

func (p *JujuProvisioner) AddUnits(app provision.App, n uint) ([]provision.Unit, error)

func (*JujuProvisioner) Addr

func (p *JujuProvisioner) Addr(app provision.App) (string, error)

func (*JujuProvisioner) CollectStatus

func (p *JujuProvisioner) CollectStatus() ([]provision.Unit, error)

func (*JujuProvisioner) Destroy

func (p *JujuProvisioner) Destroy(app provision.App) error

func (*JujuProvisioner) ExecuteCommand

func (p *JujuProvisioner) ExecuteCommand(stdout, stderr io.Writer, app provision.App, cmd string, args ...string) error

func (*JujuProvisioner) LoadBalancer

func (p *JujuProvisioner) LoadBalancer() *ELBManager

func (*JujuProvisioner) Provision

func (p *JujuProvisioner) Provision(app provision.App) error

func (*JujuProvisioner) RemoveUnit

func (p *JujuProvisioner) RemoveUnit(app provision.App, name string) error

func (*JujuProvisioner) Restart

func (p *JujuProvisioner) Restart(app provision.App) error

type Writer

type Writer struct {
	io.Writer
}

Writer is a custom writer that filters output from Juju.

It ignores all Juju logging and Python warnings.

func (*Writer) Write

func (w *Writer) Write(data []byte) (int, error)

Write writes data to the underlying writer, filtering the juju warnings.

Jump to

Keyboard shortcuts

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