cmd

package
v0.0.0-...-e1dbaa0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalQueue = "cmd:global"

Variables

View Source
var ErrBlankName = errors.New("Name cannot be blank")
View Source
var ErrMissingClusterID = errors.New("'cluster_id' must be specified")
View Source
var ErrNegativeMemory = errors.New("Memory size must be positive")
View Source
var TimedOut = errors.New("command.Run: Command timed out")

Functions

func Listen

func Listen(backend env.Backend, queue string)

func QueueByClassAndID

func QueueByClassAndID(class Class, id string) string

func Run

func Run(backend env.Backend, name string, params map[string]interface{}) (result map[string]interface{}, err error)

Types

type AddVmParams

type AddVmParams struct {
	Name      string
	MemSizeMB uint64
}

func (*AddVmParams) Validate

func (p *AddVmParams) Validate() error

type Class

type Class int8
const (
	Global Class = iota
	Host
	VM
)

type ClusterHostParams

type ClusterHostParams struct {
	HostID    model.GUID `structs:"host_id" mapstructure:"host_id"`
	ClusterID model.GUID `structs:"cluster_id" mapstructure:"cluster_id"`
}

func (*ClusterHostParams) Validate

func (params *ClusterHostParams) Validate() error

type Command

type Command struct {
	Name  string
	Class Class
	// contains filtered or unexported fields
}

type Commands

type Commands []*Command

type IDParams

type IDParams struct {
	ID model.GUID
}

type Request

type Request struct {
	Name   string                 `json:"name"`
	ID     string                 `json:"id"`
	Params map[string]interface{} `json:"params"`
}

type Response

type Response struct {
	Status string      `json:"status"`
	Result interface{} `json:"result"`
}

type UpdateVmParams

type UpdateVmParams struct {
	ID   model.GUID
	Name string
}

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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