Table: hcloud_datacenter - Query Hetzner Cloud Datacenters using SQL
Hetzner Cloud Datacenters are physical locations around the world where Hetzner Cloud servers reside. They are designed to be highly reliable, secure, and efficient. These datacenters contain the server types and their availability, which are crucial for planning and managing cloud resources.
Table Usage Guide
The hcloud_datacenter
table provides insights into datacenters within Hetzner Cloud. As a system administrator or DevOps engineer, explore datacenter-specific details through this table, including location, server types, and availability. Utilize it to uncover information about datacenters, such as their geographical distribution, the types of servers available, and their current availability status.
Examples
List all data centers
Explore the various data centers available, ordered by their names, to better manage resources and optimize performance. This can be particularly useful when planning the deployment of new services or assessing existing infrastructure.
select *from hcloud_datacenterorder by name;
select *from hcloud_datacenterorder by name;
Get data center by name
Explore which specific data center is associated with a certain name, allowing you to quickly identify and access relevant data center information for further analysis or management tasks. This is particularly useful in environments with multiple data centers, where locating specific ones by name can streamline administrative tasks.
select *from hcloud_datacenterwhere name = 'hel1';
select *from hcloud_datacenterwhere name = 'hel1';
Get all available server types for all data centers
Explore the variety of server types across all data centers. This is useful for understanding the diverse server options available for different data center deployments, aiding in strategic decision-making and resource allocation.
select dc.name, st.*from hcloud_datacenter as dc, jsonb_array_elements(dc.server_types_available) as sta, hcloud_server_type as stwhere sta :: int = st.id;
select dc.name, st.*from hcloud_datacenter as dc, json_each(dc.server_types_available) as sta, hcloud_server_type as stwhere cast(sta.value as integer) = st.id;
Schema for hcloud_datacenter
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
description | text | Description of the Data Center. | |
id | bigint | = | ID of the Data Center. |
location_id | bigint | Location of the Data Center. | |
name | text | = | Unique identifier of the Data Center. |
server_types_available | jsonb | IDs of the server types available at the Data Center. | |
server_types_supported | jsonb | IDs of the server types supported at the Data Center. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hcloud
You can pass the configuration to the command with the --config
argument:
steampipe_export_hcloud --config '<your_config>' hcloud_datacenter