backends

package
v0.0.0-...-1b7c13d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2014 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Copyright (C) 2013 The Docker Cloud authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DASS_TARGET_PREFIX = "rdas_target_"
)

Variables

View Source
var (

	// ErrNoAuthUrl errors occur when the value of the OS_AUTH_URL environment variable cannot be determined.
	ErrNoAuthUrl = fmt.Errorf("Environment variable OS_AUTH_URL needs to be set.")

	// ErrNoUsername errors occur when the value of the OS_USERNAME environment variable cannot be determined.
	ErrNoUsername = fmt.Errorf("Environment variable OS_USERNAME needs to be set.")

	// ErrNoPassword errors occur when the value of the OS_PASSWORD environment variable cannot be determined.
	ErrNoPassword = fmt.Errorf("Environment variable OS_PASSWORD or OS_API_KEY needs to be set.")
)

Functions

func Aggregate

func Aggregate() libswarm.Sender

func CloudBackend

func CloudBackend() engine.Installer

func ConfigureGCE

func ConfigureGCE(clientId, clientSecret, scope, projectId string) error

func DockerClient

func DockerClient() libswarm.Sender

func DockerClientWithConfig

func DockerClientWithConfig(config *DockerClientConfig) libswarm.Sender

func DockerServer

func DockerServer() libswarm.Sender

func Ec2

func Ec2() libswarm.Sender

func Exec

func Exec() libswarm.Sender

func FakeClient

func FakeClient() libswarm.Sender

func New

func New() *libswarm.Client

New returns a new engine, with all backends registered but not activated. To activate a backend, call a job on the resulting engine, named after the desired backend.

Example: `New().Job("debug").Run()`

func Orchard

func Orchard() libswarm.Sender

func RandomString

func RandomString() string

Shamelessly taken from docker core

func Shipyard

func Shipyard() libswarm.Sender

func Simulator

func Simulator() libswarm.Sender

func Tutum

func Tutum() libswarm.Sender

Types

type Cloud

type Cloud interface {
	// GetPublicIPAddress returns the stringified address (e.g "1.2.3.4") of the runtime
	GetPublicIPAddress(name string, zone string) (string, error)

	// CreateInstance creates a virtual machine instance given a name and a zone.  Returns the
	// IP address of the instance.  Waits until Docker is up and functioning on the machine
	// before returning.
	CreateInstance(name string, zone string) (string, error)

	// DeleteInstance deletes a virtual machine instance, given the instance name and zone.
	DeleteInstance(name string, zone string) error

	// Open a secure tunnel (generally SSH) between the local host and a remote host.
	OpenSecureTunnel(name string, zone string, localPort int, remotePort int) (*os.Process, error)
}

The Cloud interface provides the contract that cloud providers should implement to enable running Docker containers in their cloud. TODO(bburns): Restructure this into Cloud, Instance and Tunnel interfaces

type Container

type Container struct {
	Id    string
	Image string
	Tty   bool
}

type DockerClientConfig

type DockerClientConfig struct {
	Scheme          string
	URLHost         string
	TLSClientConfig *tls.Config
}

type DockerHttpClient

type DockerHttpClient struct {
	Url *url.URL
	// contains filtered or unexported fields
}

func (*DockerHttpClient) Call

func (client *DockerHttpClient) Call(method, path, body string) (*http.Response, error)

func (*DockerHttpClient) Delete

func (client *DockerHttpClient) Delete(path, data string) (resp *http.Response, err error)

func (*DockerHttpClient) Get

func (client *DockerHttpClient) Get(path, data string) (resp *http.Response, err error)

func (*DockerHttpClient) Post

func (client *DockerHttpClient) Post(path, data string) (resp *http.Response, err error)

func (*DockerHttpClient) Put

func (client *DockerHttpClient) Put(path, data string) (resp *http.Response, err error)

type GCECloud

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

A Google Compute Engine implementation of the Cloud interface

func NewCloudGCE

func NewCloudGCE(projectId string) (cloud *GCECloud, err error)

Create a GCE Cloud instance. 'clientId', 'clientSecret' and 'scope' are used to ask for a client credential. 'code' is optional and is only used if a cached credential can not be found. 'projectId' is the Google Cloud project name.

func (GCECloud) CreateInstance

func (cloud GCECloud) CreateInstance(name string, zone string) (string, error)

Implementation of the Cloud interface

func (GCECloud) DeleteInstance

func (cloud GCECloud) DeleteInstance(name string, zone string) error

Implementation of the Cloud interface

func (GCECloud) GetPublicIPAddress

func (cloud GCECloud) GetPublicIPAddress(name string, zone string) (string, error)

Implementation of the Cloud interface

func (GCECloud) OpenSecureTunnel

func (cloud GCECloud) OpenSecureTunnel(name, zone string, localPort, remotePort int) (*os.Process, error)

type HostContext

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

func NewHostContext

func NewHostContext(id, name string, rax *RaxCloud) (hc *HostContext, err error)

func (*HostContext) Close

func (hc *HostContext) Close()

type HostContextCache

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

A HostContext represents an active session with a cloud host

func NewHostContextCache

func NewHostContextCache() (contextCache *HostContextCache)

func (*HostContextCache) Close

func (hcc *HostContextCache) Close()

func (*HostContextCache) Get

func (hcc *HostContextCache) Get(id, name string, rax *RaxCloud) (context *HostContext, err error)

func (*HostContextCache) GetCached

func (hcc *HostContextCache) GetCached(id, name string, rax *RaxCloud) (context *HostContext, err error)

type HttpApiFunc

type HttpApiFunc func(out libswarm.Sender, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error

type HttpClient

type HttpClient interface {
	Call(method, path, body string) (*http.Response, error)
	Get(path, data string) (resp *http.Response, err error)
	Delete(path, data string) (resp *http.Response, err error)
	Post(path, data string) (resp *http.Response, err error)
	Put(path, data string) (resp *http.Response, err error)
}

HTTP Client with some syntax sugar

type RaxCloud

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

A Rackspace impl of the cloud provider interface

func RaxCloudBackend

func RaxCloudBackend() *RaxCloud

Returns a pointer to a new RaxCloud instance

func (*RaxCloud) Close

func (rax *RaxCloud) Close()

func (*RaxCloud) Install

func (rax *RaxCloud) Install(eng *engine.Engine) (err error)

Installs the RaxCloud backend into an engine

type Tunnel

type Tunnel struct {
	url.URL
}

returns true, if the connection was successful, false otherwise

Jump to

Keyboard shortcuts

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