Skip to main content

2 posts tagged with "linode"

View All Tags

Latest Linode Provider for StackQL Available

· One min read
Technologist and Cloud Consultant

Latest release or the Linode provider for StackQL is available, enabling SQL-based querying and management of Linode cloud resources.

Provider Overview

The Linode provider offers comprehensive access to 20 services covering the entire Linode platform, with 136 resources and 425 methods, allowing you to extract data and insights from your Linode environment using familiar SQL syntax.

Key Services

The provider includes access to:

  • Compute: Manage Linode instances and configurations
  • Storage: Control volumes and object storage
  • Networking: Handle IPs, VLANs, VPCs, and firewall rules
  • Kubernetes: Administer LKE clusters and node pools
  • Databases: Manage Linode's database service
  • Account & Billing: Access account information and billing details

Example Queries

Get Account Information

SELECT 
company,
country,
balance,
balance_uninvoiced,
active_since
FROM linode.account.account;

List Database Engines

SELECT
id,
engine,
version
FROM linode.databases.engines;

View Regional Availability

SELECT
available,
plan,
region
FROM linode.regions.availability;

List Linode Instances

SELECT
id,
label,
region,
status,
type,
ipv4,
tags
FROM linode.linode.instances;

Getting Started

To use the Linode provider, simply register it and set your authentication:

-- Pull the provider
registry pull linode;

-- Set your authentication
SET linode.global.auth.credentialsenvvar = 'LINODE_TOKEN';

⭐ us on GitHub and join our community!

StackQL Linode provider Released

· 2 min read
Technologist and Cloud Consultant
info

stackql is a dev tool that allows you to query and manage cloud and SaaS resources using SQL, which developers and analysts can use for CSPM, assurance, user access management reporting, IaC, XOps and more.

The StackQL Linode provider is now available. Using the StackQL Linode provider you can create, query, and manage Linodes (instances), Volumes, NodeBalancers, Firewalls, StackScripts, Databases, Kubernetes Clusters, Object Storage Buckets, and much more.

You can use the StackQL Linode provider with other StackQL providers (such as aws, google, azure, digitalocean, and more) to perform multi-cloud CSPM, inventory queries, or multi-provider stack deployments. Documentation for the Linode provider is available at StackQL Linode provider docs.

Here is an example of creating a Linode (a VM instance), passing variables from a jsonnet config file as well as CI secrets (GitHub Actions Secrets, GitLab CI Secrets, etc.):

INSERT INTO linode.instances.linodes(
data__authorized_keys,
data__authorized_users,
data__root_pass,
data__image,
data__label,
data__region,
data__type
)
SELECT
'[ "{{ .authorized_key }}" ]',
'[ "{{ .authorized_user }}" ]',
'{{ .root_pass }}',
'{{ .image }}',
'{{ .label }}',
'{{ .region }}',
'{{ .type }}'
;

Querying objects in Linode can be done using SELECT statements, such as:

select id, 
label,
region,
JSON_EXTRACT(specs, '$.vcpus') as vcpus,
JSON_EXTRACT(specs, '$.memory') as memory,
JSON_EXTRACT(specs, '$.disk') as disk,
status
from linode.instances.linodes;

Which would return:

|----------|-----------|--------------|-------|--------|-------|---------|                                                                                                                                              
| id | label | region | vcpus | memory | disk | status |
|----------|-----------|--------------|-------|--------|-------|---------|
| 46063573 | my-linode | ap-southeast | 1 | 1024 | 25600 | running |
|----------|-----------|--------------|-------|--------|-------|---------|

Summary or aggregate queries such as GROUP BY -> COUNT or SUM are fully supported with StackQL, as are JOIN and UNION operations (including cross-provider JOIN operations).

StackQL supported outputs include table, csv (using a comma or user-specified delimiter), and json.

StackQL can be accessed through the interactive shell stackql shell as well as noninteractive access using stackql exec and server-based access using stackql srv - where you can use any Postgres wire protocol client to run StackQL queries. GitHub actions, Jupyter notebooks, and Superset dashboards are other options for using StackQL.