summaryrefslogtreecommitdiff
path: root/vps/functions/list_all_vps.sh
diff options
context:
space:
mode:
authordoc <doc@filenotfound.org>2025-06-30 20:14:17 +0000
committerdoc <doc@filenotfound.org>2025-06-30 20:14:17 +0000
commita8cd1c324c0541b0d26542168aeced085ec13201 (patch)
treea99d398008b46aa4df5dcae997e1690298d2fc70 /vps/functions/list_all_vps.sh
initial failzero commitHEADmaster
Diffstat (limited to 'vps/functions/list_all_vps.sh')
-rwxr-xr-xvps/functions/list_all_vps.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/vps/functions/list_all_vps.sh b/vps/functions/list_all_vps.sh
new file mode 100755
index 0000000..8ce99eb
--- /dev/null
+++ b/vps/functions/list_all_vps.sh
@@ -0,0 +1,9 @@
+list_all_vps() {
+ curl -s -H "Authorization: Bearer $LINODE_API_TOKEN" \
+ https://api.linode.com/v4/linode/instances | \
+ jq -r '
+ .data[] | [.label, .id, .region, .type, .ipv4[0], .status] |
+ @tsv' | column -t -s $'\t' | \
+ awk 'BEGIN { print "LABEL ID REGION TYPE IP STATUS" }
+ { printf "%-11s %-10s %-10s %-16s %-15s %s\n", $1, $2, $3, $4, $5, $6 }'
+}