You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up a VM Host with Hetzner, we manually enter the IP address and Hetzner server ID. The https://robot.hetzner.com/doc/webservice/en.html#get-server endpoint of the Hetzner webservice provides a list of all servers, allowing us to find the Hetzner identifier using the IP address.
The text was updated successfully, but these errors were encountered:
To implement a feature for retrieving a Hetzner server identifier using an IP address, you can extend the Hosting::HetznerApis class. Here's a step-by-step guide based on the existing code structure:
Add a New Method in HetznerApis Class:
Implement a new method in /lib/hosting/hetzner_apis.rb to fetch the server list and filter by IP address to find the server identifier.
Usage Example:
This method can be called with the IP address to get the corresponding server identifier. Ensure that the IP address passed to this method is the main IP of the server as listed in the Hetzner Robot API.
Integration:
Integrate this method where you need to retrieve the server identifier based on the IP address, ensuring that the Hetzner API's rate limits and authentication mechanisms are respected.
This approach leverages the existing infrastructure for making API calls within the HetznerApis class and follows the pattern used for other methods like get_main_ip4 and pull_ips. Remember to handle potential errors and exceptions, especially concerning API call limits and unauthorized access.
When setting up a VM Host with Hetzner, we manually enter the IP address and Hetzner server ID. The https://robot.hetzner.com/doc/webservice/en.html#get-server endpoint of the Hetzner webservice provides a list of all servers, allowing us to find the Hetzner identifier using the IP address.
The text was updated successfully, but these errors were encountered: