INWX DomRobot v0.1.0 InwxDomrobot
An Elixir implementation of the INWX DomRobot. INWX offers a complete XML-RPC API covering most of their sites features. The DomRobot allows you to manage accounts, domains, name servers and much more directly from your application instead of using their webinterface.
The DomRobot will connect to the XML-RPC API by sending your account information to the API via HTTPS. It will store the returned cookie until it is actively logged out, in order to allow you to send it the commands you need. This implementation uses xmlrpc for building its requests. https://hexdocs.pm/xmlrpc/XMLRPC.html
Summary
Functions
Send an account.login request to the INWX API. This method takes a username and password, it is recommended you load those from your environment instead of hard-coding them into the application. Upon receiving a successful response, the module will hold the received cookie for futher requests
Send an account.logout request to the INWX API. After receiving a successful response to the logout request, the module will discard the current session cookie. InwxDomrobot.login needs to be called again with valid credentials afterwards, in order to make any further requests
Send a custom request to the INWX API. This method takes a method name and optionally some parameters that will be sent to the INWX API. The method name and the respective parameters used can be found in the official DomRobot API documentation
Start the INWX Domrobot GenServer process
Returns typical GenServer response, e.g. {:ok, connection}
Functions
Send an account.login request to the INWX API. This method takes a username and password, it is recommended you load those from your environment instead of hard-coding them into the application. Upon receiving a successful response, the module will hold the received cookie for futher requests.
There are three possible return tuples for this method.
If the HTTPoison request failed: {:error, %HTTPoison.Error}
If the successful request returned an error code: {:error, {:unauthorized, code}}
If the successful request returned a success code: {:ok, code}
Send an account.logout request to the INWX API. After receiving a successful response to the logout request, the module will discard the current session cookie. InwxDomrobot.login needs to be called again with valid credentials afterwards, in order to make any further requests.
There are two possible return tuples for this method.
If the HTTPoison request failed: {:error, %HTTPoison.Error}
If the request was successful: {:ok, %HTTPoison.Response}
Send a custom request to the INWX API. This method takes a method name and optionally some parameters that will be sent to the INWX API. The method name and the respective parameters used can be found in the official DomRobot API documentation.
There are two possible return tuples for this method.
If the HTTPoison request failed: {:error, %HTTPoison.Error}
If the request was successful: {:ok, %XMLRPC.MethodResponse}