models

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// ResetTypePower: Press power button of server. If the server is powered down, it can be turned back on with this function. If the server is still running, it will receive an ACPI signal to shut down. Our servers and standard images are configured so that this process triggers a regular operating system shutdown. What happens is actually exactly the same as what happens when you press the power button on your home computer.
	// Supported by some servers
	ResetTypePower = "power"

	// ResetTypePowerLong: Long power button press. This option forces the server to immediately shut off. It should only be used in cases where the system is unresponsive to a graceful shut-down.
	// Supported by some servers
	ResetTypePowerLong = "power_long"

	// RebootTypeSoftware: Send CTRL+ALT+DEL to the server.
	// Supported by almost all servers.
	RebootTypeSoftware = "sw"

	// ResetTypeHardware: Execute an automatic hardware reset. What happens in the background here is exactly the same as when you press the reset button on your home PC.
	// Supported by all servers.
	ResetTypeHardware = "hw"

	// ResetTypeManual: Order a manual power cycle. The manual power cycle (cold reset) option will generate an email that will be sent directly to our data center. Our technicians will then disconnect your server from the power supply, reconnect it, and thereby restart the system.
	// Supported by all servers. But no recommended for usage via API :-)
	ResetTypeManual = "man"
)

Variables

This section is empty.

Functions

func IsError added in v0.2.2

func IsError(err error, code ErrorCode) bool

IsError returns whether err is an API error with the given error code.

Types

type AuthorizedKey

type AuthorizedKey struct {
	Key Key `json:"key"`
}

type Cancellation

type Cancellation struct {
	ServerIP                 string      `json:"server_ip"`
	ServerIPv6Net            string      `json:"server_ipv6_net"`
	ServerNumber             int         `json:"server_number"`
	Name                     string      `json:"server_name"`
	EarliestCancellationDate string      `json:"earliest_cancellation_date"`
	Cancelled                bool        `json:"cancelled"`
	ReservationPossible      bool        `json:"reservation_possible"`
	Reservation              bool        `json:"reservation"`
	CancellationDate         string      `json:"cancellation_date"`
	CancellationReason       interface{} `json:"cancellation_reason"`
}

type CancellationResponse

type CancellationResponse struct {
	Cancellation Cancellation `json:"cancellation"`
}

type Error added in v0.2.1

type Error struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

func (Error) Error added in v0.2.1

func (e Error) Error() string

type ErrorCode added in v0.2.1

type ErrorCode string
const (
	ErrorCodeUnauthorized      ErrorCode = "UNAUTHORIZED"
	ErrorCodeRateLimitExceeded ErrorCode = "RATE_LIMIT_EXCEEDED"

	ErrorCodeConflict      ErrorCode = "CONFLICT"
	ErrorCodeNotFound      ErrorCode = "NOT_FOUND"
	ErrorCodeInvalidInput  ErrorCode = "INVALID_INPUT"
	ErrorCodeInternalError ErrorCode = "INTERNAL_ERROR"

	ErrorCodeServerNotFound ErrorCode = "SERVER_NOT_FOUND"

	ErrorCodeIPNotFound ErrorCode = "IP_NOT_FOUND"

	ErrorCodeSubnetNotFound ErrorCode = "SUBNET_NOT_FOUND"

	ErrorCodeReverseDNSNotFound ErrorCode = "RDNS_NOT_FOUND"

	ErrorCodeResetNotAvailable ErrorCode = "RESET_NOT_AVAILABLE"
	ErrorCodeResetManualActive ErrorCode = "RESET_MANUAL_ACTIVE"
	ErrorCodeResetFailed       ErrorCode = "RESET_FAILED"

	ErrorCodeBootNotAvailable       ErrorCode = "BOOT_NOT_AVAILABLE"
	ErrorCodeBootAlreadyEnabled     ErrorCode = "BOOT_ALREADY_ENABLED"
	ErrorCodeBootBlocked            ErrorCode = "BOOT_BLOCKED"
	ErrorCodeBootActivationFailed   ErrorCode = "BOOT_ACTIVATION_FAILED"
	ErrorCodeBootDeactivationFailed ErrorCode = "BOOT_DEACTIVATION_FAILED"

	ErrorCodeKeyAlreadyExists ErrorCode = "KEY_ALREADY_EXISTS"
	ErrorCodeKeyCreateFailed  ErrorCode = "KEY_CREATE_FAILED"
	ErrorCodeKeyUpdateFailed  ErrorCode = "KEY_UPDATE_FAILED"
	ErrorCodeKeyDeleteFailed  ErrorCode = "KEY_DELETE_FAILED"
)

type ErrorResponse added in v0.2.1

type ErrorResponse struct {
	Error Error `json:"error"`
}

type Failover

type Failover struct {
	IP             string `json:"ip"`
	Netmask        string `json:"netmask"`
	ServerIP       string `json:"server_ip"`
	ServerNumber   int    `json:"server_number"`
	ActiveServerIP string `json:"active_server_ip"`
}

type FailoverResponse

type FailoverResponse struct {
	Failover Failover `json:"failover"`
}

type IP

type IP struct {
	IP              string `json:"ip"`
	Gateway         string `json:"gateway"`
	Mask            int    `json:"mask"`
	Broadcast       string `json:"broadcast"`
	ServerIP        string `json:"server_ip"`
	ServerNumber    int    `json:"server_number"`
	Locked          bool   `json:"locked"`
	SeparateMac     string `json:"separate_mac"`
	TrafficWarnings bool   `json:"traffic_warnings"`
	TrafficHourly   int    `json:"traffic_hourly"`
	TrafficDaily    int    `json:"traffic_daily"`
	TrafficMonthly  int    `json:"traffic_monthly"`
}

type IPResponse

type IPResponse struct {
	IP IP `json:"ip"`
}

type Key

type Key struct {
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
	Type        string `json:"type"`
	Size        int    `json:"size"`
	Data        string `json:"data"`
}

type KeyResponse

type KeyResponse struct {
	Key Key `json:"key"`
}

type KeySetInput added in v0.2.0

type KeySetInput struct {
	Name string `json:"name"`
	Data string `json:"data"`
}

type Linux added in v0.2.0

type Linux struct {
	ServerIP      string          `json:"server_ip"`
	ServerIPv6Net string          `json:"server_ipv6_net"`
	ServerNumber  int             `json:"server_number"`
	Dist          interface{}     `json:"dist"` // unfortunately the API returns an array vs. a single value based on state (active/inactive)
	Arch          interface{}     `json:"arch"` // unfortunately the API returns an array vs. a single value based on state (active/inactive)
	Lang          interface{}     `json:"lang"` // unfortunately the API returns an array vs. a single value based on state (active/inactive)
	Active        bool            `json:"active"`
	Password      string          `json:"password"`
	AuthorizedKey []AuthorizedKey `json:"authorized_key"`
	HostKey       []interface{}   `json:"host_key"`
}

type LinuxResponse added in v0.2.0

type LinuxResponse struct {
	Linux Linux `json:"linux"`
}

type LinuxSetInput added in v0.2.0

type LinuxSetInput struct {
	Dist          string
	Arch          int
	Lang          string
	AuthorizedKey string
}

type Rdns

type Rdns struct {
	IP  string `json:"ip"`
	Ptr string `json:"ptr"`
}

type RdnsResponse

type RdnsResponse struct {
	Rdns Rdns `json:"rdns"`
}

type Rescue

type Rescue struct {
	ServerIP      string          `json:"server_ip"`
	ServerIPv6Net string          `json:"server_ipv6_net"`
	ServerNumber  int             `json:"server_number"`
	Os            interface{}     `json:"os"`   // unfortunately the API returns an array vs. a single value based on state (active/inactive)
	Arch          interface{}     `json:"arch"` // unfortunately the API returns an array vs. a single value based on state (active/inactive)
	Active        bool            `json:"active"`
	Password      string          `json:"password"`
	AuthorizedKey []AuthorizedKey `json:"authorized_key"`
	HostKey       []interface{}   `json:"host_key"`
}

type RescueResponse added in v0.2.0

type RescueResponse struct {
	Rescue Rescue `json:"rescue"`
}

type RescueSetInput

type RescueSetInput struct {
	OS            string
	Arch          int
	AuthorizedKey string
}

type Reset

type Reset struct {
	ServerIP        string   `json:"server_ip"`
	ServerIPv6Net   string   `json:"server_ipv6_net"`
	ServerNumber    int      `json:"server_number"`
	Type            []string `json:"type"`
	OperatingStatus string   `json:"operating_status"`
}

type ResetPost

type ResetPost struct {
	ServerIP      string `json:"server_ip"`
	ServerIPv6Net string `json:"server_ipv6_net"`
	ServerNumber  int    `json:"server_number"`
	Type          string `json:"type"`
}

type ResetPostResponse

type ResetPostResponse struct {
	Reset ResetPost `json:"reset"`
}

type ResetResponse

type ResetResponse struct {
	Reset Reset `json:"reset"`
}

type ResetSetInput

type ResetSetInput struct {
	Type string
}

type Server

type Server struct {
	ServerIP         string   `json:"server_ip"`
	ServerIPv6Net    string   `json:"server_ipv6_net"`
	ServerNumber     int      `json:"server_number"`
	Name             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 ServerResponse

type ServerResponse struct {
	Server Server `json:"server"`
}

type ServerSetNameInput

type ServerSetNameInput struct {
	Name string
}

type Subnet

type Subnet struct {
	IP              string `json:"ip"`
	Mask            string `json:"mask"`
	Gateway         string `json:"gateway"`
	ServerIP        string `json:"server_ip"`
	ServerNumber    int    `json:"server_number"`
	Failover        bool   `json:"failover"`
	Locked          bool   `json:"locked"`
	TrafficWarnings bool   `json:"traffic_warnings"`
	TrafficHourly   int    `json:"traffic_hourly"`
	TrafficDaily    int    `json:"traffic_daily"`
	TrafficMonthly  int    `json:"traffic_monthly"`
}

Jump to

Keyboard shortcuts

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