ovh.ex v0.2.0 Ovh.Server View Source

High level wrapper for dedicated servers

Link to this section Summary

Functions

Find a server

Find first server matching props

Creates struct from JSON obj

Reboot server

Set custom ipxe script as boot

Set ipxe boot from template

Link to this section Types

Link to this type t() View Source
t() :: %Ovh.Server{
  bootId: term(),
  commercialRange: term(),
  datacenter: term(),
  ip: term(),
  linkSpeed: term(),
  monitoring: term(),
  name: term(),
  os: term(),
  professionalUse: term(),
  rack: term(),
  rescueMail: term(),
  reverse: term(),
  rootDevice: term(),
  serverId: term(),
  state: term(),
  supportLevel: term()
}

Link to this section Functions

Link to this function find(name_or_reverse) View Source
find(String.t() | Keyword.t()) :: [t()]

Find a server

If arg is a string, looks by name or reverse If arg is a Keyword list, looks by matching server properties

Example:

find(rack: “XXX001”)

Returns servers in rack 'XXX001'

Find first server matching props

For consistency purpose, returns empty list or one-element list

Link to this function new(obj) View Source
new(map() | nil) :: t() | nil

Creates struct from JSON obj

Link to this function reboot(server) View Source
reboot(t()) :: :ok

Reboot server

Link to this function set_ipxe(server, ipxe) View Source
set_ipxe(t(), Ovh.Ipxe.t()) :: t()

Set custom ipxe script as boot

Link to this function set_ipxe_tmpl(server, tmpl, ctx) View Source
set_ipxe_tmpl(t(), tmpl :: String.t(), ctx :: Keyword.t()) :: t()

Set ipxe boot from template

Override existing boot if exists