steampipe plugin install equinix

Table: equinix_metal_device - Query Equinix Metal Devices using SQL

Equinix Metal is a bare metal infrastructure service that provides users with high-performance, on-demand, and globally available bare metal servers. It offers a fully automated platform for deploying infrastructure at scale, with features such as API-driven provisioning, hourly and reserved billing, and a wide range of server configuration options. Equinix Metal Devices are the individual servers that users can provision and manage within this service.

Table Usage Guide

The equinix_metal_device table provides insights into individual servers within the Equinix Metal service. As a system administrator or DevOps engineer, you can explore device-specific details through this table, including the device's ID, hostname, state, and associated project ID. Use this table to manage and monitor your infrastructure, identify unused or underutilized resources, and ensure compliance with your organization's infrastructure policies.

Examples

List all devices

Explore all devices in your Equinix Metal account to manage and monitor your resources more effectively. This query is useful in providing a comprehensive overview of your devices, aiding in resource allocation and troubleshooting.

select
*
from
equinix_metal_device;
select
*
from
equinix_metal_device;

Get IP addresses for a device

Determine the IP addresses associated with a specific device to better understand its network connections and interactions. This information can be useful for troubleshooting network issues or for security audits.

select
jsonb_array_elements(ip_addresses) ->> 'address' as ip_address
from
equinix_metal_device
where
hostname = 'ny5-c3-medium-x86-01';
select
json_extract(ip.value, '$.address') as ip_address
from
equinix_metal_device,
json_each(ip_addresses) as ip
where
hostname = 'ny5-c3-medium-x86-01';

Find devices tagged as production

Explore which devices are tagged as production. This is useful for identifying and managing devices specifically used in the production environment.

select
hostname,
tags
from
equinix_metal_device
where
tags -> 'production' is not null;
select
hostname,
tags
from
equinix_metal_device
where
json_extract(tags, '$.production') is not null;

Group devices by facility

Determine the distribution of devices across different facilities to understand where resources are concentrated. This can aid in resource allocation and management.

select
f.code,
f.name,
count(*) as num_devices
from
equinix_metal_device as d,
equinix_metal_facility as f
where
d.facility_id = f.id
group by
f.code,
f.name
order by
num_devices desc
select
f.code,
f.name,
count(*) as num_devices
from
equinix_metal_device as d
join equinix_metal_facility as f on d.facility_id = f.id
group by
f.code,
f.name
order by
num_devices desc;

List devices with OS information

Explore devices and their corresponding operating systems to gain insights into system compatibility and version distribution across your network. This could be particularly useful for IT administrators looking to maintain system uniformity or troubleshoot software issues.

select
d.hostname,
os.name,
os.version
from
equinix_metal_device as d,
equinix_metal_operating_system as os
where
d.operating_system_slug = os.slug;
select
d.hostname,
os.name,
os.version
from
equinix_metal_device as d,
equinix_metal_operating_system as os
where
d.operating_system_slug = os.slug;

Group devices by OS distribution

Discover the segments that are grouped by their operating system distribution, which can help in identifying the most commonly used systems and managing resources effectively. This can assist in making informed decisions about resource allocation and system updates.

select
os.distro,
count(*)
from
equinix_metal_device as d,
equinix_metal_operating_system as os
where
d.operating_system_slug = os.slug
group by
os.distro
order by
count desc;
select
os.distro,
count(*)
from
equinix_metal_device as d
join equinix_metal_operating_system as os on d.operating_system_slug = os.slug
group by
os.distro
order by
count(*) desc;

Schema for equinix_metal_device

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
always_pxetextTrue if PXE is always enabled for the device.
billing_cycletextBilling cycle for the device.
created_attimestamp with time zoneWhen the device was created.
customdatajsonbCustom data associated with the device.
descriptiontextDescription of the device.
facility_idtextFacility for the device.
hardware_reservationjsonbHardware reservation for the device.
hostnametextHostname of the device.
hreftextURL of the device.
idtext=ID of the device.
ip_addressesjsonbNetwork configuration for the device.
ipxe_script_urltextIPXE script URL for the device.
lockedbooleanTrue if the device is locked.
metro_idtextMetro for the device.
network_portsjsonbList of network ports for the device.
operating_system_slugtextOS for the device.
plan_idtextPlan for the device.
project_idtextID of the Project.
provisioning_eventsjsonbProvisioning events for the device.
provisioning_percentagedouble precisionProvisioning percentage complete for the device.
root_passwordtextRoot password for the device. Only available for 24hr after launch.
short_idtextShort ID for the device.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
spot_instancebooleanTrue if the device is a spot instance.
spot_price_maxdouble precisionMaximum spot price allowed for the device.
ssh_key_idsjsonbSSH Keys deployed to the device.
statetextState of the device.
storagejsonbStorage details for the device.
switch_uuidtextSwitch UUID for the device.
tagsjsonbA map of tags for the resource.
tags_srcjsonbTags for the device in source list form.
termination_timetimestamp with time zoneTime when the device was terminated.
titletextTitle of the resource.
updated_attimestamp with time zoneWhen the device was updated.
usertextUser for the device.
userdatatextUser data for the device.
volume_idsjsonbVolumes for the device.

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)" -- equinix

You can pass the configuration to the command with the --config argument:

steampipe_export_equinix --config '<your_config>' equinix_metal_device