Created
January 3, 2019 16:45
-
-
Save charly-vega/5b0198bf4b3c4996a58f0db2684d236f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker node inspect $(docker node ls -q | xargs) | jq '[.[] | [.Spec.Role, "\(.Description.Hostname) - \(.ID)", .Spec.Labels, if .Description.Engine.Labels.frontend == "true" then { "frontend": true } else null end]] | group_by(.[0])' | |
curl -s $DOCKER_HOST/tasks | jq '[.[] | select(.DesiredState == "shutdown" and .Status.State == "running")] | sort_by(.NodeID) | .[] | [.NodeID, .ServiceID, .ID, .DesiredState, .Status.State] | @csv' -r | |
curl -s $DOCKER_HOST/tasks | jq '.[] | select(.NodeID == "jsr6wfrc43641huemibc1ea29") | [.NodeID, .ServiceID, .ID, .DesiredState, .Status.State] | @csv' -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment