runbooks 0.9.6__py3-none-any.whl → 0.9.8__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.
Files changed (57) hide show
  1. runbooks/__init__.py +1 -1
  2. runbooks/_platform/__init__.py +19 -0
  3. runbooks/_platform/core/runbooks_wrapper.py +478 -0
  4. runbooks/cloudops/cost_optimizer.py +330 -0
  5. runbooks/cloudops/interfaces.py +3 -3
  6. runbooks/common/mcp_integration.py +174 -0
  7. runbooks/common/performance_monitor.py +4 -4
  8. runbooks/enterprise/__init__.py +18 -10
  9. runbooks/enterprise/security.py +708 -0
  10. runbooks/finops/README.md +1 -1
  11. runbooks/finops/automation_core.py +643 -0
  12. runbooks/finops/business_cases.py +414 -16
  13. runbooks/finops/cli.py +23 -0
  14. runbooks/finops/compute_cost_optimizer.py +865 -0
  15. runbooks/finops/ebs_cost_optimizer.py +718 -0
  16. runbooks/finops/ebs_optimizer.py +909 -0
  17. runbooks/finops/elastic_ip_optimizer.py +675 -0
  18. runbooks/finops/embedded_mcp_validator.py +330 -14
  19. runbooks/finops/enhanced_dashboard_runner.py +2 -1
  20. runbooks/finops/enterprise_wrappers.py +827 -0
  21. runbooks/finops/finops_dashboard.py +322 -11
  22. runbooks/finops/legacy_migration.py +730 -0
  23. runbooks/finops/nat_gateway_optimizer.py +1160 -0
  24. runbooks/finops/network_cost_optimizer.py +1387 -0
  25. runbooks/finops/notebook_utils.py +596 -0
  26. runbooks/finops/reservation_optimizer.py +956 -0
  27. runbooks/finops/single_dashboard.py +16 -16
  28. runbooks/finops/validation_framework.py +753 -0
  29. runbooks/finops/vpc_cleanup_optimizer.py +817 -0
  30. runbooks/finops/workspaces_analyzer.py +1 -1
  31. runbooks/inventory/__init__.py +7 -0
  32. runbooks/inventory/collectors/aws_networking.py +357 -6
  33. runbooks/inventory/mcp_vpc_validator.py +1091 -0
  34. runbooks/inventory/vpc_analyzer.py +1107 -0
  35. runbooks/inventory/vpc_architecture_validator.py +939 -0
  36. runbooks/inventory/vpc_dependency_analyzer.py +845 -0
  37. runbooks/main.py +487 -40
  38. runbooks/operate/vpc_operations.py +1485 -16
  39. runbooks/remediation/commvault_ec2_analysis.py +1 -1
  40. runbooks/remediation/dynamodb_optimize.py +2 -2
  41. runbooks/remediation/rds_instance_list.py +1 -1
  42. runbooks/remediation/rds_snapshot_list.py +1 -1
  43. runbooks/remediation/workspaces_list.py +2 -2
  44. runbooks/security/compliance_automation.py +2 -2
  45. runbooks/vpc/__init__.py +12 -0
  46. runbooks/vpc/cleanup_wrapper.py +757 -0
  47. runbooks/vpc/cost_engine.py +527 -3
  48. runbooks/vpc/networking_wrapper.py +29 -29
  49. runbooks/vpc/runbooks_adapter.py +479 -0
  50. runbooks/vpc/tests/test_config.py +2 -2
  51. runbooks/vpc/vpc_cleanup_integration.py +2629 -0
  52. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/METADATA +1 -1
  53. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/RECORD +57 -34
  54. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/WHEEL +0 -0
  55. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/entry_points.txt +0 -0
  56. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/licenses/LICENSE +0 -0
  57. {runbooks-0.9.6.dist-info → runbooks-0.9.8.dist-info}/top_level.txt +0 -0
@@ -60,7 +60,7 @@ def calculate_ec2_cost_impact(instances_data: List[Dict]) -> Dict[str, float]:
60
60
 
61
61
 
62
62
  @click.command()
63
- @click.option("--output-file", default="/tmp/commvault_ec2_investigation.csv", help="Output CSV file path")
63
+ @click.option("--output-file", default="./tmp/commvault_ec2_investigation.csv", help="Output CSV file path")
64
64
  @click.option("--account", default="637423383469", help="Commvault backup account ID (JIRA FinOps-25)")
65
65
  @click.option("--investigate-utilization", is_flag=True, help="Investigate EC2 utilization patterns")
66
66
  @click.option("--days", default=7, help="Number of days to analyze for utilization metrics")
@@ -114,8 +114,8 @@ def analyze_table(table_name):
114
114
 
115
115
  @click.command()
116
116
  @click.option("--apply", "-a", is_flag=True, help="Apply suggested optimizations")
117
- @click.option("--output", "-o", default="/tmp/dynamodb_analysis.csv", help="Output CSV file path")
118
- def dynamodb_analyze(apply=False, output="/tmp/dynamodb_analysis.csv"):
117
+ @click.option("--output", "-o", default="./tmp/dynamodb_analysis.csv", help="Output CSV file path")
118
+ def dynamodb_analyze(apply=False, output="./tmp/dynamodb_analysis.csv"):
119
119
  """Analyze DynamoDB tables and suggest cost optimizations."""
120
120
  logger.info(f"Analyzing DynamoDB tables in {display_aws_account_info()}")
121
121
 
@@ -58,7 +58,7 @@ def get_cloudwatch_metrics(cloudwatch, instance_id, metric_name, days=7):
58
58
 
59
59
 
60
60
  @click.command()
61
- @click.option("--output-file", default="/tmp/rds_cost_optimization.csv", help="Output CSV file path")
61
+ @click.option("--output-file", default="./tmp/rds_cost_optimization.csv", help="Output CSV file path")
62
62
  @click.option("--days", default=7, help="Number of days for CloudWatch metrics analysis")
63
63
  @click.option("--include-storage", is_flag=True, help="Include detailed storage analysis")
64
64
  def get_rds_list(output_file, days, include_storage):
@@ -86,7 +86,7 @@ def calculate_manual_snapshot_savings(snapshots_data: List[Dict]) -> Dict[str, f
86
86
 
87
87
 
88
88
  @click.command()
89
- @click.option("--output-file", default="/tmp/rds_snapshots.csv", help="Output CSV file path")
89
+ @click.option("--output-file", default="./tmp/rds_snapshots.csv", help="Output CSV file path")
90
90
  @click.option("--old-days", default=30, help="Days threshold for considering snapshots old")
91
91
  @click.option("--include-cost", is_flag=True, help="Include estimated cost analysis")
92
92
  @click.option("--snapshot-type", help="Filter by snapshot type (automated, manual)")
@@ -93,7 +93,7 @@ def get_workspace_usage_by_hours(workspace_id, start_time, end_time):
93
93
 
94
94
 
95
95
  @click.command()
96
- @click.option("--output-file", default="/tmp/workspaces.csv", help="Output CSV file path")
96
+ @click.option("--output-file", default="./tmp/workspaces.csv", help="Output CSV file path")
97
97
  @click.option("--days", default=30, help="Number of days to analyze for usage metrics")
98
98
  @click.option("--delete-unused", is_flag=True, help="🚨 HIGH-RISK: Delete unused WorkSpaces")
99
99
  @click.option("--unused-days", default=90, help="Days threshold for considering WorkSpace unused")
@@ -102,7 +102,7 @@ def get_workspace_usage_by_hours(workspace_id, start_time, end_time):
102
102
  @click.option("--analyze", is_flag=True, help="Perform detailed cost analysis")
103
103
  @click.option("--dry-run", is_flag=True, default=True, help="Preview actions without execution")
104
104
  def get_workspaces(
105
- output_file: str = "/tmp/workspaces.csv",
105
+ output_file: str = "./tmp/workspaces.csv",
106
106
  days: int = 30,
107
107
  delete_unused: bool = False,
108
108
  unused_days: int = 90,
@@ -144,7 +144,7 @@ class ComplianceAutomation:
144
144
  tester = SecurityBaselineTester(
145
145
  profile=self.profile,
146
146
  lang_code=language,
147
- output_dir=f"/tmp/compliance_{datetime.now().strftime('%Y%m%d_%H%M%S')}",
147
+ output_dir=f"./tmp/compliance_{datetime.now().strftime('%Y%m%d_%H%M%S')}",
148
148
  )
149
149
 
150
150
  # Execute assessment
@@ -492,7 +492,7 @@ class ComplianceAutomation:
492
492
  else:
493
493
  raise ValueError(f"Unsupported format: {format}")
494
494
 
495
- dashboard_path = f"/tmp/{filename}"
495
+ dashboard_path = f"./tmp/{filename}"
496
496
  with open(dashboard_path, "w") as f:
497
497
  f.write(dashboard_content)
498
498
 
runbooks/vpc/__init__.py CHANGED
@@ -22,6 +22,9 @@ from .heatmap_engine import NetworkingCostHeatMapEngine
22
22
  from .manager_interface import BusinessRecommendation, ManagerDashboardConfig, VPCManagerInterface
23
23
  from .networking_wrapper import VPCNetworkingWrapper
24
24
  from .rich_formatters import display_cost_table, display_heatmap, display_optimization_recommendations
25
+ from .vpc_cleanup_integration import VPCCleanupFramework, VPCCleanupCandidate, VPCCleanupRisk, VPCCleanupPhase
26
+ from .cleanup_wrapper import VPCCleanupCLI, analyze_cleanup_candidates, validate_cleanup_safety, generate_business_report
27
+ from .runbooks_adapter import RunbooksAdapter
25
28
 
26
29
  __all__ = [
27
30
  "VPCNetworkingWrapper",
@@ -33,6 +36,15 @@ __all__ = [
33
36
  "display_cost_table",
34
37
  "display_heatmap",
35
38
  "display_optimization_recommendations",
39
+ "VPCCleanupFramework",
40
+ "VPCCleanupCandidate",
41
+ "VPCCleanupRisk",
42
+ "VPCCleanupPhase",
43
+ "VPCCleanupCLI",
44
+ "analyze_cleanup_candidates",
45
+ "validate_cleanup_safety",
46
+ "generate_business_report",
47
+ "RunbooksAdapter",
36
48
  ]
37
49
 
38
50
  # Import centralized version from main runbooks package