hetzner

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func Int

func Int(i int) *int

func String

func String(s string) *string

Types

type BootClient

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

func (*BootClient) Rescue

func (b *BootClient) Rescue(req *RescueRequest) (*Rescue, error)

type Client

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

func NewClient

func NewClient(config *Config) *Client

func (*Client) Boot

func (c *Client) Boot() *BootClient

func (*Client) Firewall

func (c *Client) Firewall() *FirewallClient

func (*Client) Reset

func (c *Client) Reset() *ResetClient

func (*Client) Servers

func (c *Client) Servers() *ServersClient

func (*Client) StorageBox

func (c *Client) StorageBox() *StorageBoxClient

type Config

type Config struct {
	Address  string
	Logger   hclog.Logger
	User     string
	Password string
}

func DefaultConfig

func DefaultConfig() *Config

type Firewall

type Firewall struct {
	ServerIP     string        `json:"server_ip"`
	ServerNumber int           `json:"server_number"`
	Status       string        `json:"status"`
	WhitelistHOS bool          `json:"whitelist_hos"`
	Port         string        `json:"port"`
	Rules        FirewallRules `json:"rules"`
}

type FirewallClient

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

func (*FirewallClient) Delete

func (f *FirewallClient) Delete(ip string) (*Firewall, error)

func (*FirewallClient) Info

func (f *FirewallClient) Info(ip string) (*Firewall, error)

func (*FirewallClient) Update

func (f *FirewallClient) Update(req *FirewallRequest) (*Firewall, error)

type FirewallRequest

type FirewallRequest struct {
	ServerIP     string        `form:"-"`
	Status       *string       `form:"status"`
	WhitelistHOS *bool         `form:"whitelist_hos"`
	TemplateID   *string       `form:"template_id"`
	Rules        FirewallRules `form:"rules"`
}

type FirewallRule

type FirewallRule struct {
	IPVersion string  `json:"ip_version" form:"ip_version"`
	Name      string  `json:"name" form:"name"`
	DstIP     *string `json:"dst_ip" form:"dst_ip"`
	SrcIP     *string `json:"src_ip" form:"src_ip"`
	DstPort   *string `json:"dst_port" form:"dst_port"`
	SrcPort   *string `json:"src_port" form:"src_port"`
	Protocol  *string `json:"protocol" form:"protocol"`
	TcpFlags  *string `json:"tcp_flags" form:"tcp_flags"`
	Action    string  `json:"action" form:"action"`
}

type FirewallRules

type FirewallRules struct {
	Input []*FirewallRule `json:"input" form:"input"`
}

type Rescue

type Rescue struct {
	ServerIP       string   `json:"server_ip"`
	ServerNumber   int      `json:"server_number"`
	OS             string   `json:"os"`
	Arch           int      `json:"arch"`
	Active         bool     `json:"active"`
	Password       string   `json:"password"`
	AuthorizedKeys []string `json:"authorized_key"`
	HostKeys       []string `json:"host_key"`
}

type RescueRequest

type RescueRequest struct {
	ServerIP       string   `form:"-"`
	OS             string   `form:"os"`
	Arch           int      `form:"arch"`
	AuthorizedKeys []string `form:"authorized_key"`
}

type Reset

type Reset struct {
	ServerIP string `json:"server_ip"`
	Type     string `json:"type"`
}

type ResetClient

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

func (*ResetClient) Reset

func (b *ResetClient) Reset(req *ResetRequest) (*Reset, error)

type ResetRequest

type ResetRequest struct {
	ServerIP string `form:"-"`
	Type     string `form:"type"`
}

type Server

