44

wash: the wide-area shell | home

 5 years ago
source link: https://puppetlabs.github.io/wash/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

wash-logo.pngWash

A UNIX-like shell for managing your cloud native and non-cloud native things.

With Wash

  • You can use ls to list, cat to read, and wexec to run commands on all your things. No more switching between confusing CLI tools.

  • You can use find to filter anything on anything. No more complicated query DSLs.

  • You can cd through a vendor's API. No more navigating complex console UIs.

  • You can extend it to talk to other things, like Spotify.

See for yourself

AWS

s3/                                                         wash ❯ cd ec2/instances                                     wash ❯ ls                                                   i-04621c13583930e6c/                                        wash ❯ find . -k '*instance' -m '.state.name' running -m '.tags[?].key' owner                                           ./i-04621c13583930e6c                                       wash ❯ wexec i-04621c13583930e6c uname                      Linux                                                       wash ❯ cd i-04621c13583930e6c                               wash ❯ ls                                                   console.out                                                 fs/                                                         metadata.json                                               wash ❯ cat console.out                                      
00:00

The EC2 instance find query shown above (find . -k '*instance' -m '.state.name' running -m '.tags[?].key' owner) returns all running EC2 instances with the 'owner' tag.

GCP

storage/                                                    wash ❯ cd compute                                           wash ❯ ls                                                   michael-test-instance/                                      wash ❯ find . -k '*instance' -m '.status' RUNNING -m '.labels.owner' -exists                                            ./michael-test-instance                                     wash ❯ wexec michael-test-instance uname                    Linux                                                       wash ❯ cd michael-test-instance                             wash ❯ ls                                                   console.out                                                 fs/                                                         metadata.json                                               wash ❯ cat console.out                                      
00:00

The compute instance find query shown above (find . -k '*instance' -m '.status' RUNNING -m '.labels.owner' -exists) returns all running compute instances with the 'owner' label.

Kubernetes

kube-public/                                                kube-system/                                                wash ❯ cd docker                                            wash ❯ ls                                                   persistentvolumeclaims/                                     pods/                                                       wash ❯ cd pods                                              wash ❯ ls                                                   compose-6c67d745f6-ljtwr/                                   compose-api-57ff65b8c7-m2mb6/                               wash ❯ find . -k '*pod' -m '.status.phase' Running -m '.metadata.labels.pod-template-hash' -exists                      ./compose-6c67d745f6-ljtwr                                  ./compose-api-57ff65b8c7-m2mb6                              wash ❯ wexec compose-6c67d745f6-ljtwr/compose uname         
00:00

The pods find query shown above (find . -k '*pod' -m '.status.phase' Running -m '.metadata.labels.pod-template-hash' -exists) returns all running pods with the 'pod-template-hash' label.

Docker

wash ❯ ls                                                   wash_tutorial_redis_1/                                      wash_tutorial_web_1/                                        wash ❯ find . -k '*container' -m '.state' running -m '.labels.com\.docker\.compose\.version' -exists                    ./wash_tutorial_redis_1                                     ./wash_tutorial_web_1                                       wash ❯ wexec wash_tutorial_redis_1 uname                    Linux                                                       wash ❯ cd wash_tutorial_redis_1                             wash ❯ ls                                                   fs/                                                         log                                                         metadata.json                                               wash ❯ cat log                                              
00:00

The container find query shown above (find . -k '*container' -m '.state' running -m '.labels.com\.docker\.compose\.version' -exists) returns all running containers with the 'com.docker.compose.version' label.

External plugins (Spotify)

wash ❯ cd spotify                                           wash ❯ ls                                                   playlists/                                                  wash ❯ cd playlists                                         wash ❯ ls                                                   classical/                                                  gym/                                                        wash ❯ cd gym                                               wash ❯ ls                                                   Down with the Sickness                                      Remember the Name (feat. Styles of Beyond)                  wash ❯ find . -m '.artist' Disturbed                        ./Down with the Sickness                                    wash ❯ cat Down\ with\ the\ Sickness                                                                                    
00:00

The Spotify plugin shows off Wash's greatest power: its ability to talk to anything via the external plugin interface. And when we say anything, we really do mean anything. We mean other cloud native vendors like OpenStack or Azure. We mean personal IoT devices like network devices, smart lightbulbs, or bluetooth-enabled espresso scales. We mean IT infrastructure like Puppet nodes, Bolt inventory files, or any of your company's internal APIs. And we also mean some truly bizarre APIs like Goodreads or Fandango. Thus if you've got some other things you'd like to cd and ls through, filter with find, read with cat, or more, then give Wash a try. We already have some community-built external plugins that you can use. If those aren't enough, then you can write your own external plugin in any language you like (think Bash, Ruby, Python, Go). The sky is the limit.

© 2019 — the Wash maintainers

This page was generated by GitHub Pages.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK