cloudcfg

package
v0.0.0-...-54d1e7e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cloudcfg is ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteController

func DeleteController(name string, client client.ClientInterface) error

DeleteController deletes a replication controller named 'name', requires that the controller already be stopped

func DoRequest

func DoRequest(request *http.Request, auth *client.AuthInfo) (string, error)

Execute a request, adds authentication (if auth != nil), and HTTPS cert ignoring.

func LoadAuthInfo

func LoadAuthInfo(path string) (*client.AuthInfo, error)

Parse an AuthInfo object from a file path. Prompt user and create file if it doesn't exist.

func RequestWithBody

func RequestWithBody(configFile, url, method string) (*http.Request, error)

RequestWithBody is a helper method that creates an HTTP request with the specified url, method and a body read from 'configFile' FIXME: need to be public API?

func RunController

func RunController(image, name string, replicas int, client client.ClientInterface, portSpec string, servicePort int) error

RunController creates a new replication controller named 'name' which creates 'replicas' pods running 'image'

func StopController

func StopController(name string, client client.ClientInterface) error

StopController stops a controller named 'name' by setting replicas to zero

func Update

func Update(name string, client client.ClientInterface, updatePeriod time.Duration) error

Perform a rolling update of a collection of pods. 'name' points to a replication controller. 'client' is used for updating pods. 'updatePeriod' is the time between pod updates.

Types

type HumanReadablePrinter

type HumanReadablePrinter struct{}

HumanReadablePrinter attempts to provide more elegant output

func (*HumanReadablePrinter) Print

func (h *HumanReadablePrinter) Print(data string, output io.Writer) error

type IdentityPrinter

type IdentityPrinter struct{}

Identity printer simply copies the body out to the output stream

func (*IdentityPrinter) Print

func (i *IdentityPrinter) Print(data string, w io.Writer) error

type ResourcePrinter

type ResourcePrinter interface {
	// Print receives an arbitrary JSON body, formats it and prints it to a writer
	Print(string, io.Writer) error
}

ResourcePrinter is an interface that knows how to print API resources

type YAMLPrinter

type YAMLPrinter struct{}

YAMLPrinter parses JSON, and re-formats as YAML

func (*YAMLPrinter) Print

func (y *YAMLPrinter) Print(data string, w io.Writer) error

Jump to

Keyboard shortcuts

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