gosdc: github.com/wallyworld/gosdc/localservices/cloudapi Index | Files

package cloudapi

import "github.com/wallyworld/gosdc/localservices/cloudapi"


Package Files

service.go service_http.go


var (
    ErrNotAllowed = &ErrorResponse{
        "Method is not allowed",
        "text/plain; charset=UTF-8",
    ErrNotFound = &ErrorResponse{
        "Resource Not Found",
        "text/plain; charset=UTF-8",
    ErrBadRequest = &ErrorResponse{
        "Malformed request url",
        "text/plain; charset=UTF-8",

type CloudAPI Uses

type CloudAPI struct {
    // contains filtered or unexported fields

func New Uses

func New(serviceURL, userAccount string) *CloudAPI

func (*CloudAPI) CountMachines Uses

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

func (*CloudAPI) CreateFirewallRule Uses

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

func (*CloudAPI) CreateKey Uses

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

func (*CloudAPI) CreateMachine Uses

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

func (*CloudAPI) DeleteFirewallRule Uses

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

func (*CloudAPI) DeleteKey Uses

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

func (*CloudAPI) DeleteMachine Uses

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

func (*CloudAPI) DisableFirewallMachine Uses

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

func (*CloudAPI) DisableFirewallRule Uses

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

func (*CloudAPI) EnableFirewallMachine Uses

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

func (*CloudAPI) EnableFirewallRule Uses

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

func (*CloudAPI) GetFirewallRule Uses

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

func (*CloudAPI) GetImage Uses

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

func (*CloudAPI) GetKey Uses

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

func (*CloudAPI) GetMachine Uses

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

func (*CloudAPI) GetNetwork Uses

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

func (*CloudAPI) GetPackage Uses

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

func (*CloudAPI) ListFirewallRuleMachines Uses

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

func (*CloudAPI) ListFirewallRules Uses

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

FirewallRule APIs

func (*CloudAPI) ListImages Uses

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

Images APIs

func (*CloudAPI) ListKeys Uses

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

Keys APIs

func (*CloudAPI) ListMachineFirewallRules Uses

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

func (*CloudAPI) ListMachines Uses

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

Machine APIs

func (*CloudAPI) ListNetworks Uses

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

Networks API

func (*CloudAPI) ListPackages Uses

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

Packages APIs

func (*CloudAPI) RebootMachine Uses

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

func (*CloudAPI) RenameMachine Uses

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

func (*CloudAPI) ResizeMachine Uses

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

func (*CloudAPI) SetupHTTP Uses

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

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

func (*CloudAPI) StartMachine Uses

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

func (*CloudAPI) StopMachine Uses

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

func (*CloudAPI) UpdateFirewallRule Uses

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

type ErrorResponse Uses

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

ErrorResponse defines a single HTTP error response.

func (*ErrorResponse) Error Uses

func (e *ErrorResponse) Error() string

func (*ErrorResponse) ServeHTTP Uses

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

Package cloudapi imports 11 packages (graph). Updated 2017-04-04. Refresh now. Tools for package owners.