Documentation
¶
Index ¶
- Constants
- func IsError(err error, code ErrorCode) bool
- type AuthorizedKey
- type Cancellation
- type CancellationResponse
- type Error
- type ErrorCode
- type ErrorResponse
- type Failover
- type FailoverResponse
- type IP
- type IPResponse
- type Key
- type KeyResponse
- type KeySetInput
- type Linux
- type LinuxResponse
- type LinuxSetInput
- type Rdns
- type RdnsResponse
- type Rescue
- type RescueResponse
- type RescueSetInput
- type Reset
- type ResetPost
- type ResetPostResponse
- type ResetResponse
- type ResetSetInput
- type Server
- type ServerResponse
- type ServerSetNameInput
- type Subnet
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 ¶
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 ErrorCode ¶ added in v0.2.1
type ErrorCode string
const ( 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 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 KeyResponse ¶
type KeyResponse struct {
Key Key `json:"key"`
}
type KeySetInput ¶ added in v0.2.0
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 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 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"`
}
Click to show internal directories.
Click to hide internal directories.