Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

docstream/towboat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Towboat

Simple CLI to communicate w DigitalOcean API

Converts useless JSON into nixy-nice text ;0

NO heavy script-interpreters required , just POSIX

Dependencies

  • jq
  • curl
  • awk/sed

Debian/Mint way to get these;

$ apt-get install jq curl

Usage

First set env var DO_TOKEN ;

# smart to put this into ~/.bashrc
export DO_TOKEN={my_token_from_api_settings}


$ ./towboat help

will return ;

usage: ./towboat [post] <resource>

resource: 

  help|usage
  droplets
  regions
  keys
  images
  images_user

Delete is not supported, and the field selection is just HIGHLY OPINIONATED

Reading

To read (GET) a resource-list, just skip 'post' in command ;

$ ./towboat droplets

..long 
long..
list..

Posting

To create new (sample) resource ;

# Creates a new DROPLET in DigitalOcean CLOUD !!
$ cat sample-droplet.json | ./towboat post droplets

Filters

It's possible to filter the 'droplets' output further like this ;

$ . ./dro.filters
$ ./towboat droplets | region ams1 | priv_ips | json_str_list
$ ./towboat droplets | publ_ips | json_str_list

DASH Singleline Sample

. ./dro.filters; \
./towboat droplets \
  | region ams3 | tee /tmp/ds.txt \
  | priv_ips | json_str_list > /tmp/priv_ips.json && \
cat /tmp/ds.txt | publ_ips > /tmp/publ_ips.txt

About

🐳 Opensource CLI DO control scripts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published