Skip to content

Instantly share code, notes, and snippets.

@geekbass
Created December 27, 2018 18:56
Show Gist options
  • Select an option

  • Save geekbass/152799b27baf5b3f52628f914cee907a to your computer and use it in GitHub Desktop.

Select an option

Save geekbass/152799b27baf5b3f52628f914cee907a to your computer and use it in GitHub Desktop.

Revisions

  1. Weston Bassler created this gist Dec 27, 2018.
    7 changes: 7 additions & 0 deletions reservations.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    curl -skSL \
    -H "Authorization: token=$(dcos config show core.dcos_acs_token)" \
    -H "Content-Type: application/json" \
    "$(dcos config show core.dcos_url)/mesos/slaves" | \
    jq -er '[.slaves[] | select(.active==true) | {id: .id, hostname: .hostname, active: .active, reserved_resources_full: (.reserved_resources_full)}]' | \
    jq -er '[.[] | select(.reserved_resources_full | length > 0)]' | \
    tee reservations.json