hrobot

package
v0.0.0-...-787a6e0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const Endpoint = "https://robot-ws.your-server.de"

Endpoint is th

View Source
const Version = "0.0.1"

Variables

This section is empty.

Functions

func PrettyPrint

func PrettyPrint(i interface{}) string

Types

type AddvSwitchOps

type AddvSwitchOps struct {
	Name    string `url:"name"`
	Vlan_ID int    `url:"vlan"`
}

Vlan_ID has to be in range: 4000 to 4091

type BootClient

type BootClient struct {
	// contains filtered or unexported fields
}

func (*BootClient) ActivateLinux

func (c *BootClient) ActivateLinux(ctx context.Context, servernumber string, opt *LinuxOpts) (*BootLinux, *Response, error)

func (*BootClient) ActivateRescue

func (c *BootClient) ActivateRescue(ctx context.Context, servernumber string, opt *RescueOpts) (*BootRescue, *Response, error)

activate the rescue system

func (*BootClient) ActivateVNC

func (c *BootClient) ActivateVNC(ctx context.Context, servernumber string, opt *VNCOpts) (*BootVnc, *Response, error)

func (*BootClient) ActivateWindows

func (c *BootClient) ActivateWindows(ctx context.Context, servernumber string, language string) (*BootWindows, *Response, error)

func (*BootClient) DeactivateLinux

func (c *BootClient) DeactivateLinux(ctx context.Context, servernumber string) (*BootLinux, *Response, error)

func (*BootClient) DeactivateRescue

func (c *BootClient) DeactivateRescue(ctx context.Context, servernumber string) (*BootRescue, *Response, error)

func (*BootClient) DeactivateVNC

func (c *BootClient) DeactivateVNC(ctx context.Context, servernumber string) (*BootVnc, *Response, error)

func (*BootClient) DeactivateWindows

func (c *BootClient) DeactivateWindows(ctx context.Context, servernumber string) (*BootWindows, *Response, error)

func (*BootClient) GetBootOptions

func (c *BootClient) GetBootOptions(ctx context.Context, servernumber string) (*BootList, *Response, error)

servernumber can also be serverip

func (*BootClient) GetLastLinux

func (c *BootClient) GetLastLinux(ctx context.Context, servernumber string) (*BootLinux, *Response, error)

Show data of last rescue activation

func (*BootClient) GetLastRescue

func (c *BootClient) GetLastRescue(ctx context.Context, servernumber string) (*BootRescue, *Response, error)

Show data of last rescue activation

func (*BootClient) GetLinux

func (c *BootClient) GetLinux(ctx context.Context, servernumber string) (*BootLinux, *Response, error)

func (*BootClient) GetRescue

func (c *BootClient) GetRescue(ctx context.Context, servernumber string) (*BootRescue, *Response, error)

query boot options for the Rescue System

func (*BootClient) GetVNC

func (c *BootClient) GetVNC(ctx context.Context, servernumber string) (*BootVnc, *Response, error)

func (*BootClient) GetWindows

func (c *BootClient) GetWindows(ctx context.Context, servernumber string) (*BootWindows, *Response, error)

type BootLinux

type BootLinux struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	Dist          []string
	Arch          []int
	Lang          []string
	Active        bool
	Password      string
	AuthorizedKey []interface{}
	HostKey       []interface{}
}

func LinuxFromSchema

func LinuxFromSchema(s schema.LinuxList) *BootLinux

type BootList

type BootList struct {
	Rescue  BootRescue
	Linux   BootLinux
	Vnc     BootVnc
	Windows interface{}
	Plesk   interface{}
	Cpanel  interface{}
}

func BootListFromSchema

func BootListFromSchema(s schema.BootList) *BootList

type BootRescue

type BootRescue struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	Os            interface{}
	Arch          interface{}
	Active        bool
	Password      interface{}
	AuthorizedKey []interface{}
	HostKey       []interface{}
	BootTime      interface{}
}

func RescueFromSchema

func RescueFromSchema(s schema.RescueList) *BootRescue

type BootVnc

type BootVnc struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	Dist          []string
	Arch          []int
	Lang          []string
	Active        bool
	Password      string
}

func VncFromSchema

func VncFromSchema(s schema.VncList) *BootVnc

type BootWindows

type BootWindows struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	Dist          []string
	Lang          []string
	Active        bool
	Password      string
}

func WindowsFromSchema

func WindowsFromSchema(s schema.WindowsList) *BootWindows

type Cancellation

type Cancellation struct {
	ServerIP                 string
	ServerIpv6Net            string
	ServerNumber             int
	ServerName               string
	EarliestCancellationDate string
	Cancelled                bool
	ReservationPossible      bool
	Reserved                 bool
	CancellationDate         interface{}
	CancellationReason       interface{}
}

func CancellationFromSchema

func CancellationFromSchema(s schema.Cancellation) *Cancellation

type CancellationOps

type CancellationOps struct {
	CancellationDate   string `url:"cancellation_date"`
	CancellationReason string `url:"cancellation_reason"`
	ReverseLocation    bool   `url:"reserve_location"`
}

type Client

type Client struct {
	SSHKey     SSHKeyClient
	Server     ServerClient
	Order      OrderClient
	Boot       BootClient
	IP         IPClient
	Subnet     SubnetClient
	Reset      ResetClient
	WakeOnLane WOLClient
	Firewall   FirewallClient
	VSwitch    VSwitchClient
	Failover   FailoverClient
	RDNS       RDNSClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ...ClientOption) *Client

func (*Client) Do

func (c *Client) Do(r *http.Request, v interface{}) (*Response, error)

Do performs an HTTP request against the API.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, path string, data url.Values) (*http.Request, error)

NewRequest creates an HTTP request against the API. The returned request is assigned with ctx and has all necessary headers set (auth, user agent, etc.).

type ClientOption

type ClientOption func(*Client)

func WithBasicAuth

func WithBasicAuth(username, password string) ClientOption

func WithDebugWriter

func WithDebugWriter(debugWriter io.Writer) ClientOption

WithDebugWriter configures a Client to print debug information to the given writer. To, for example, print debug information on stderr, set it to os.Stderr.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient configures a Client to perform HTTP requests with httpClient.

func WithToken

func WithToken(token string) ClientOption

Token must be provided in this format: username:password

type CpanelOpts

type CpanelOpts struct {
	Dist     string `url:"dist"` //required
	Lang     string `url:"lang"` //required
	Hostname string `url:"hostname"`
}

type CreateKeyOpts

type CreateKeyOpts struct {
	Name string `url:"name"`
	Data string `url:"data"`
}

type Error

type Error struct {
	Status  int
	Code    string
	Message string
}

type Failover

type Failover struct {
	IP             string
	Netmask        string
	ServerIP       string
	ServerNumber   int
	ActiveServerIP string
}

func FailoverFromSchema

func FailoverFromSchema(s schema.Failover) *Failover

type FailoverClient

type FailoverClient struct {
	// contains filtered or unexported fields
}

func (*FailoverClient) DeleteFailover

func (c *FailoverClient) DeleteFailover(ctx context.Context, failover_ip string) (*Failover, *Response, error)

deletes the routing of a given IP

func (*FailoverClient) GetFailoverIP

func (c *FailoverClient) GetFailoverIP(ctx context.Context, ip string) (*Failover, *Response, error)

func (*FailoverClient) List

func (c *FailoverClient) List(ctx context.Context) ([]*Failover, *Response, error)

func (*FailoverClient) SwitchFailover

func (c *FailoverClient) SwitchFailover(ctx context.Context, active_server_ip string) (*Failover, *Response, error)

switches failover routing to given IP

type Firewall

type Firewall struct {
	ServerIP     string
	ServerNumber int
	Status       string
	Filter_IPv6  bool
	WhitelistHos bool
	Port         string
	Rules        struct {
		Input []struct {
			IPVersion string
			Name      string
			DstIP     interface{}
			SrcIP     string
			DstPort   string
			SrcPort   interface{}
			Protocol  interface{}
			TCPFlags  interface{}
			Action    string
		}
		Output []struct {
			IPVersion string
			Name      string
			DstIP     interface{}
			SrcIP     string
			DstPort   string
			SrcPort   interface{}
			Protocol  interface{}
			TCPFlags  interface{}
			Action    string
		}
	}
}

func FirewallFromSchema

func FirewallFromSchema(s schema.Firewall) *Firewall

type FirewallClient

type FirewallClient struct {
	// contains filtered or unexported fields
}

func (*FirewallClient) DeleteFirewallByIP

func (c *FirewallClient) DeleteFirewallByIP(ctx context.Context, ip string) (*Response, error)

func (*FirewallClient) DeleteFirewallByServerNumber

func (c *FirewallClient) DeleteFirewallByServerNumber(ctx context.Context, servernumber string) (*Response, error)

func (*FirewallClient) DeleteFirewallTemplateById

func (c *FirewallClient) DeleteFirewallTemplateById(ctx context.Context, id string) (*Response, error)

func (*FirewallClient) GetFirewallByIP

func (c *FirewallClient) GetFirewallByIP(ctx context.Context, ip string) (*Firewall, *Response, error)

func (*FirewallClient) GetFirewallByServernumber

func (c *FirewallClient) GetFirewallByServernumber(ctx context.Context, servernumber string) (*Firewall, *Response, error)

func (*FirewallClient) GetFirewallTemplate

func (c *FirewallClient) GetFirewallTemplate(ctx context.Context) ([]*FirewallTemplate, *Response, error)

func (*FirewallClient) GetFirewallTemplateById

func (c *FirewallClient) GetFirewallTemplateById(ctx context.Context, id string) (*FirewallTemplateWithRules, *Response, error)

func (*FirewallClient) PostFirewallByIP

func (c *FirewallClient) PostFirewallByIP(ctx context.Context, ip string, opt *FirewallOps) (*Firewall, *Response, error)

func (*FirewallClient) PostFirewallByServernumber

func (c *FirewallClient) PostFirewallByServernumber(ctx context.Context, servernumber string, opt *FirewallOps) (*Firewall, *Response, error)

func (*FirewallClient) PostFirewallTemplate

func (*FirewallClient) UpdateFirewallTemplateById

func (c *FirewallClient) UpdateFirewallTemplateById(ctx context.Context, id string, opt *FirewallTemplateOps) (*FirewallTemplateWithRules, *Response, error)

type FirewallOps

type FirewallOps struct {
	Status        string      `url:"status"`        //change the status of the firewall ('active' or 'disabled')
	Filter_IPv6   string      `url:"filter_ipv6"`   // activate or deactivate the ipv6 filter ('true' or 'false', optional)
	Whitelist_hos string      `url:"whitelist_hos"` // change the flag of hetzner services whitelisting (true or false)
	Rules         []InputRule `url:"-"`
	Template_id   string      `url:"template_id,omitempty"` // not possible in combination of whitelist_hos and rules
}

type FirewallRules

type FirewallRules struct {
	Rules struct {
		Input []struct {
			IPVersion string      `json:"ip_version"`
			Name      string      `json:"name"`
			DstIP     interface{} `json:"dst_ip"`
			SrcIP     string      `json:"src_ip"`
			DstPort   string      `json:"dst_port"`
			SrcPort   interface{} `json:"src_port"`
			Protocol  interface{} `json:"protocol"`
			TCPFlags  interface{} `json:"tcp_flags"`
			Action    string      `json:"action"`
		} `json:"input"`
	} `json:"rules"`
}

type FirewallTemplate

type FirewallTemplate struct {
	ID           int
	Name         string
	Filter_IPv6  bool
	WhitelistHos bool
	IsDefault    bool
}

func FirewallTemplateFromSchema

func FirewallTemplateFromSchema(s schema.FirewallTemplate) *FirewallTemplate

type FirewallTemplateOps

type FirewallTemplateOps struct {
	Name          string      `url:"name"`          //template name
	Filter_IPv6   string      `url:"filter_ipv6"`   // activate or deactivate the ipv6 filter ('true' or 'false', optional)
	Whitelist_hos bool        `url:"whitelist_hos"` // change the flag of hetzner services whitelisting (true or false)
	Is_Default    bool        `url:"is_default"`
	Rules         []InputRule `url:"-"`
}

type FirewallTemplateWithRules

type FirewallTemplateWithRules struct {
	ID           int `json:"id"`
	Name         string
	Filter_IPv6  bool
	WhitelistHos bool `json:"whitelist_hos"`
	IsDefault    bool `json:"is_default"`
	Rules        struct {
		Input []struct {
			IPVersion    string
			Name         string
			DstIP        interface{}
			SrcIP        string
			DstPort      string
			SrcPort      interface{}
			Protocol     interface{}
			TCPFlags     interface{}
			PacketLength interface{}
			Action       string
		}
		Output []struct {
			IPVersion    string
			Name         string
			DstIP        interface{}
			SrcIP        string
			DstPort      string
			SrcPort      interface{}
			Protocol     interface{}
			TCPFlags     interface{}
			PacketLength interface{}
			Action       string
		}
	}
}

