api

package
v0.0.0-...-f1fced7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Arch_Linux_2014_10 = Distribution{
	Is64Bit:            true,
	Label:              "Arch_Linux_2014_10",
	MinimumImageSize:   600,
	DistributionId:     132,
	CreateDateTime:     Arch_Linux_2014_10_Time,
	RequiresVopsKernel: true,
}
View Source
var Arch_Linux_2014_10_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-10-06 15:32:20.0")
View Source
var Arch_Linux_2015_02 = Distribution{
	Is64Bit:            true,
	Label:              "Arch_Linux_2015_02",
	MinimumImageSize:   800,
	DistributionId:     138,
	CreateDateTime:     Arch_Linux_2015_02_Time,
	RequiresVopsKernel: true,
}
View Source
var Arch_Linux_2015_02_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2015-02-20 14:17:16.0")
View Source
var Atlanta = DataCenter{
	Id:           4,
	Location:     "Atlanta, GA, USA",
	Abbreviation: "atlanta",
}
View Source
var CentOS_5_6 = Distribution{
	Is64Bit:            true,
	Label:              "CentOS_5_6",
	MinimumImageSize:   950,
	DistributionId:     60,
	CreateDateTime:     CentOS_5_6_Time,
	RequiresVopsKernel: true,
}
View Source
var CentOS_5_6_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2009-08-17 00:00:00.0")
View Source
var CentOS_6_5 = Distribution{
	Is64Bit:            true,
	Label:              "CentOS_6_5",
	MinimumImageSize:   675,
	DistributionId:     127,
	CreateDateTime:     CentOS_6_5_Time,
	RequiresVopsKernel: true,
}
View Source
var CentOS_6_5_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-04-28 15:19:34.0")
View Source
var CentOS_7 = Distribution{
	Is64Bit:            true,
	Label:              "CentOS_7",
	MinimumImageSize:   750,
	DistributionId:     129,
	CreateDateTime:     CentOS_7_Time,
	RequiresVopsKernel: true,
}
View Source
var CentOS_7_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-07-08 10:07:21.0")
View Source
var Dallas = DataCenter{
	Id:           2,
	Location:     "Dallas, TX, USA",
	Abbreviation: "dallas",
}
View Source
var DataCenters = map[string]DataCenter{
	"Dallas":    Dallas,
	"Fremont":   Fremont,
	"Atlanta":   Atlanta,
	"Newark":    Newark,
	"London":    London,
	"Tokyo":     Tokyo,
	"Singapore": Singapore,
}
View Source
var Debian_6 = Distribution{
	Is64Bit:            true,
	Label:              "Debian_6",
	MinimumImageSize:   550,
	DistributionId:     78,
	CreateDateTime:     Debian_6_Time,
	RequiresVopsKernel: true,
}
View Source
var Debian_6_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2011-02-08 16:54:31.0")
View Source
var Debian_7 = Distribution{
	Is64Bit:            true,
	Label:              "Debian_7",
	MinimumImageSize:   600,
	DistributionId:     130,
	CreateDateTime:     Debian_7_Time,
	RequiresVopsKernel: true,
}
View Source
var Debian_7_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-09-24 13:59:32.0")
View Source
var Debian_8_1 = Distribution{
	Is64Bit:            true,
	Label:              "Debian_8_1",
	MinimumImageSize:   900,
	DistributionId:     140,
	CreateDateTime:     Debian_8_1_Time,
	RequiresVopsKernel: true,
}
View Source
var Debian_8_1_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2015-04-27 16:26:41.0")
View Source
var Distributions = map[string]Distribution{
	"Arch_Linux_2015_02":    Arch_Linux_2015_02,
	"CentOS_7":              CentOS_7,
	"Debian_7":              Debian_7,
	"Debian_8_1":            Debian_8_1,
	"Fedora_22":             Fedora_22,
	"Gentoo_2014_12":        Gentoo_2014_12,
	"OpenSUSE_13_2":         OpenSUSE_13_2,
	"Slackware_14_1":        Slackware_14_1,
	"Ubuntu_14_04_LTS":      Ubuntu_14_04_LTS,
	"Ubuntu_15_04":          Ubuntu_15_04,
	"Arch_Linux_2014_10":    Arch_Linux_2014_10,
	"CentOS_5_6":            CentOS_5_6,
	"CentOS_6_5":            CentOS_6_5,
	"Debian_6":              Debian_6,
	"Fedora_20":             Fedora_20,
	"Fedora_21":             Fedora_21,
	"Gentoo_2013_11_26":     Gentoo_2013_11_26,
	"OpenSUSE_13_1":         OpenSUSE_13_1,
	"Slackware_13_37":       Slackware_13_37,
	"Ubuntu_12_04_LTS":      Ubuntu_12_04_LTS,
	"Ubuntu_14_10":          Ubuntu_14_10,
	"Slackware_13_37_32bit": Slackware_13_37_32bit,
}
View Source
var Fedora_20 = Distribution{
	Is64Bit:            true,
	Label:              "Fedora_20",
	MinimumImageSize:   1536,
	DistributionId:     122,
	CreateDateTime:     Fedora_20_Time,
	RequiresVopsKernel: true,
}
View Source
var Fedora_20_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2013-01-27 10:00:00.0")
View Source
var Fedora_21 = Distribution{
	Is64Bit:            true,
	Label:              "Fedora_21",
	MinimumImageSize:   650,
	DistributionId:     134,
	CreateDateTime:     Fedora_21_Time,
	RequiresVopsKernel: true,
}
View Source
var Fedora_21_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-12-10 16:56:28.0")
View Source
var Fedora_22 = Distribution{
	Is64Bit:            true,
	Label:              "Fedora_22",
	MinimumImageSize:   650,
	DistributionId:     141,
	CreateDateTime:     Fedora_22_Time,
	RequiresVopsKernel: true,
}
View Source
var Fedora_22_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2015-05-26 13:50:58.0")
View Source
var Fremont = DataCenter{
	Id:           3,
	Location:     "Fremont, CA, USA",
	Abbreviation: "fremont",
}
View Source
var Gentoo_2013_11_26 = Distribution{
	Is64Bit:            true,
	Label:              "Gentoo_2013_11_26",
	MinimumImageSize:   3072,
	DistributionId:     118,
	CreateDateTime:     Gentoo_2013_11_26_Time,
	RequiresVopsKernel: true,
}
View Source
var Gentoo_2013_11_26_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2013-11-26 15:20:31.0")
View Source
var Gentoo_2014_12 = Distribution{
	Is64Bit:            true,
	Label:              "Gentoo_2014_12",
	MinimumImageSize:   2000,
	DistributionId:     137,
	CreateDateTime:     Gentoo_2014_12_Time,
	RequiresVopsKernel: true,
}
View Source
var Gentoo_2014_12_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-12-24 18:00:09.0")
View Source
var Linode_1024 = Plan{
	Cores:      1,
	Price:      10,
	Ram:        1024,
	Xfer:       2000,
	Id:         1,
	Label:      "Linode 1024",
	DiskSpace:  24,
	HourlyCost: 0.015,
}
View Source
var Linode_16384 = Plan{
	Cores:      8,
	Price:      160,
	Ram:        16384,
	Xfer:       16000,
	Id:         7,
	Label:      "Linode 16384",
	DiskSpace:  384,
	HourlyCost: 0.24,
}
View Source
var Linode_2048 = Plan{
	Cores:      2,
	Price:      20,
	Ram:        2048,
	Xfer:       3000,
	Id:         2,
	Label:      "Linode 2048",
	DiskSpace:  48,
	HourlyCost: 0.03,
}
View Source
var Linode_32768 = Plan{
	Cores:      12,
	Price:      320,
	Ram:        32768,
	Xfer:       20000,
	Id:         8,
	Label:      "Linode 32768",
	DiskSpace:  768,
	HourlyCost: 0.48,
}
View Source
var Linode_4096 = Plan{
	Cores:      4,
	Price:      40,
	Ram:        4096,
	Xfer:       4000,
	Id:         4,
	Label:      "Linode 4096",
	DiskSpace:  96,
	HourlyCost: 0.06,
}
View Source
var Linode_49152 = Plan{
	Cores:      16,
	Price:      480,
	Ram:        49152,
	Xfer:       20000,
	Id:         9,
	Label:      "Linode 49152",
	DiskSpace:  1152,
	HourlyCost: 0.72,
}
View Source
var Linode_65536 = Plan{
	Cores:      20,
	Price:      640,
	Ram:        65536,
	Xfer:       20000,
	Id:         10,
	Label:      "Linode 65536",
	DiskSpace:  1536,
	HourlyCost: 0.96,
}
View Source
var Linode_8192 = Plan{
	Cores:      6,
	Price:      80,
	Ram:        8192,
	Xfer:       8000,
	Id:         6,
	Label:      "Linode 8192",
	DiskSpace:  192,
	HourlyCost: 0.12,
}
View Source
var Linode_98304 = Plan{
	Cores:      20,
	Price:      960,
	Ram:        98304,
	Xfer:       20000,
	Id:         12,
	Label:      "Linode 98304",
	DiskSpace:  1920,
	HourlyCost: 1.44,
}
View Source
var London = DataCenter{
	Id:           7,
	Location:     "London, England, UK",
	Abbreviation: "london",
}
View Source
var Newark = DataCenter{
	Id:           6,
	Location:     "Newark, NJ, USA",
	Abbreviation: "newark",
}
View Source
var OpenSUSE_13_1 = Distribution{
	Is64Bit:            true,
	Label:              "OpenSUSE_13_1",
	MinimumImageSize:   1024,
	DistributionId:     120,
	CreateDateTime:     OpenSUSE_13_1_Time,
	RequiresVopsKernel: true,
}
View Source
var OpenSUSE_13_1_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2013-12-02 12:53:29.0")
View Source
var OpenSUSE_13_2 = Distribution{
	Is64Bit:            true,
	Label:              "OpenSUSE_13_2",
	MinimumImageSize:   700,
	DistributionId:     135,
	CreateDateTime:     OpenSUSE_13_2_Time,
	RequiresVopsKernel: true,
}
View Source
var OpenSUSE_13_2_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-12-17 17:55:42.0")
View Source
var Plans = map[string]Plan{
	"Linode_1024":  Linode_1024,
	"Linode_2048":  Linode_2048,
	"Linode_4096":  Linode_4096,
	"Linode_8192":  Linode_8192,
	"Linode_16384": Linode_16384,
	"Linode_32768": Linode_32768,
	"Linode_49152": Linode_49152,
	"Linode_65536": Linode_65536,
	"Linode_98304": Linode_98304,
}
View Source
var Singapore = DataCenter{
	Id:           9,
	Location:     "Singapore, SG",
	Abbreviation: "singapore",
}
View Source
var Slackware_13_37 = Distribution{
	Is64Bit:            true,
	Label:              "Slackware_13_37",
	MinimumImageSize:   600,
	DistributionId:     87,
	CreateDateTime:     Slackware_13_37_Time,
	RequiresVopsKernel: true,
}
View Source
var Slackware_13_37_32bit = Distribution{
	Is64Bit:            false,
	Label:              "Slackware_13_37_32bit",
	MinimumImageSize:   600,
	DistributionId:     86,
	CreateDateTime:     Slackware_13_37_32bit_Time,
	RequiresVopsKernel: true,
}
View Source
var Slackware_13_37_32bit_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2011-06-05 15:11:59.0")
View Source
var Slackware_13_37_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2011-06-05 15:11:59.0")
View Source
var Slackware_14_1 = Distribution{
	Is64Bit:            true,
	Label:              "Slackware_14_1",
	MinimumImageSize:   875,
	DistributionId:     117,
	CreateDateTime:     Slackware_14_1_Time,
	RequiresVopsKernel: true,
}
View Source
var Slackware_14_1_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2013-11-25 11:11:02.0")
View Source
var Tokyo = DataCenter{
	Id:           8,
	Location:     "Tokyo, JP",
	Abbreviation: "tokyo",
}
View Source
var Ubuntu_12_04_LTS = Distribution{
	Is64Bit:            true,
	Label:              "Ubuntu_12_04_LTS",
	MinimumImageSize:   550,
	DistributionId:     126,
	CreateDateTime:     Ubuntu_12_04_LTS_Time,
	RequiresVopsKernel: true,
}
View Source
var Ubuntu_12_04_LTS_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-04-28 14:16:59.0")
View Source
var Ubuntu_14_04_LTS = Distribution{
	Is64Bit:            true,
	Label:              "Ubuntu_14_04_LTS",
	MinimumImageSize:   750,
	DistributionId:     124,
	CreateDateTime:     Ubuntu_14_04_LTS_Time,
	RequiresVopsKernel: true,
}
View Source
var Ubuntu_14_04_LTS_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-04-17 15:42:07.0")
View Source
var Ubuntu_14_10 = Distribution{
	Is64Bit:            true,
	Label:              "Ubuntu_14_10",
	MinimumImageSize:   650,
	DistributionId:     133,
	CreateDateTime:     Ubuntu_14_10_Time,
	RequiresVopsKernel: true,
}
View Source
var Ubuntu_14_10_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2014-10-24 15:48:04.0")
View Source
var Ubuntu_15_04 = Distribution{
	Is64Bit:            true,
	Label:              "Ubuntu_15_04",
	MinimumImageSize:   1200,
	DistributionId:     139,
	CreateDateTime:     Ubuntu_15_04_Time,
	RequiresVopsKernel: true,
}
View Source
var Ubuntu_15_04_Time, _ = time.Parse("2007-04-18 00:00:00.0", "2015-04-23 11:08:05.0")

Functions

func FloatToBoolean

func FloatToBoolean(value interface{}) bool

func GetAPIKeyFromEnvironment

func GetAPIKeyFromEnvironment() string

GetAPIKeyFromEnvironment ...

func GetRawJson

func GetRawJson(response []byte) (json.RawMessage, error)

func GetRawJsons

func GetRawJsons(response []byte) ([]json.RawMessage, error)

func GoSafeString

func GoSafeString(label string) string

func IntToBool

func IntToBool(value float64) string

func Integer

func Integer(data interface{}) int

func LabelVariableSafe

func LabelVariableSafe(label string) string

func StringOrNil

func StringOrNil(data interface{}) string

func UpperCaseFirstLetter

func UpperCaseFirstLetter(name string) string

UpperCaseFirstLetter ...

func ValuesWithActionAndKey

func ValuesWithActionAndKey(key string, action string) *url.Values

ValuesWithActionAndKey ...

Types

type CreateLinodeRequest

type CreateLinodeRequest struct {
	DataCenterId int
	PlanId       int
	PaymentTerm  int
}

func (*CreateLinodeRequest) SetDataCenter

func (c *CreateLinodeRequest) SetDataCenter(dc DataCenter) *CreateLinodeRequest

SetDataCenter ... Use DataCenter object to set DataCenter.

func (*CreateLinodeRequest) SetPaymentTerm

func (c *CreateLinodeRequest) SetPaymentTerm(term int) *CreateLinodeRequest

func (*CreateLinodeRequest) SetPlan

func (c *CreateLinodeRequest) SetPlan(plan Plan) *CreateLinodeRequest

type DataCenter

type DataCenter struct {
	Id           int
	Location     string
	Abbreviation string
}

type Distribution

type Distribution struct {
	Is64Bit            bool
	Label              string
	MinimumImageSize   int
	DistributionId     int
	CreateDateTime     time.Time
	RequiresVopsKernel bool
}

type Linode

type Linode struct {
	TotalXfer       int    `json:"TOTALXFER"`
	BackupsEnabled  bool   `json:"BACKUPSENABLED"`
	WatchdogEnabled bool   `json:"WATCHDOG"`
	LpmDisplayGroup string `json:"LPM_DISPLAYGROUP"`
	Status          LinodeStatus
	StatusString    string `json:"STATUS"`
	TotalRAM        int    `json:"TOTALRAM"`
	TotalHardDisk   int    `json:"TOTALHD"`
	BackupWindow    bool   `json:"BACKUPWINDOW"`
	Label           string `json:"LABEL"`
	BackupWeeklyDay int    `json:"BAKCUPWEEKLYDAY"`

	Id int `json:"LINODEID"`

	PlanId                int    `json:"PLANID"`
	DistributionVendor    string `json:"DISTRIBUTIONVENDOR"`
	BandwidthQuotaEnabled bool   `json:"ALERT_BWQUOTA_ENABLED"`
	DiskIOThreshold       int    `json:"ALERT_DISKIO_THRESHOLD"`
	DiskIOEnabled         bool   `json:"ALERT_DISKIO_ENABLED"`
	BandwithOutEnabled    bool   `json:"ALERT_BWOUT_ENABLED"`
	BandwidthOutThreshold int    `json:"ALERT_BWOUT_THRESHOLD"`
	BandwidthInThreshold  int    `json:"ALERT_BWIN_THRESHOLD"`
	BandwidthInEnabled    bool   `json:"ALERT_BWIN_ENABLED"`
	CPUThreshold          int    `json:"ALERT_CPU_THRESHOLD"`
	// contains filtered or unexported fields
}

func (*Linode) Refresh

func (c *Linode) Refresh()

type LinodeClient

type LinodeClient struct {
	APIEndpoint string
	APIKey      string
	// contains filtered or unexported fields
}

func NewLinodeClient

func NewLinodeClient() *LinodeClient

func NewLinodeClientWithKey

func NewLinodeClientWithKey(apiKey string) *LinodeClient

func (*LinodeClient) CallAction

func (c *LinodeClient) CallAction(action string) ([]byte, error)

func (*LinodeClient) CreateLinode

func (c *LinodeClient) CreateLinode(request *CreateLinodeRequest) *Linode

func (*LinodeClient) HandleCall

func (c *LinodeClient) HandleCall(query string) ([]byte, error)

func (*LinodeClient) ImmediateCall

func (c *LinodeClient) ImmediateCall(query string) ([]byte, error)

func (*LinodeClient) InitialValues

func (c *LinodeClient) InitialValues(action string) url.Values

func (*LinodeClient) ListLinodes

func (c *LinodeClient) ListLinodes(request ListLinodesRequest) ([]Linode, error)

type LinodeStatus

type LinodeStatus string
const (
	BeingCreated LinodeStatus = "-1"
	BrandNew     LinodeStatus = "0"
	Running      LinodeStatus = "1"
	PoweredOff   LinodeStatus = "2"
)

type ListLinodesRequest

type ListLinodesRequest struct {
	LinodeId int
}

type Plan

type Plan struct {
	Id             int
	Cores          int
	Price          float32
	Ram            int
	Xfer           int
	Label          string
	DiskSpace      int
	HourlyCost     float32
	AvailableNodes map[string]int
}

Jump to

Keyboard shortcuts

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