online

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Server(id int) (*Server, error)
	SetServer(s *Server) error

	BootRescueMode(serverID int, image string) (*RescueCredentials, error)
	BootNormalMode(serverID int) error

	GetRescueImages(serverID int) ([]string, error)

	EditFailoverIP(source, destination string) error
	GenerateMACFailoverIP(address, macType string) (string, error)
	DeleteMACFailoverIP(address string) error

	ListRPNv2() ([]*RPNv2, error)
	RPNv2(id int) (*RPNv2, error)
	RPNv2ByName(name string) (*RPNv2, error)
	SetRPNv2(r *RPNv2, wait time.Duration) error
	DeleteRPNv2(id int, wait time.Duration) error
}

func NewClient

func NewClient(token string) Client

type ErrorResponse

type ErrorResponse struct {
	Code    int
	Message string `json:"error"`
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type Interface

type Interface struct {
	Address         string        `json:"address"`
	MAC             string        `json:"mac"`
	Reverse         string        `json:"reverse"`
	SwitchPortState string        `json:"switch_port_state"`
	Type            InterfaceType `json:"type"`
}

type InterfaceType

type InterfaceType string
const (
	Public  InterfaceType = "public"
	Private InterfaceType = "private"
)

type Location

type Location struct {
	Block      string `json:"block"`
	Datacenter string `json:"datacenter"`
	Position   int    `json:"position"`
	Rack       string `json:"rack"`
	Room       string `json:"room"`
}

type Member

type Member struct {
	ID     int `json:"id"`
	Linked struct {
		ID   int    `json:"id"`
		IP   string `json:"ip"`
		Type string `json:"type"`
		Ref  string `json:"$ref"`
	} `json:"linked"`
	Status string `json:"status"`
	VLAN   int    `json:"vlan"`
}

type OS

type OS struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type RPNv2

type RPNv2 struct {
	ID                 int       `json:"id,omitempty"`
	Name               string    `json:"description"`
	Status             string    `json:"status,omitempty"`
	Type               RPNv2Type `json:"type"`
	CompatibilityRPNv1 bool      `json:"compatibility_rpn_v1"`
	Members            []*Member `json:"member,omitempty"`
}

func (*RPNv2) MemberByServerID

func (r *RPNv2) MemberByServerID(id int) *Member

type RPNv2Type

type RPNv2Type string
const (
	Standard RPNv2Type = "STANDARD"
	QinQ     RPNv2Type = "QINQ"
	Demo     RPNv2Type = "DEMO"
)

type RescueCredentials

type RescueCredentials struct {
	Login    string `json:"login"`
	Password string `json:"password"`
	Protocol string `json:"protocol"`
	IP       string `json:"ip"`
}

RescueCredentials contain the login details for a server that booted into rescue mode

type Server

type Server struct {
	ID                  int         `json:"id"`
	Offer               string      `json:"offer"`
	Hostname            string      `json:"hostname"`
	OS                  interface{} `json:"os"`
	Power               string      `json:"power"`
	BootMode            string      `json:"boot_mode"`
	LastReboot          string      `json:"last_reboot"`
	AntiDDOS            bool        `json:"anti_ddos"`
	HardwareWatch       bool        `json:"hardware_watch"`
	ProactiveMonitoring bool        `json:"proactive_monitoring"`
	Support             string      `json:"support"`
	Abuse               string      `json:"abuse"`
	Location            *Location   `json:"location"`
	Network             struct {
		Public  []string      `json:"ip"`
		Private []string      `json:"private"`
		Ipfo    []interface{} `json:"ipfo"`
	} `json:"network"`
	IP       []*Interface `json:"ip"`
	Contacts struct {
		Owner string `json:"owner"`
		Tech  string `json:"tech"`
	} `json:"contacts"`
	Disks []struct {
		Ref string `json:"$ref"`
	} `json:"disks"`
	DriveArrays []struct {
		Disks []struct {
			Ref string `json:"$ref"`
		} `json:"disks"`
		RaidController struct {
			Ref string `json:"$ref"`
		} `json:"raid_controller"`
		RaidLevel string `json:"raid_level"`
	} `json:"drive_arrays"`
	RaidControllers []struct {
		Ref string `json:"$ref"`
	} `json:"raid_controllers"`
	BMC struct {
		SessionKey interface{} `json:"session_key"`
	} `json:"bmc"`
}

func (*Server) InterfaceByType

func (s *Server) InterfaceByType(t InterfaceType) *Interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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