This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to show resource usage for the current space (#2306)
This PR adds a deployments-related API under /deployments/environments/spaces/:spaceID. This endpoint returns resource usage for each of the user's environments, divided into usage by the specified space and usage by all other spaces combined. Currently this only returns CPU and memory usage, and not objects such as pods or secrets. There is an older /deployments/spaces/:spaceID/environments endpoint which has been left for backwards compatibility until the front-end is switched over completely. Example usage: Request: GET https://openshift.io/api/deployments/environments/spaces/$SPACE_ID Response: { "data": [ { "attributes": { "name": "run", "other_usage": { "cpucores": { "quota": 2, "used": 0.488 }, "memory": { "quota": 1073741824, "used": 262144000 }, "persistent_volume_claims": { "quota": 1, "used": 0 }, "replication_controllers": { "quota": 20, "used": 6 }, "secrets": { "quota": 20, "used": 9 }, "services": { "quota": 5, "used": 3 } }, "space_usage": { "cpucores": 1.488, "memory": 799014912 } }, "id": "run", "type": "environment" } ] } This work was started by @chrislessard, which I have put the finishing touches on and opened the PR on his behalf. Fixes: openshiftio/openshift.io#3129
- Loading branch information
Showing
7 changed files
with
5,234 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.