module

Beryl::CLI::Rescue

Sous-commande beryl rescue <host> [options] : bascule un hôte en rescue via l'API de l'hébergeur (OVH ou Scaleway) puis attend le retour SSH.

Constants

DEFAULT_SSH_WAIT_TIMEOUT = 10.minutes
EXIT_API_ERROR = 7
EXIT_BAD_CREDS = 4
EXIT_BAD_PROVIDER = 5
EXIT_DNS = 8
EXIT_MISSING_CONFIG = 6
EXIT_OK = 0
EXIT_SSH_FAILED = 2
EXIT_TASK_FAILED = 9
EXIT_UNEXPECTED = 3
EXIT_USAGE = 1
SSH_POLL_INTERVAL = 15.seconds
TASK_POLL_INTERVAL = 10.seconds
TASK_WAIT_TIMEOUT = 5.minutes

Temps max d'attente pour que la task hardReboot OVH atteigne son état terminal (done | ovhError | cancelled). Un reboot OVH standard aboutit en 2-3 min côté task (le serveur met ensuite 2-4 min à répondre SSH).

Class methods

default_dns_resolve(host : String) : Bool

Par défaut, résolution DNS via Socket::Addrinfo.resolve.

Source
default_wait_for_ssh(host : String, port : Int32, user : String, timeout : Time::Span, poll : Time::Span) : Bool

Attente SSH : une ligne de log par tentative, avec raison de l'échec (TCP refused / timeout / autre). Pas de ticker animé — retour terrain chouquette 24 avril 2026 : le ticker du log_step rendait la main immédiatement après [ 0s] sans log final, ce qui ressemblait à une exception silencieuse et empêchait de diagnostiquer. Les lignes explicites sont plus verbeuses (une toutes les ~15s) mais infaillibles côté debug.

user n'est pas utilisé dans l'impl (on teste uniquement TCP), mais la signature le garde pour rester injectable de la même façon entre rescue et boot-hd.

Source
run(config_root : String, args : Array(String), ovh_client_factory : OvhClientFactory = -> do Beryl::CLI::Credentials.ovh_client end, scaleway_client_factory : ScalewayClientFactory = -> do Beryl::CLI::Credentials.scaleway_client end, dedibox_client_factory : DediboxClientFactory = -> do Beryl::CLI::Credentials.dedibox_client end, wait_for_ssh : Proc(String, Int32, String, Time::Span, Time::Span, Bool) = ->default_wait_for_ssh(String, Int32, String, Time::Span, Time::Span), dns_resolver : Proc(String, Bool) = ->default_dns_resolve(String)) : Int32
Source

Nested types