cloudfoundry / cloudfoundry/cloud_controller_ng
Add available space memory to /v3/spaces/:guid/usage_summary response
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 207
- Forks
- 373
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 56
Description
After redesigning one of the pages in SAP BTP Cockpit, we would like to include a key metric - the available memory of a space.
Currently, the endpoint /v3/spaces/:guid/usage_summary provides information about used memory, but to calculate the available memory we need additional logic on the client side:
- Detect whether the space uses a space quota or defaults to the org quota.
- Apply different calculations based on this.
- Perform extra API calls to retrieve quota details.
Since the page already aggregates multiple metrics, every additional call affects the performance.
Our proposal is to enhance the response of /v3/spaces/:guid/usage_summary to include a new field available_memory_in_mb, which should represent the remaining memory capacity available for allocations within the space, respecting both space and org quotas:
- If the space has a space quota assigned:
available_memory = space_quota_memory_limit - used_memory - If the space has no space quota:
available_memory = org_quota_memory_limit - used_memory - If the space quota is greater than the org’s remaining available memory, the available memory must be capped by the org:
available_memory = min(space_quota_memory_limit, org_available_memory) - used_memory
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of the /v3/spaces/:guid/usage_summary endpoint and the existing quota and used-memory calculations. Verify the response for spaces with a space quota, spaces using the org quota, and cases where the space quota exceeds remaining org capacity; done means available_memory_in_mb follows the stated capped calculation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100