Skip to content

feat(dashboard): add command to list inactive gateway resources - #3151

Merged
wklken merged 2 commits into
TencentBlueKing:masterfrom
wklken:feat/list-inactive-resources-command
Aug 11, 2026
Merged

feat(dashboard): add command to list inactive gateway resources#3151
wklken merged 2 commits into
TencentBlueKing:masterfrom
wklken:feat/list-inactive-resources-command

Conversation

@wklken

@wklken wklken commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add list_inactive_resources Django management command to identify gateway resources with no request statistics in the past N days.
  • Process gateways one by one and export inactive resources to per-gateway CSV files for cleanup review.
  • Include resource metadata and historical last request time to help prioritize deletions.

Test plan

  • pytest apigateway/tests/apps/metrics/management/commands/test_list_inactive_resources.py (3 passed)
  • Run against a staging gateway with known traffic patterns and verify CSV output

Usage

cd src/dashboard
uv run python apigateway/manage.py list_inactive_resources \
  --gateway-names gw-a gw-b \
  --days 30 \
  --output-dir ./cleanup-reports

Made with Cursor

wklken and others added 2 commits August 11, 2026 19:24
Add list_inactive_resources management command to export resources with
no gateway request statistics in the past N days, grouped by gateway.

Co-authored-by: Cursor <cursoragent@cursor.com>
Change list_inactive_resources --gateway-names to a comma-separated string
for easier shell usage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wklken
wklken merged commit 0b7e68e into TencentBlueKing:master Aug 11, 2026
4 checks passed
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.

1 participant