cloudapi

package
v0.0.0-...-10bbe92 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2014 License: GPL-3.0, LGPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAllowed = &ErrorResponse{
		http.StatusMethodNotAllowed,
		"Method is not allowed",
		"text/plain; charset=UTF-8",
		"MethodNotAllowedError",
		nil,
		nil,
	}
	ErrNotFound = &ErrorResponse{
		http.StatusNotFound,
		"Resource Not Found",
		"text/plain; charset=UTF-8",
		"NotFoundError",
		nil,
		nil,
	}
	ErrBadRequest = &ErrorResponse{
		http.StatusBadRequest,
		"Malformed request url",
		"text/plain; charset=UTF-8",
		"BadRequestError",
		nil,
		nil,
	}
)

Functions

This section is empty.

Types

type CloudAPI

type CloudAPI struct {
	localservices.ServiceInstance
	// contains filtered or unexported fields
}

func New

func New(serviceURL, userAccount string) *CloudAPI

func (*CloudAPI) CountMachines

func (c *CloudAPI) CountMachines() (int, error)

func (*CloudAPI) CreateFirewallRule

func (c *CloudAPI) CreateFirewallRule(rule string, enabled bool) (*cloudapi.FirewallRule, error)

func (*CloudAPI) CreateKey

func (c *CloudAPI) CreateKey(keyName, key string) (*cloudapi.Key, error)

func (*CloudAPI) CreateMachine

func (c *CloudAPI) CreateMachine(name, pkg, image string, metadata, tags map[string]string) (*cloudapi.Machine, error)

func (*CloudAPI) DeleteFirewallRule

func (c *CloudAPI) DeleteFirewallRule(fwRuleId string) error

func (*CloudAPI) DeleteKey

func (c *CloudAPI) DeleteKey(keyName string) error

func (*CloudAPI) DeleteMachine

func (c *CloudAPI) DeleteMachine(machineId string) error

func (*CloudAPI) DisableFirewallMachine

func (c *CloudAPI) DisableFirewallMachine(machineId string) error

func (*CloudAPI) DisableFirewallRule

func (c *CloudAPI) DisableFirewallRule(fwRuleId string) (*cloudapi.FirewallRule, error)

func (*CloudAPI) EnableFirewallMachine

func (c *CloudAPI) EnableFirewallMachine(machineId string) error

func (*CloudAPI) EnableFirewallRule

func (c *CloudAPI) EnableFirewallRule(fwRuleId string) (*cloudapi.FirewallRule, error)

func (*CloudAPI) GetFirewallRule

func (c *CloudAPI) GetFirewallRule(fwRuleId string) (*cloudapi.FirewallRule, error)

func (*CloudAPI) GetImage

func (c *CloudAPI) GetImage(imageId string) (*cloudapi.Image, error)

func (*CloudAPI) GetKey

func (c *CloudAPI) GetKey(keyName string) (*cloudapi.Key, error)

func (*CloudAPI) GetMachine

func (c *CloudAPI) GetMachine(machineId string) (*cloudapi.Machine, error)

func (*CloudAPI) GetNetwork

func (c *CloudAPI) GetNetwork(networkId string) (*cloudapi.Network, error)

func (*CloudAPI) GetPackage

func (c *CloudAPI) GetPackage(packageName string) (*cloudapi.Package, error)

func (*CloudAPI) ListFirewallRuleMachines

func (c *CloudAPI) ListFirewallRuleMachines(fwRuleId string) ([]*cloudapi.Machine, error)

func (*CloudAPI) ListFirewallRules

func (c *CloudAPI) ListFirewallRules() ([]*cloudapi.FirewallRule, error)

FirewallRule APIs

func (*CloudAPI) ListImages

func (c *CloudAPI) ListImages(filters map[string]string) ([]cloudapi.Image, error)

Images APIs

func (*CloudAPI) ListKeys

func (c *CloudAPI) ListKeys() ([]cloudapi.Key, error)

Keys APIs

func (*CloudAPI) ListMachineFirewallRules

func (c *CloudAPI) ListMachineFirewallRules(machineId string) ([]*cloudapi.FirewallRule, error)

func (*CloudAPI) ListMachines

func (c *CloudAPI) ListMachines(filters map[string]string) ([]*cloudapi.Machine, error)

Machine APIs

func (*CloudAPI) ListNetworks

func (c *CloudAPI) ListNetworks() ([]cloudapi.Network, error)

Networks API

func (*CloudAPI) ListPackages

func (c *CloudAPI) ListPackages(filters map[string]string) ([]cloudapi.Package, error)

Packages APIs

func (*CloudAPI) RebootMachine

func (c *CloudAPI) RebootMachine(machineId string) error

func (*CloudAPI) RenameMachine

func (c *CloudAPI) RenameMachine(machineId, newName string) error

func (*CloudAPI) ResizeMachine

func (c *CloudAPI) ResizeMachine(machineId, packageName string) error

func (*CloudAPI) SetupHTTP

func (c *CloudAPI) SetupHTTP(mux *http.ServeMux)

setupHTTP attaches all the needed handlers to provide the HTTP API.

func (*CloudAPI) StartMachine

func (c *CloudAPI) StartMachine(machineId string) error

func (*CloudAPI) StopMachine

func (c *CloudAPI) StopMachine(machineId string) error

func (*CloudAPI) UpdateFirewallRule

func (c *CloudAPI) UpdateFirewallRule(fwRuleId, rule string, enabled bool) (*cloudapi.FirewallRule, error)

type ErrorResponse

type ErrorResponse struct {
	Code int
	Body string
	// contains filtered or unexported fields
}

ErrorResponse defines a single HTTP error response.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

func (*ErrorResponse) ServeHTTP

func (e *ErrorResponse) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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