type Server struct {
	ServerIP         string   `json:"server_ip"`
	ServerNumber     int      `json:"server_number"`
	ServerName       string   `json:"server_name"`
	Product          string   `json:"product"`
	DC               string   `json:"dc"`
	Traffic          string   `json:"traffic"`
	Status           string   `json:"status"`
	Cancelled        bool     `json:"cancelled"`
	PaidUntil        string   `json:"paid_until"`
	IP               []string `json:"ip"`
	Subnet           []Subnet `json:"subnet"`
	Reset            bool     `json:"reset"`
	Rescue           bool     `json:"rescue"`
	Vnc              bool     `json:"vnc"`
	Windows          bool     `json:"windows"`
	Plesk            bool     `json:"plesk"`
	CPanel           bool     `json:"cpanel"`
	WOL              bool     `json:"wol"`
	HotSwap          bool     `json:"hot_swap"`
	LinkedStoragebox *int     `json:"linked_storagebox"`
}

type ServerRequest

type ServerRequest struct {
	ServerIP   string `form:"-"`
	ServerName string `form:"server_name"`
}

type ServerSummary

type ServerSummary struct {
	ServerIP         string   `json:"server_ip"`
	ServerNumber     int      `json:"server_number"`
	ServerName       string   `json:"server_name"`
	Product          string   `json:"product"`
	DC               string   `json:"dc"`
	Traffic          string   `json:"traffic"`
	Status           string   `json:"status"`
	Cancelled        bool     `json:"cancelled"`
	PaidUntil        string   `json:"paid_until"`
	IP               []string `json:"ip"`
	Subnet           []Subnet `json:"subnet"`
	LinkedStoragebox *int     `json:"linked_storagebox"`
}

type ServersClient

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

func (*ServersClient) Info

func (s *ServersClient) Info(ip string) (*Server, error)

func (*ServersClient) List

func (s *ServersClient) List() ([]*ServerSummary, error)

func (*ServersClient) Update

func (s *ServersClient) Update(req *ServerRequest) (*Server, error)

type StorageBox

type StorageBox struct {
	ID                   int    `json:"id"`
	Login                string `json:"login"`
	Name                 string `json:"name"`
	Product              string `json:"product"`
	Cancelled            bool   `json:"cancelled"`
	Locked               bool   `json:"locked"`
	Location             string `json:"location"`
	LinkedServer         int    `json:"linked_server"`
	PaidUntil            string `json:"paid_until"`
	DiskQuota            int    `json:"disk_quota"`
	DiskUsage            int    `json:"disk_usage"`
	DiskUsageData        int    `json:"disk_usage_data"`
	DiskUsageSnapshots   int    `json:"disk_usage_snapshots"`
	Webdav               bool   `json:"webdav"`
	Samba                bool   `json:"samba"`
	SSH                  bool   `json:"ssh"`
	ExternalReachability bool   `json:"external_reachability"`
	ZFS                  bool   `json:"zfs"`
	Server               string `json:"server"`
	HostSystem           string `json:"host_system"`
}

type StorageBoxClient

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

func (*StorageBoxClient) Info

func (s *StorageBoxClient) Info(id int) (*StorageBox, error)

func (*StorageBoxClient) List

func (s *StorageBoxClient) List() ([]*StorageBoxSummary, error)

func (*StorageBoxClient) Update

type StorageBoxRequest

type StorageBoxRequest struct {
	ID                   int     `form:"-"`
	StorageBoxName       *string `form:"storagebox_name,omitempty"`
	Samba                *bool   `form:"samba,omitempty"`
	Webdav               *bool   `form:"webdav,omitempty"`
	SSH                  *bool   `form:"ssh,omitempty"`
	ExternalReachability *bool   `form:"external_reachability,omitempty"`
	ZFS                  *bool   `form:"zfs,omitempty"`
}

type StorageBoxSummary

type StorageBoxSummary struct {
	ID           int    `json:"id"`
	Login        string `json:"login"`
	Name         string `json:"name"`
	Product      string `json:"product"`
	Cancelled    bool   `json:"cancelled"`
	Locked       bool   `json:"locked"`
	Location     string `json:"location"`
	LinkedServer int    `json:"linked_server"`
	PaidUntil    string `json:"paid_until"`
}

type Subnet

type Subnet struct {
	IP   string `json:"ip"`
	Mask string `json:"mask"`
}

Jump to

Keyboard shortcuts

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