runbooks 0.9.2__py3-none-any.whl → 0.9.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runbooks/__init__.py +15 -6
- runbooks/cfat/__init__.py +3 -1
- runbooks/cloudops/__init__.py +3 -1
- runbooks/common/aws_utils.py +367 -0
- runbooks/common/enhanced_logging_example.py +239 -0
- runbooks/common/enhanced_logging_integration_example.py +257 -0
- runbooks/common/logging_integration_helper.py +344 -0
- runbooks/common/profile_utils.py +8 -6
- runbooks/common/rich_utils.py +347 -3
- runbooks/enterprise/logging.py +400 -38
- runbooks/finops/README.md +262 -406
- runbooks/finops/__init__.py +2 -1
- runbooks/finops/accuracy_cross_validator.py +12 -3
- runbooks/finops/commvault_ec2_analysis.py +415 -0
- runbooks/finops/cost_processor.py +718 -42
- runbooks/finops/dashboard_router.py +44 -22
- runbooks/finops/dashboard_runner.py +302 -39
- runbooks/finops/embedded_mcp_validator.py +358 -48
- runbooks/finops/finops_scenarios.py +771 -0
- runbooks/finops/multi_dashboard.py +30 -15
- runbooks/finops/single_dashboard.py +386 -58
- runbooks/finops/types.py +29 -4
- runbooks/inventory/__init__.py +2 -1
- runbooks/main.py +522 -29
- runbooks/operate/__init__.py +3 -1
- runbooks/remediation/__init__.py +3 -1
- runbooks/remediation/commons.py +55 -16
- runbooks/remediation/commvault_ec2_analysis.py +259 -0
- runbooks/remediation/rds_snapshot_list.py +267 -102
- runbooks/remediation/workspaces_list.py +182 -31
- runbooks/security/__init__.py +3 -1
- runbooks/sre/__init__.py +2 -1
- runbooks/utils/__init__.py +81 -6
- runbooks/utils/version_validator.py +241 -0
- runbooks/vpc/__init__.py +2 -1
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/METADATA +98 -60
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/RECORD +41 -38
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/entry_points.txt +1 -0
- runbooks/inventory/cloudtrail.md +0 -727
- runbooks/inventory/discovery.md +0 -81
- runbooks/remediation/CLAUDE.md +0 -100
- runbooks/remediation/DOME9.md +0 -218
- runbooks/security/ENTERPRISE_SECURITY_FRAMEWORK.md +0 -506
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/WHEEL +0 -0
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/licenses/LICENSE +0 -0
- {runbooks-0.9.2.dist-info → runbooks-0.9.4.dist-info}/top_level.txt +0 -0
@@ -68,12 +68,12 @@ from .cost_processor import (
|
|
68
68
|
get_cost_data,
|
69
69
|
process_service_costs,
|
70
70
|
)
|
71
|
-
from .
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
_initialize_profiles,
|
71
|
+
from runbooks.common.profile_utils import (
|
72
|
+
create_cost_session,
|
73
|
+
create_management_session,
|
74
|
+
create_operational_session,
|
76
75
|
)
|
76
|
+
from .dashboard_runner import _initialize_profiles
|
77
77
|
from .enhanced_progress import track_multi_account_analysis
|
78
78
|
from .helpers import export_cost_dashboard_to_pdf
|
79
79
|
from .service_mapping import get_service_display_name
|
@@ -564,8 +564,8 @@ class MultiAccountDashboard:
|
|
564
564
|
display_profile = profile
|
565
565
|
|
566
566
|
# Initialize sessions using base profile
|
567
|
-
cost_session =
|
568
|
-
mgmt_session =
|
567
|
+
cost_session = create_cost_session(base_profile)
|
568
|
+
mgmt_session = create_management_session(base_profile)
|
569
569
|
|
570
570
|
# SRE FIX: Get account ID - use target account for Organizations API or session account
|
571
571
|
if target_account_id:
|
@@ -1244,15 +1244,24 @@ class MultiAccountDashboard:
|
|
1244
1244
|
|
1245
1245
|
top_org_services = sorted(all_services.items(), key=lambda x: x[1], reverse=True)[:5]
|
1246
1246
|
|
1247
|
-
# Create summary panel
|
1248
|
-
|
1249
|
-
|
1247
|
+
# Create summary panel with enhanced trend analysis
|
1248
|
+
from .cost_processor import calculate_trend_with_context
|
1249
|
+
|
1250
|
+
# For multi-account analysis, we generally have full month data, but check for consistency
|
1251
|
+
overall_trend_display = calculate_trend_with_context(total_spend, total_last_month)
|
1252
|
+
|
1253
|
+
# Extract trend direction for icon (maintaining existing functionality)
|
1254
|
+
if total_last_month > 0:
|
1255
|
+
overall_trend_pct = ((total_spend - total_last_month) / total_last_month * 100)
|
1256
|
+
trend_icon = "⬆" if overall_trend_pct > 0 else "⬇" if overall_trend_pct < 0 else "➡"
|
1257
|
+
else:
|
1258
|
+
trend_icon = "➡"
|
1250
1259
|
|
1251
1260
|
summary_text = f"""
|
1252
1261
|
[highlight]Organization Summary[/]
|
1253
1262
|
• Total Accounts: {len(accounts)}
|
1254
1263
|
• Total Monthly Spend: {format_cost(total_spend)}
|
1255
|
-
• Overall Trend: {
|
1264
|
+
• Overall Trend: {overall_trend_display}
|
1256
1265
|
• Budget Alerts: {over_budget_count} over budget, {warning_count} warnings
|
1257
1266
|
|
1258
1267
|
[highlight]Top Organization Services[/]
|
@@ -1426,9 +1435,15 @@ class MultiAccountDashboard:
|
|
1426
1435
|
f"| {account_display_escaped} | ${last:.0f} | ${current:.0f} | {services_text_escaped} | {budget_clean_escaped} | {optimization_escaped} |"
|
1427
1436
|
)
|
1428
1437
|
|
1429
|
-
# Add summary section
|
1430
|
-
|
1431
|
-
|
1438
|
+
# Add summary section with enhanced trend analysis
|
1439
|
+
overall_trend_display = calculate_trend_with_context(total_current, total_last)
|
1440
|
+
|
1441
|
+
# Extract trend direction for emoji (maintaining existing markdown export format)
|
1442
|
+
if total_last > 0:
|
1443
|
+
overall_trend_pct = ((total_current - total_last) / total_last * 100)
|
1444
|
+
trend_direction = "↗️" if overall_trend_pct > 0 else "↘️" if overall_trend_pct < 0 else "➡️"
|
1445
|
+
else:
|
1446
|
+
trend_direction = "➡️"
|
1432
1447
|
|
1433
1448
|
lines.append("")
|
1434
1449
|
lines.append("## Organization Summary")
|
@@ -1436,7 +1451,7 @@ class MultiAccountDashboard:
|
|
1436
1451
|
lines.append(f"- **Total Accounts Analyzed**: {len(accounts)}")
|
1437
1452
|
lines.append(f"- **Total Current Month**: ${total_current:,.2f}")
|
1438
1453
|
lines.append(f"- **Total Last Month**: ${total_last:,.2f}")
|
1439
|
-
lines.append(f"- **Overall Trend**: {
|
1454
|
+
lines.append(f"- **Overall Trend**: {overall_trend_display}")
|
1440
1455
|
lines.append(f"- **Analysis Performance**: {execution_time:.1f}s execution")
|
1441
1456
|
lines.append("")
|
1442
1457
|
|