type IP

type IP struct {
	IP              string
	ServerIP        string
	ServerNumber    int
	Locked          bool
	SeparateMac     interface{}
	TrafficWarnings bool
	TrafficHourly   int
	TrafficDaily    int
	TrafficMonthly  int
}

func IPFromSchema

func IPFromSchema(s schema.IP) *IP

type IPCancellation

type IPCancellation struct {
	IP                       string
	ServerNumber             int
	EarliestCancellationDate string
	Cancelled                bool
	CancellationDate         interface{}
}

func IPCancellationFromSchema

func IPCancellationFromSchema(s schema.IPCancellation) *IPCancellation

type IPClient

type IPClient struct {
	// contains filtered or unexported fields
}

func (*IPClient) DeleteCancellation

func (c *IPClient) DeleteCancellation(ctx context.Context, ip string) (*IPCancellation, *Response, error)

func (*IPClient) DeleteMAC

func (c *IPClient) DeleteMAC(ctx context.Context, ip string) (*MAC, *Response, error)

func (*IPClient) GenerateMAC

func (c *IPClient) GenerateMAC(ctx context.Context, ip string) (*MAC, *Response, error)

func (*IPClient) GetCancellation

func (c *IPClient) GetCancellation(ctx context.Context, ip string) (*IPCancellation, *Response, error)

func (*IPClient) GetIPByIP

func (c *IPClient) GetIPByIP(ctx context.Context, ip string) (*IPSingle, *Response, error)

func (*IPClient) GetMACByIP

func (c *IPClient) GetMACByIP(ctx context.Context, ip string) (*MAC, *Response, error)

func (*IPClient) List

func (c *IPClient) List(ctx context.Context) ([]*IP, *Response, error)

func (*IPClient) PostCancellation

func (c *IPClient) PostCancellation(ctx context.Context, ip string, cancellation_date string) (*IPCancellation, *Response, error)

func (*IPClient) UpdateTrafficByIP

func (c *IPClient) UpdateTrafficByIP(ctx context.Context, ip string, opt *IPOps) (*IPSingle, *Response, error)

updates Traffic Warning by IP Adress

type IPOps

type IPOps struct {
	TrafficWarnings bool   `url:"traffic_warnings"` //enable/disable traffic warnings (true,false)
	TrafficHourly   string `url:"traffic_hourly"`   // hourly traffic limit in MB
	TrafficDaily    string `url:"traffic_daily"`    // daily traffic limit in MB
	TrafficMonthly  string `url:"traffic_monthly"`  // monthly traffic limit in GB
}

type IPSingle

type IPSingle struct {
	IP              string
	Gateway         string
	Mask            int
	Broadcast       string
	ServerIP        string
	ServerNumber    int
	Locked          bool
	SeparateMac     interface{}
	TrafficWarnings bool
	TrafficHourly   int
	TrafficDaily    int
	TrafficMonthly  int
}

func IPSingleFromSchema

func IPSingleFromSchema(s schema.IPSingle) *IPSingle

type InputRule

type InputRule struct {
	IPVersion string `url:"ip_version"`
	Name      string `url:"name"`
	DstIP     string `url:"dst_ip"`
	SrcIP     string `url:"src_ip"`
	DstPort   string `url:"dst_port"`
	SrcPort   string `url:"src_port"`
	Protocol  string `url:"protocol"`
	TCPFlags  string `url:"tcp_flags"`
	Action    string `url:"action"`
}

type LinuxOpts

type LinuxOpts struct {
	Dist           string `url:"dist"` //required
	Lang           string `url:"lang"` //required
	Authorized_Key string `url:"authorized_key"`
}

type MAC

type MAC struct {
	IP  string
	MAC string
}

func MACFromSchema

func MACFromSchema(s schema.MAC) *MAC

type OrderClient

type OrderClient struct {
	// contains filtered or unexported fields
}

func (*OrderClient) GetMarketServerById

func (c *OrderClient) GetMarketServerById(ctx context.Context, transaction int) (*ServerMarketProduct, *Response, error)

func (*OrderClient) GetMarketTransactionById

func (c *OrderClient) GetMarketTransactionById(ctx context.Context, id string) (*ServerMarketTransaction, *Response, error)

func (*OrderClient) GetProductById

func (c *OrderClient) GetProductById(ctx context.Context, id string) (*ServerProduct, *Response, error)

func (*OrderClient) GetServerMarketTransactionList

func (c *OrderClient) GetServerMarketTransactionList(ctx context.Context) ([]*ServerMarketTransaction, *Response, error)

func (*OrderClient) GetServerTransactionById

func (c *OrderClient) GetServerTransactionById(ctx context.Context, id string) (*ServerOrderTransaction, *Response, error)

func (*OrderClient) GetServerTransactionList

func (c *OrderClient) GetServerTransactionList(ctx context.Context) ([]*ServerOrderTransaction, *Response, error)

overview of the last orders within 30 days

func (*OrderClient) ListMarket

func (*OrderClient) OrderServer

orders a server return 201 if succesful

func (*OrderClient) OrderServerMarket

func (c *OrderClient) OrderServerMarket(ctx context.Context, opt *OrderMarketOpts) (*ServerMarketTransaction, *Response, error)

func (*OrderClient) ProductList

func (c *OrderClient) ProductList(ctx context.Context, opt *OrderServerListOpts) ([]*ServerProduct, *Response, error)

type OrderMarketListOpts

type OrderMarketListOpts struct {
	CPU               string `url:"cpu"`
	Min_CPU_Benchmark string `url:"min_cpu_benchmark"`
	Max_CPU_Benchmark string `url:"max_cpu_benchmark"`
	Min_Memory_Size   string `url:"min_memory_size"`
	Max_Memory_Size   string `url:"max_memory_size"`
	Min_HDD_Size      string `url:"min_hdd_size"`
	Max_HDD_Size      string `url:"max_hdd_size"`
	Search            string `url:"search"`
	Min_Price         string `url:"min_price"`
	Max_Price         string `url:"max_price"`
}

type OrderMarketOpts

type OrderMarketOpts struct {
	Product_ID      string `url:"product_id"`       //required
	Authorized_Keys string `url:"authorized_key[]"` //required
	//Password        string `url:"password"`
	Dist    string `url:"dist"`
	Arch    string `url:"arch"`
	Lang    string `url:"lang"`
	Comment string `url:"comment"`
	Test    bool   `url:"test"`
}

type OrderServerListOpts

type OrderServerListOpts struct {
	Min_Price       string `url:"min_price"`
	Max_Price       string `url:"max_price"`
	Min_Price_Setup string `url:"min_price_setup"`
	Max_Price_Setup string `url:"max_price_setup"`
	Location        string `url:"location"`
}

type OrderServerOpts

type OrderServerOpts struct {
	Product_ID     string `url:"product_id"`       //required
	Authorized_Key string `url:"authorized_key[]"` //required
	//Password string `url:"password"`
	Location string `url:"location"` //required
	Dist     string `url:"dist"`
	Arch     string `url:"arch"`
	Lang     string `url:"lang"`
	Comment  string `url:"comment"`
	Addons   string `url:"addons[]"`
	Test     bool   `url:"test"`
}

type PleskOpts

type PleskOpts struct {
	Dist     string `url:"dist"` //required
	Lang     string `url:"lang"` //required
	Hostname string `url:"hostname"`
}

type RDNS

type RDNS struct {
	IP  string
	PTR string
}

func RDNSFromSchema

func RDNSFromSchema(s schema.RDNS) *RDNS

type RDNSClient

type RDNSClient struct {
	// contains filtered or unexported fields
}

func (*RDNSClient) CreateRDNS

func (c *RDNSClient) CreateRDNS(ctx context.Context, ip string, ptr string) (*RDNS, *Response, error)

func (*RDNSClient) Delete

func (c *RDNSClient) Delete(ctx context.Context, ip string) (*Response, error)

func (*RDNSClient) GetAll

func (c *RDNSClient) GetAll(ctx context.Context) ([]*RDNS, *Response, error)

func (*RDNSClient) GetByIP

func (c *RDNSClient) GetByIP(ctx context.Context, ip string) (*RDNS, *Response, error)

func (*RDNSClient) UpdateRDNS

func (c *RDNSClient) UpdateRDNS(ctx context.Context, ip string, ptr string) (*RDNS, *Response, error)

type RescueOpts

type RescueOpts struct {
	OS             string `url:"os"`   //required
	Arch           string `url:"arch"` // deprecated
	Authorized_Key string `url:"authorized_key"`
	Keyboard       string `url:"keyboard"` // default: us
}

type Reset

type Reset struct {
	ServerIP        string
	ServerIpv6Net   string
	ServerNumber    int
	Type            interface{}
	OperatingStatus string
}

func ResetFromSchema

func ResetFromSchema(s schema.Reset) *Reset

type ResetClient

type ResetClient struct {
	// contains filtered or unexported fields
}

func (*ResetClient) ExecuteReset

func (c *ResetClient) ExecuteReset(ctx context.Context, servernumber string, hwtype string) (*Reset, *Response, error)

func (*ResetClient) GetResetByServernumber

func (c *ResetClient) GetResetByServernumber(ctx context.Context, servernumber string) (*Reset, *Response, error)

func (*ResetClient) List

func (c *ResetClient) List(ctx context.Context) ([]*Reset, *Response, error)

type Response

type Response struct {
	*http.Response
}

type RulesJSONtoURLENCode

type RulesJSONtoURLENCode func()

type SSHKey

type SSHKey struct {
	Name        string
	Fingerprint string
	Type        string
	Size        int
	Data        string
	Created     string
}

func SSHKeyFromSchema

func SSHKeyFromSchema(s schema.Key) *SSHKey

Converts an json Key to SSHKey struct

type SSHKeyClient

type SSHKeyClient struct {
	// contains filtered or unexported fields
}

func (*SSHKeyClient) Create

func (c *SSHKeyClient) Create(ctx context.Context, opt *CreateKeyOpts) (*SSHKey, *Response, error)

func (*SSHKeyClient) Delete

func (c *SSHKeyClient) Delete(ctx context.Context, fingerprint string) (*Response, error)

func (*SSHKeyClient) GetByFingerprint

func (c *SSHKeyClient) GetByFingerprint(ctx context.Context, fingerprint string) (*SSHKey, *Response, error)

func (*SSHKeyClient) List

func (c *SSHKeyClient) List(ctx context.Context) ([]*SSHKey, *Response, error)

GetByID retrieves a SSH key by its ID. If the SSH key does not exist, nil is returned.

func (*SSHKeyClient) Update

func (c *SSHKeyClient) Update(ctx context.Context, fingerprint string, opt *UpdateKeyOpts) (*SSHKey, *Response, error)

type Server

type Server struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	ServerName    string
	Product       string
	Dc            string
	Traffic       string
	Status        string
	Cancelled     bool
	PaidUntil     string
	IP            []string
	Subnet        []struct {
		IP   string
		Mask string
	}
	LinkedStoragebox interface{}
}

func ServerFromSchema

func ServerFromSchema(s schema.Server) *Server

type ServerClient

type ServerClient struct {
	// contains filtered or unexported fields
}

func (*ServerClient) DeleteCancellation

func (c *ServerClient) DeleteCancellation(ctx context.Context, servernumber string) (*Response, error)

revoke a cancellation

func (*ServerClient) GetCancellation

func (c *ServerClient) GetCancellation(ctx context.Context, servernumber string) (*Cancellation, *Response, error)

get the cancellation status of a server

func (*ServerClient) GetServerById

func (c *ServerClient) GetServerById(ctx context.Context, id string) (*SingleServer, *Response, error)

func (*ServerClient) List

func (c *ServerClient) List(ctx context.Context) ([]*Server, *Response, error)

func (*ServerClient) PostCancellation

func (c *ServerClient) PostCancellation(ctx context.Context, servernumber string, opt *CancellationOps) (*Cancellation, *Response, error)

cancel a server

func (*ServerClient) PostReversal

func (c *ServerClient) PostReversal(ctx context.Context, servernumber string, reversal_reason string) (*Cancellation, *Response, error)

cancel orderd server

func (*ServerClient) UpdateServerName

func (c *ServerClient) UpdateServerName(ctx context.Context, id string, servername string) (*SingleServer, *Response, error)

updates servername

type ServerMarketProduct

type ServerMarketProduct struct {
	ID             int
	Name           string
	Description    []string
	Traffic        string
	Dist           []string
	Arch           []int
	Lang           []string
	CPU            string
	CPUBenchmark   int
	MemorySize     int
	HddSize        int
	HddText        string
	HddCount       int
	Datacenter     string
	NetworkSpeed   string
	Price          string
	PriceSetup     string
	PriceVat       string
	PriceSetupVat  string
	FixedPrice     bool
	NextReduce     int
	NextReduceDate string
}

type ServerMarketTransaction

type ServerMarketTransaction struct {
	ID            string
	Date          time.Time
	Status        string
	ServerNumber  interface{}
	ServerIP      interface{}
	AuthorizedKey []struct {
		Key struct {
			Name        string
			Fingerprint string
			Type        string
			Size        int
		}
	}
	HostKey []interface{}
	Comment interface{}
	Product struct {
		ID           int
		Name         string
		Description  []string
		Traffic      string
		Dist         string
		Arch         string
		Lang         string
		CPU          string
		CPUBenchmark int
		MemorySize   int
		HddSize      int
		HddText      string
		HddCount     int
		Datacenter   string
		NetworkSpeed string
	}
}

type ServerOrderTransaction

type ServerOrderTransaction struct {
	ID            string
	Date          time.Time
	Status        string
	ServerNumber  interface{}
	ServerIP      interface{}
	AuthorizedKey []struct {
		Key struct {
			Name        string
			Fingerprint string
			Type        string
			Size        int
		}
	}
	HostKey []interface{}
	Comment interface{}
	Product struct {
		ID          string
		Name        string
		Description []string
		Traffic     string
		Dist        string
		Arch        int
		Lang        string
		Location    string
	}
	Addons []interface{}
}

type ServerProduct

type ServerProduct struct {
	ID          string
	Name        string
	Description []string
	Traffic     string
	Dist        []string
	Arch        []int
	Lang        []string
	Location    []string
	Prices      []struct {
		Location string
		Price    struct {
			Net   string
			Gross string
		}
		PriceSetup struct {
			Net   string
			Gross string
		}
	}
	OrderableAddons []struct {
		ID     string
		Name   string
		Min    int
		Max    int
		Prices interface{}
	}
}

func ServerProductFromSchema

func ServerProductFromSchema(s schema.ServerProduct) *ServerProduct

type SingleServer

type SingleServer struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	ServerName    string
	Product       string
	Dc            string
	Traffic       string
	Status        string
	Cancelled     bool
	PaidUntil     string
	IP            []string
	Subnet        []struct {
		IP   string
		Mask string
	}
	Reset            bool
	Rescue           bool
	Vnc              bool
	Windows          bool
	Plesk            bool
	Cpanel           bool
	Wol              bool
	HotSwap          bool
	LinkedStoragebox interface{}
}

func SingleServerFromSchema

func SingleServerFromSchema(s schema.SingleServer) *SingleServer

type Subnet

type Subnet struct {
	IP              string
	Mask            int
	Gateway         string
	ServerIP        string
	ServerNumber    int
	Failover        bool
	Locked          bool
	TrafficWarnings bool
	TrafficHourly   int
	TrafficDaily    int
	TrafficMonthly  int
}

func SubnetFromSchema

func SubnetFromSchema(s schema.Subnet) *Subnet

type SubnetCancellation

type SubnetCancellation struct {
	IP                       string
	Mask                     int
	ServerNumber             int
	EarliestCancellationDate string
	Cancelled                bool
	CancellationDate         interface{}
}

func SubnetCancellationFromSchema

func SubnetCancellationFromSchema(s schema.SubnetCancellation) *SubnetCancellation

type SubnetClient

type SubnetClient struct {
	// contains filtered or unexported fields
}

func (*SubnetClient) DeleteCancellation

func (c *SubnetClient) DeleteCancellation(ctx context.Context, netip string) (*SubnetCancellation, *Response, error)

func (*SubnetClient) DeleteMAC

func (c *SubnetClient) DeleteMAC(ctx context.Context, netip string) (*SubnetMac, *Response, error)

func (*SubnetClient) GenerateMac

func (c *SubnetClient) GenerateMac(ctx context.Context, netip string) (*SubnetMac, *Response, error)

func (*SubnetClient) GetCancellation

func (c *SubnetClient) GetCancellation(ctx context.Context, netip string) (*SubnetCancellation, *Response, error)

func (*SubnetClient) GetMac

func (c *SubnetClient) GetMac(ctx context.Context, netip string) (*SubnetMac, *Response, error)

func (*SubnetClient) GetSubnetByIP

func (c *SubnetClient) GetSubnetByIP(ctx context.Context, netip string) (*Subnet, *Response, error)

requires the net ip of the subnet

func (*SubnetClient) List

func (c *SubnetClient) List(ctx context.Context) ([]*Subnet, *Response, error)

func (*SubnetClient) PostCancellation

func (c *SubnetClient) PostCancellation(ctx context.Context, netip string, cancellation_date string) (*SubnetCancellation, *Response, error)

func (*SubnetClient) UpdateTraffic

func (c *SubnetClient) UpdateTraffic(ctx context.Context, netip string, opt *SubnetOps) (*Subnet, *Response, error)

requires the net ip of the subnet

type SubnetMac

type SubnetMac struct {
	IP          string
	Mask        int
	Mac         string
	PossibleMac interface{}
}

func SubnetMacFromSchema

func SubnetMacFromSchema(s schema.SubnetMac) *SubnetMac

type SubnetOps

type SubnetOps struct {
	TrafficWarnings bool   `url:"traffic_warnings"` //enable/disable traffic warnings (true,false)
	TrafficHourly   string `url:"traffic_hourly"`   // hourly traffic limit in MB
	TrafficDaily    string `url:"traffic_daily"`    // daily traffic limit in MB
	TrafficMonthly  string `url:"traffic_monthly"`  // monthly traffic limit in GB
}

type UpdateKeyOpts

type UpdateKeyOpts struct {
	Name string `url:"name"`
}

type VNCOpts

type VNCOpts struct {
	Dist string `url:"dist"` //required
	Lang string `url:"lang"` //required
}

type VSwitch

type VSwitch struct {
	ID        int
	Name      string
	Vlan      int
	Cancelled bool
}

func VswitchFromSchema

func VswitchFromSchema(s schema.VSwitch) *VSwitch

type VSwitchClient

type VSwitchClient struct {
	// contains filtered or unexported fields
}

func (*VSwitchClient) AddToServer

func (c *VSwitchClient) AddToServer(ctx context.Context, id string, server interface{}) (*Response, error)

adds server to vswitch, server can be server number or ip

func (*VSwitchClient) AddVSwitch

func (c *VSwitchClient) AddVSwitch(ctx context.Context, opt *AddvSwitchOps) (*VSwitchSingle, *Response, error)

func (*VSwitchClient) CancelVSwitch

func (c *VSwitchClient) CancelVSwitch(ctx context.Context, id string, cancellation_date string) (*Response, error)

cancellation_date format yyyy-MM-dd

func (*VSwitchClient) GetVSwitchById

func (c *VSwitchClient) GetVSwitchById(ctx context.Context, id string) (*VSwitchSingle, *Response, error)

func (*VSwitchClient) GetVSwitchList

func (c *VSwitchClient) GetVSwitchList(ctx context.Context) ([]*VSwitch, *Response, error)

func (*VSwitchClient) RemoveServer

func (c *VSwitchClient) RemoveServer(ctx context.Context, id string, server interface{}) (*Response, error)

removes server by servernumber or ip from vswitch

func (*VSwitchClient) UpdateVSwitchById

func (c *VSwitchClient) UpdateVSwitchById(ctx context.Context, id string, opt *AddvSwitchOps) (*VSwitchSingle, *Response, error)

type VSwitchServer

type VSwitchServer struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
	Status        string
}

type VSwitchSingle

type VSwitchSingle struct {
	ID           int
	Name         string
	Vlan         int
	Cancelled    bool
	Server       []interface{}
	Subnet       []interface{}
	CloudNetwork []interface{}
}

func VSwitchSingleFromSchema

func VSwitchSingleFromSchema(s schema.VSwitchSingle) *VSwitchSingle

type WOL

type WOL struct {
	ServerIP      string
	ServerIpv6Net string
	ServerNumber  int
}

func WOLFromSchema

func WOLFromSchema(s schema.WOL) *WOL

type WOLClient

type WOLClient struct {
	// contains filtered or unexported fields
}

func (*WOLClient) GetByServernumber

func (c *WOLClient) GetByServernumber(ctx context.Context, servernumber string) (*WOL, *Response, error)

func (*WOLClient) Send

func (c *WOLClient) Send(ctx context.Context, servernumber string) (*WOL, *Response, error)

send WOL packet by server number

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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