Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add system usage API endpoint #123

Merged
merged 8 commits into from
Aug 7, 2024
Merged

✨ Add system usage API endpoint #123

merged 8 commits into from
Aug 7, 2024

Conversation

linkdd
Copy link
Collaborator

@linkdd linkdd commented Aug 6, 2024

Decision Record

The Docker CLI provides the command docker system df to see detailed disk space usage. This is backed by the engine API /system/df route (for more information, see this page).

In order to be able to report in Netbox the disk space usage of a host (in a Pie chart?), the agent need to be able to aggregate those information, hence the new /system/usage API endpoint.

Example response:

{
  "layers_size": 12321486189,
  "images": {
    "shared_size": 11717122867,
    "size": 21761376867,
    "virtual_size": 21761376867
  },
  "containers": {
    "size_rootfs": 1645637288
  },
  "volumes": 154790360,
  "build_cache": 14563481423
}

NB: Sizes are in "bytes".

A chart using ApexCharts has been added on the UI to visualize the data:

image

Changes

  • 🚚 Rename/reorganize nodes in API - GET tab for readability
  • ✨ Add /system/usage API endpoint that returns aggregated disk space usage
  • 🗃️ Add /system/usage endpoint to OpenAPI schema
  • ➕ Add ApexCharts library to UI
  • 💄 Visualize data on UI home page with a Pie chart
  • 🔖 v0.32.0

@linkdd linkdd self-assigned this Aug 6, 2024
@lvenier
Copy link
Contributor

lvenier commented Aug 7, 2024

Thanks for PR. Here what I would have added or done :

  • in the UI I would have have added a tab to report the values. No need to graph but just display.
  • in openapi I would have added the api entry so we have the swagger file still up to date even if not perfect yet in term of body content.
  • I'm not sure I would have added this in the "GET" tab. I would have put it in the "EXTRA" tab.

Copy link
Contributor

@lvenier lvenier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments provided in the conversation

@linkdd linkdd requested a review from lvenier August 7, 2024 07:40
@linkdd linkdd merged commit 80c8472 into main Aug 7, 2024
1 check passed
@linkdd linkdd deleted the system-df branch August 7, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants