Documentation ¶
Index ¶
- Constants
- type ActiveProfile
- type Backup
- type BackupsForServerResponse
- type BackupsResponse
- type Client
- func (client *Client) Backups() (backups []*Backup, e error)
- func (client *Client) BackupsForServer(id int) (backups []*Backup, e error)
- func (client *Client) BaseUrl() string
- func (client *Client) ChangeState(id int, state string, planId int) (server *Server, e error)
- func (client *Client) ChangeStatus(id string, status string, planId int, metadata string) (server *Server, e error)
- func (client *Client) CloneServer(id int, opts *CreateOptions) (server *Server, e error)
- func (client *Client) CreateBackup(id int) error
- func (client *Client) CreateJiffyBox(options *CreateOptions) (server *Server, e error)
- func (client *Client) DeleteJiffyBox(id int) (e error)
- func (client *Client) Distribution(id string) (dist *Distribution, e error)
- func (client *Client) Distributions() (dists []*Distribution, e error)
- func (client *Client) FreezeServer(id int) (server *Server, e error)
- func (client *Client) JiffyBox(id int) (server *Server, e error)
- func (client *Client) JiffyBoxes() (servers []*Server, e error)
- func (client *Client) LoadResource(action string, i interface{}) error
- func (client *Client) Plan(id string) (plan *Plan, e error)
- func (client *Client) Plans() (plans []*Plan, e error)
- func (client *Client) PostForm(action string, values url.Values) (rsp *HttpResponse, e error)
- func (client *Client) PullPlugServer(id int) (server *Server, e error)
- func (client *Client) ShutdownServer(id int) (server *Server, e error)
- func (client *Client) StartServer(id int, planId int) (server *Server, e error)
- func (client *Client) ThawServer(id int, planId int) (server *Server, e error)
- func (client *Client) Validate() error
- type CreateOptions
- type Disk
- type Distribution
- type DistributionResponse
- type DistributionsResponse
- type ErrorResponse
- type HttpResponse
- type JiffyBoxResponse
- type JiffyBoxesResponse
- type Message
- type Plan
- type PlanResponse
- type PlansResponse
- type Response
- type Server
Constants ¶
View Source
const ( STATUS_START = "START" STATUS_SHUTDOWN = "SHUTDOWN" STATUS_PULLPLUG = "PULLPLUG" STATUS_FREEZE = "FREEZE" STATUS_THAW = "THAW" )
View Source
const ENV_API_TOKEN = "JIFFYBOX_API_KEY"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveProfile ¶
type ActiveProfile struct { Name string `json:"name"` // "Standard", Created int `json:"created"` // 1234567890, Runlevel string `json:"runlevel"` // "default", Kernel string `json:"kernel"` // "xen-current", Rootdisk string `json:"rootdisk"` // "\/dev\/xvda", RootdiskMode string `json:"rootdiskMode"` // "ro", Status string `json:"status"` // "READY", DisksHash map[string]*Disk `json:"disks"` }
func (*ActiveProfile) Disks ¶
func (ap *ActiveProfile) Disks() (disks []*Disk)
type BackupsResponse ¶
type Client ¶
type Client struct {
ApiKey string
}
func NewFromEnv ¶
func NewFromEnv() *Client
func (*Client) BackupsForServer ¶
func (*Client) ChangeState ¶
func (*Client) ChangeStatus ¶
func (*Client) CloneServer ¶
func (client *Client) CloneServer(id int, opts *CreateOptions) (server *Server, e error)
func (*Client) CreateBackup ¶
func (*Client) CreateJiffyBox ¶
func (client *Client) CreateJiffyBox(options *CreateOptions) (server *Server, e error)
func (*Client) DeleteJiffyBox ¶
func (*Client) Distribution ¶
func (client *Client) Distribution(id string) (dist *Distribution, e error)
func (*Client) Distributions ¶
func (client *Client) Distributions() (dists []*Distribution, e error)
func (*Client) JiffyBoxes ¶
func (*Client) LoadResource ¶
func (*Client) PullPlugServer ¶
func (*Client) ShutdownServer ¶
func (*Client) StartServer ¶
func (*Client) ThawServer ¶
unfreeze server
type CreateOptions ¶
type Distribution ¶
type DistributionResponse ¶
type DistributionResponse struct {
Distribution *Distribution `json:"result"`
}
type DistributionsResponse ¶
type DistributionsResponse struct {
DistributionsMap map[string]*Distribution `json:"result"`
}
func (*DistributionsResponse) Distributions ¶
func (rsp *DistributionsResponse) Distributions() (distributions []*Distribution)
type ErrorResponse ¶
type HttpResponse ¶
type JiffyBoxResponse ¶
type JiffyBoxesResponse ¶
type JiffyBoxesResponse struct { Messages []*Message `json:"messages:"` ServersMap map[string]*Server `json:"result"` }
func (*JiffyBoxesResponse) Server ¶
func (rsp *JiffyBoxesResponse) Server() *Server
func (*JiffyBoxesResponse) Servers ¶
func (rsp *JiffyBoxesResponse) Servers() []*Server
type Plan ¶
type Plan struct { Id int `json:"id"` //22, Name string `json:"name"` //"CloudLevel 3", DiskSizeInMB int `json:"diskSizeInMB"` //307200, RamInMB int `json:"ramInMB"` //8192, PricePerHour float64 `json:"pricePerHour"` //0.07, PricePerHourFrozen float64 `json:"pricePerHourFrozen"` //0.02, Cpus int `json:"cpus"` //6 }
type PlanResponse ¶
type PlansResponse ¶
type PlansResponse struct { Messages []string `json:"messages"` PlansMap map[string]*Plan `json:"result"` }
func (*PlansResponse) Plans ¶
func (rsp *PlansResponse) Plans() (plans []*Plan)
type Server ¶
type Server struct { Id int `json:"id"` Name string `json:"name"` Ips map[string][]string `json:"ips"` Status string `json:"status"` Created int64 `json:"created"` RecoverymodeActive bool `json:"recoverymodeActive"` ManualBackupRunning bool `json:"manualBackupRunning"` IsBeingCopied bool `json:"isBeingCopied"` Running bool `json:"running"` Host string `json:"host"` Plan *Plan `json:"plan"` ActiveProfile *ActiveProfile `json:"activeProfile"` Metadata map[string]string `json:"metadata"` }
Click to show internal directories.
Click to hide internal directories.