Cloud Foundry API to find the cost of a space and an application

168 Views Asked by At

I am building a tool to get the cost of Cloud Foundry space and an application which is deployed on the AWS.

Can someone share if there are any straightforward APIs in Cloud Foundry for the same?

1

There are 1 best solutions below

1
On

Define "cost". Cloud Foundry doesn't have the concept of cost, so I'm not sure you can get a straightforward answer to this question.

You can use the API to look at memory or disk usage for running apps. That just gives you a snapshot from the time you make the API call though. You probably want to look more at the events of when apps start/stop so you can calculate duration and not miss things. At that point, your question is turning into how to implement a billing system for CF rather than make a quick API call or two.

There are discussions for this out there on how to bill, if you search for "cloud foundry billing" you'll find them. I haven't used it but there's also Abacus, which I believe can help with usage metering/billing.

Hope that helps!