Documentation ¶
Index ¶
- Constants
- type Firewall
- type FirewallRule
- type FirewallWrapper
- type Reboot
- type RescueMode
- type RescueModeOptions
- type RescueModeOptionsResponse
- type RescueModeResponse
- type Server
- func (s Server) DisableFirewall() error
- func (s Server) DisableRescueMode() error
- func (s Server) EnableFirewall() error
- func (s Server) EnableRescueMode(rescueOS, rescueArch string) (RescueMode, error)
- func (s Server) FirewallStatus() (string, error)
- func (s Server) Reboot(rst Reboot) error
- func (s Server) RescueModeOptions() (RescueModeOptions, error)
- func (s Server) RescueModePassword() (string, bool, error)
- func (s Server) RescueModeStatus() (bool, error)
Constants ¶
const ( // RebootHardware signals the hardware to restart. RebootHardware = Reboot("hw") // RebootManually tells a technician to reboot the server. RebootManually = Reboot("man") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Firewall ¶
type Firewall struct { ServerIP string `json:"server_ip"` ServerNumber int `json:"server_number"` Status string FilterIPv6 bool `json:"filter_ipv6"` WhiteListHetzner bool `json:"whitelist_hos"` Port string Rules struct { Input []FirewallRule `json:"input"` Output []FirewallRule `json:"output"` } }
Firewall combines firewall details and firewall rules.
type FirewallRule ¶
type FirewallRule struct { IPVersion string `json:"ip_version"` Name string DestinationIP string `json:"dst_ip"` SourceIP string `json:"src_ip"` DestinationPort string `json:"dst_port"` SourcePort string `json:"src_port"` Protocol string TCPFlags string `json:"tcp_flags"` Action string }
FirewallRule represents a single firewall rule.
func (FirewallRule) String ¶
func (r FirewallRule) String() string
type FirewallWrapper ¶
type FirewallWrapper struct {
Firewall Firewall
}
FirewallResponse is returned by calling hetzners API.
type RescueMode ¶
type RescueMode struct { ServerIP string `json:"server_ip"` ServerNumber int `json:"server_number"` Active bool Password string }
RescueMode are the rescue mode details.
type RescueModeOptions ¶
type RescueModeOptions struct { ServerIP string `json:"server_ip"` ServerNumber int `json:"server_number"` Active bool Password string Os []string Arch []int }
RescueModeOptions are the rescue mode options.
type RescueModeOptionsResponse ¶
type RescueModeOptionsResponse struct {
RescueMode RescueModeOptions `json:"rescue"`
}
RescueModeResponse is returned by calling out to hetzners API.
type RescueModeResponse ¶
type RescueModeResponse struct {
RescueMode RescueMode `json:"rescue"`
}
RescueModeResponse is returned by calling out to hetzners API.
type Server ¶
Server represents a server in hetzners API.
func (Server) DisableFirewall ¶
DisableFirewall disables Hetzners IPv4 firewall.
func (Server) DisableRescueMode ¶
DisableRescueMode disables rescue mode for a node.
func (Server) EnableFirewall ¶
EnableFirewall enables Hetzners IPv4 firewall.
func (Server) EnableRescueMode ¶
func (s Server) EnableRescueMode(rescueOS, rescueArch string) (RescueMode, error)
EnableRescueMode enables rescue mode of a node.
func (Server) FirewallStatus ¶
FirewallStatus prints the status of hetzners firewall.
func (Server) RescueModeOptions ¶
func (s Server) RescueModeOptions() (RescueModeOptions, error)
RescueModeOptions returns the rescue mode options.
func (Server) RescueModePassword ¶
RescueModePassword resturns the password and status of the rescue mode.
func (Server) RescueModeStatus ¶
RescueModeStatus returns the activation status of the rescue mode.