allomov
2/9/2016 - 4:04 PM

Just for case you need to update organization in CF by names. (to get quota list use `cf quotas` command). This solution is described here h

Just for case you need to update organization in CF by names. (to get quota list use cf quotas command). This solution is described here http://docs.pivotal.io/pivotalcf/opsguide/change-quota-plan.html.

org_name=my-org
quota_name=runaway
org_guid=$(CF_TRACE=true cf org $org_name | grep -B7 $org_name | grep guid | awk '{gsub(/\"guid\":|\ |\"|\,/,"")}1')
quota_guid=$(cf curl /v2/quota_definitions -X 'GET' | grep -B7 runaway | grep guid | awk '{gsub(/\"guid\":|\ |\"|\,/,"")}1')
cf curl /v2/organizations/$org_guid -X 'PUT' -d "{\"quota_definition_guid\":\"$quota_guid\"}"