Re: Organization quota definition-questions


Juan Antonio BreƱa Moral <bren at juanantonio.info...>
 

Hi,

You have the reason. Disk quota is a parameter defined to app level only.
http://apidocs.cloudfoundry.org/213/apps/creating_an_app.html

When you create a new App, you define a set of parameters and one of them is disk of quota but when you define a Org Quota, disk_quota is not defined at that level.
http://apidocs.cloudfoundry.org/213/organization_quota_definitions/creating_a_organization_quota_definition.html

I am not sure if someone from Pivotal could confirm this fact, but I think that CC API doesn't have that feature at org/space level.

Anyway, at the moment, using the API, it is possible to do the same task but not in a direct way:

IDEA:

spaces = getSpacesFromOrg(org_guid)
long org_disk_quota = 0;
for each(space in spaces) {
apps = getAppsFromSpace(space_guid)
for each(app in apps) {
app_stat = getAppSummary(app_guid) or getAppStats(app_guid)
http://apidocs.cloudfoundry.org/226/apps/get_app_summary.html
http://apidocs.cloudfoundry.org/226/apps/get_detailed_stats_for_a_started_app.html
org_used_disk = app_stat.getDiskQuota();
}
}
System.out.println("Disk quota for current org: " + org_used_disk);

Juan Antonio

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.