steampipe plugin install hcloud

Table: hcloud_action - Query Hetzner Cloud Actions using SQL

Hetzner Cloud Actions are tasks performed on resources within the Hetzner Cloud platform. These actions include tasks such as creating, updating, or deleting resources like servers, volumes, and networks. Each action has a status and progress which can be tracked to understand the outcome of the task.

Table Usage Guide

The hcloud_action table provides insights into actions taken within Hetzner Cloud. As a system administrator, explore action-specific details through this table, including statuses, progress, and associated metadata. Utilize it to monitor the progress and outcomes of tasks, such as resource creation, updates, and deletions, and to identify any potential issues that may arise during these processes.

Examples

List create_server actions

Explore instances where server creation actions have been initiated to gain insights into system activity and manage resources effectively. This can be particularly useful for tracking resource allocation and identifying areas for optimization.

select
*
from
hcloud_action
where
command = 'create_server';
select
*
from
hcloud_action
where
command = 'create_server';

Get a specific action

Analyze the settings to understand the specifics of a particular action in your Hetzner Cloud environment. This can be useful in identifying changes or actions that could impact system performance or security.

select
*
from
hcloud_action
where
id = 271232672;
select
*
from
hcloud_action
where
id = 271232672;

Actions in error

Discover instances where actions have failed to execute correctly, allowing for the identification and resolution of potential issues within your system. This is crucial for maintaining optimal system performance and stability.

select
*
from
hcloud_action
where
status = 'error';
select
*
from
hcloud_action
where
status = 'error';

Identify instances where specific server-related actions have taken place. This can help in monitoring server activity, providing insights into system usage and behavior patterns.

select
a.*
from
hcloud_action as a,
jsonb_array_elements(a.resources) as r
where
r ->> 'Type' = 'server'
and (r -> 'ID') :: int = 14462596;
select
a.*
from
hcloud_action as a,
json_each(a.resources) as r
where
json_extract(r.value, '$.Type') = 'server'
and json_extract(r.value, '$.ID') = 14462596;

Schema for hcloud_action

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
commandtextCommand executed in the Action.
errorjsonbError message for the Action if error occurred, otherwise null.
finishedtimestamp with time zonePoint in time when the Action was finished. Only set if the Action is finished otherwise null.
idbigint=ID of the Action.
progressbigintProgress of Action in percent.
resourcesjsonbResources the Action relates to.
startedtimestamp with time zonePoint in time when the Action was started.
statustext=Status of the Action: success, running, error.

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_action