Skip to content

Instantly share code, notes, and snippets.

@bleach
Created October 9, 2017 16:00
Show Gist options
  • Save bleach/b7c7bd9c6f73966c39a4f4000fbbf19c to your computer and use it in GitHub Desktop.
Save bleach/b7c7bd9c6f73966c39a4f4000fbbf19c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euo pipefail
quota_url=$(cf curl '/v2/quota_definitions?q=name:default' \
| jq '.resources[].metadata.url')
from_date=$(($(date '+%s') - 3600*24*90))
cf curl /v2/organizations \
| jq -r ".resources[] | select (.entity.quota_definition_url == ${quota_url}) | select ( .metadata.created_at | fromdateiso8601? < ${from_date}) | [.entity.name,.metadata.created_at] | @tsv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment