Skip to content

Add available space memory to /v3/spaces/:guid/usage_summary response #4560

@anailieva

Description

@anailieva

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions