turbot/alicloud_insights

Query: vpc_vswitches_detail

Usage

powerpipe query alicloud_insights.query.vpc_vswitches_detail

Steampipe Tables

SQL

with vSwitches as (
select
vswitch_id,
name,
cidr_block,
zone_id,
available_ip_address_count,
power(2, 32 - masklen(cidr_block :: cidr)) -1 as raw_size
from
alicloud_vpc_vswitch
where
vpc_id = $1
)
select
vswitch_id as "vSwitch ID",
name as "Name",
cidr_block as "CIDR Block",
zone_id as "Zone ID",
available_ip_address_count as "Available IPs",
power(2, 32 - masklen(cidr_block :: cidr)) -1 as "Total IPs",
round(100 * (available_ip_address_count / (raw_size))::numeric, 2) as "% Free"
from
vSwitches
order by
vswitch_id;

Dashboards

The query is used in the dashboards: