MCPcopy Create free account

hub / github.com/fabriziosalmi/proxmox-lxc-autoscale / functions

Functions603 in github.com/fabriziosalmi/proxmox-lxc-autoscale

↓ 29 callersFunctionrun_command
(cmd: Union[str, List[str]], timeout: int = 30)
lxc_autoscale/lxc_utils.py:58
↓ 21 callersMethodapply_boost
Record a new boost and persist state.
lxc_autoscale/boost.py:118
↓ 20 callersMethodis_boosted
Check if a container resource is currently boosted.
lxc_autoscale/boost.py:110
↓ 19 callersFunctionvalidate_container_id
(ctid: str)
lxc_autoscale/lxc_utils.py:49
↓ 17 callersFunction_validate_ctid
(ctid: str)
lxc_autoscale/backends/cli.py:20
↓ 17 callersMethodcheck_saturation
Increment saturation counter. Return True if threshold met for N samples.
lxc_autoscale/boost.py:57
↓ 14 callersFunction_is_safe_url
Check that a URL does not point to internal/private network addresses (SSRF prevention).
lxc_autoscale/notification.py:25
↓ 13 callersFunctionlog_json_event
(ctid: str, action: str, resource_change)
lxc_autoscale/lxc_utils.py:232
↓ 11 callersFunction_fire_and_forget
Schedule a coroutine as a background task with reference tracking.
lxc_autoscale/scaling_manager.py:35
↓ 11 callersMethod_in_thread
(self, fn, *args, **kwargs)
lxc_autoscale/backends/api.py:55
↓ 11 callersMethodrun_raw
(self, cmd: Union[str, List[str]], timeout: int = 30)
lxc_autoscale/backends/cli.py:40
↓ 10 callersFunction_build_host_key_policy
Map config string to a Paramiko host-key policy. ``"reject"`` (default) — refuse unknown hosts (safe). ``"system"`` — warn on unknown but all
lxc_autoscale/ssh.py:25
↓ 10 callersFunction_expand_env_vars
Recursively expand ${ENV_VAR} and ${ENV_VAR:-default} in strings.
lxc_autoscale/config.py:242
↓ 10 callersMethod_lxc
(self, ctid: str)
lxc_autoscale/backends/api.py:50
↓ 10 callersFunctionsend_notification_async
Send notification in a background thread — never blocks the event loop.
lxc_autoscale/notification.py:196
↓ 8 callersMethodclose
Clean up SSH pool if remote mode was used.
lxc_autoscale/backends/cli.py:150
↓ 7 callersMethodfilter
(self, record: logging.LogRecord)
lxc_autoscale/logging_setup.py:38
↓ 7 callersFunctionget_app_config
Get or create the singleton AppConfig.
lxc_autoscale/config.py:385
↓ 6 callersFunction_get_container_lock
Return a per-container async lock via the state cache.
lxc_autoscale/lxc_utils.py:41
↓ 6 callersFunction_now_tz
Return timezone-aware current time using configured timezone.
lxc_autoscale/scaling_manager.py:42
↓ 6 callersFunction_read_mem_file
(path: str)
lxc_autoscale/lxc_utils.py:732
↓ 6 callersFunctioncalculate_increment
(current: float, upper_threshold: float, min_increment: int, max_increment: int)
lxc_autoscale/scaling_manager.py:57
↓ 6 callersMethodevict_stale
Remove boost records for containers no longer active.
lxc_autoscale/boost.py:270
↓ 6 callersFunctionget_behaviour_multiplier
()
lxc_autoscale/scaling_manager.py:70
↓ 6 callersMethodget_core_count
Return cached core count or None.
lxc_autoscale/state.py:51
↓ 6 callersFunctionis_off_peak
Determine if the current time is within off-peak hours (timezone-aware).
lxc_autoscale/scaling_manager.py:82
↓ 6 callersFunctionload_config
Load and validate the full application configuration.
lxc_autoscale/config.py:304
↓ 6 callersMethodrun_command
Execute a command on the remote host (async, non-blocking).
lxc_autoscale/ssh.py:68
↓ 6 callersMethodsend_notification
(self, title, message, priority=5)
tests/test_hardening.py:183
↓ 6 callersMethodset_core_count
Cache core count. Never stores 0.
lxc_autoscale/state.py:47
↓ 6 callersFunctionsetup_logging
Configure logging with console and file handlers + secret masking.
lxc_autoscale/logging_setup.py:63
↓ 5 callersFunction_adjust_boost_mode
Handle boost/revert scaling for a single container.
lxc_autoscale/scaling_manager.py:382
↓ 5 callersMethod_is_alive
(client: "paramiko.SSHClient")
lxc_autoscale/ssh.py:158
↓ 5 callersMethod_release
(self, client: "paramiko.SSHClient")
lxc_autoscale/ssh.py:122
↓ 5 callersFunctioncalculate_decrement
(current: float, lower_threshold: float, current_allocated: int, min_decrement: int,
lxc_autoscale/scaling_manager.py:63
↓ 5 callersMethodcompute_boost
Compute boosted value with fallback. Returns (new_value, factor_used) or (None, 0) if neither fits. For CPU (cores): rounds up to int
lxc_autoscale/boost.py:83
↓ 5 callersMethodget_container_lock
Return a per-container async lock, creating on first access.
lxc_autoscale/state.py:40
↓ 5 callersFunctionlog_scaling_event
(ctid: str, event_type: str, details: Dict[str, Any], error: bool = False)
lxc_autoscale/scaling_manager.py:109
↓ 5 callersMethodrevert
Remove boost record and return original value for revert command. Returns the original value to revert to, or None if not boosted.
lxc_autoscale/boost.py:164
↓ 5 callersFunctionvalidate_tier_settings
(ctid: str, config: Dict[str, Any])
lxc_autoscale/scaling_manager.py:188
↓ 4 callersMethod_discard
(self, client: "paramiko.SSHClient")
lxc_autoscale/ssh.py:131
↓ 4 callersMethod_get_node
(self)
lxc_autoscale/backends/api.py:42
↓ 4 callersMethod_reset_notification_state
Reset module-level state between tests.
tests/test_hardening.py:171
↓ 4 callersMethod_save
Persist active boosts to JSON file.
lxc_autoscale/boost.py:193
↓ 4 callersFunctionacquire_lock
Context manager to acquire an exclusive lock on the lock file. Prevents multiple daemon instances from running concurrently. The lock is rele
lxc_autoscale/lock_manager.py:15
↓ 4 callersMethodbackup_unchanged
Return True if settings match last backup (skip write).
lxc_autoscale/state.py:79
↓ 4 callersFunctiongenerate_cloned_hostname
(base_name: str, clone_number: int)
lxc_autoscale/lxc_utils.py:848
↓ 4 callersMethodget_boost
Get the active boost record, if any.
lxc_autoscale/boost.py:114
↓ 4 callersFunctionget_state_cache
Get the global ContainerStateCache singleton.
lxc_autoscale/state.py:115
↓ 4 callersMethodis_cpu_negative_cached
Check if cgroup CPU path discovery should be skipped.
lxc_autoscale/state.py:55
↓ 4 callersFunctionis_ignored
(ctid: str)
lxc_autoscale/lxc_utils.py:120
↓ 4 callersMethodload
Load persisted boost state from JSON file.
lxc_autoscale/boost.py:206
↓ 4 callersMethodreconcile
Reconcile persisted boosts against live Proxmox config. For each persisted boost: - If container doesn't exist: remove boost
lxc_autoscale/boost.py:222
↓ 4 callersFunctionscale_memory
(ctid: str, mem_usage: float, mem_upper: float, mem_lower: float, current_memory: int,
lxc_autoscale/scaling_manager.py:144
↓ 4 callersFunctionshould_scale_out
(metrics, group_config, current_time, last_action_time)
lxc_autoscale/scaling_manager.py:470
↓ 3 callersMethod__init__
(self, cmd, message="", returncode=None)
lxc_autoscale/errors.py:16
↓ 3 callersMethod_acquire
(self)
lxc_autoscale/ssh.py:111
↓ 3 callersFunction_cpus_to_range
(cpus: List[int])
lxc_autoscale/lxc_utils.py:308
↓ 3 callersMethod_load_main
(self)
tests/test_coverage_boost.py:277
↓ 3 callersMethod_mask
(text: str)
lxc_autoscale/logging_setup.py:53
↓ 3 callersMethod_remove_boost
Remove a single boost record and persist.
lxc_autoscale/boost.py:180
↓ 3 callersMethod_run_sync
Synchronous SSH command execution (called in a thread).
lxc_autoscale/ssh.py:74
↓ 3 callersMethoddetect_manual_change
Check if admin changed the value during boost. Returns True if live config differs from boosted value, meaning an admin modified it v
lxc_autoscale/boost.py:143
↓ 3 callersFunctionget_config_value
Legacy function-level accessor.
lxc_autoscale/config.py:419
↓ 3 callersMethodget_expired
Return list of (resource, record) for expired boosts on a container.
lxc_autoscale/boost.py:134
↓ 3 callersMethodget_ssh_config
Build SSHConfig from flattened legacy fields.
lxc_autoscale/config.py:151
↓ 3 callersMethodpinning_unchanged
Return True if pinning matches last applied state.
lxc_autoscale/state.py:87
↓ 3 callersMethodreset_saturation
Reset saturation counter (after boost applied or revert).
lxc_autoscale/boost.py:73
↓ 3 callersFunctionrun_local_command
(cmd: Union[str, List[str]], timeout: int = 30)
lxc_autoscale/lxc_utils.py:65
↓ 3 callersMethodsend_notification
(self, title, message, priority=5)
tests/test_coverage_final.py:405
↓ 3 callersFunctionshould_scale_in
(metrics, group_config, current_time, last_action_time)
lxc_autoscale/scaling_manager.py:477
↓ 3 callersFunctionvalidate_tier_config
(ctid: str, tier_config: Dict[str, Any])
lxc_autoscale/resource_manager.py:115
↓ 2 callersFunction_apply_env_overrides
Override secrets from environment variables.
lxc_autoscale/config.py:288
↓ 2 callersFunction_check_config_permissions
Warn if the config file is readable by group or others.
lxc_autoscale/config.py:272
↓ 2 callersFunction_current_hour
Return current hour in the configured timezone.
lxc_autoscale/scaling_manager.py:48
↓ 2 callersFunction_get_cpu_line
()
lxc_autoscale/lxc_utils.py:601
↓ 2 callersFunction_get_json_log_path
()
lxc_autoscale/lxc_utils.py:194
↓ 2 callersFunction_get_num_cpus
Get core count — use cache first, fall back to pct config. Never returns 0.
lxc_autoscale/lxc_utils.py:488
↓ 2 callersFunction_get_session
()
lxc_autoscale/notification.py:51
↓ 2 callersFunction_load_main
()
tests/test_coverage_final.py:15
↓ 2 callersFunction_parse_cgroup_v1
(path: str)
lxc_autoscale/lxc_utils.py:554
↓ 2 callersFunction_parse_cgroup_v2
(path: str)
lxc_autoscale/lxc_utils.py:541
↓ 2 callersFunction_safe_path
Resolve symlinks and verify the path stays within allowed_dir.
lxc_autoscale/ui/lxc_autoscale_ui.py:24
↓ 2 callersMethodadopt_manual_change
Admin changed config during boost — adopt as new baseline.
lxc_autoscale/boost.py:155
↓ 2 callersFunctionapply_cpu_pinning
Apply CPU core pinning only if it differs from last applied state.
lxc_autoscale/lxc_utils.py:387
↓ 2 callersFunctioncalculate_dynamic_thresholds
( container_history: List[Dict[str, Any]], )
lxc_autoscale/scaling_manager.py:128
↓ 2 callersFunctioncalculate_group_metrics
(group_lxc: List[str], containers: Dict[str, Dict[str, Any]])
lxc_autoscale/scaling_manager.py:462
↓ 2 callersMethodclone
(self, source: str, target: str, snapname: str = "", hostname: str = "")
lxc_autoscale/backends/api.py:128
↓ 2 callersMethodclose_all
Close all pooled connections.
lxc_autoscale/ssh.py:98
↓ 2 callersFunctioncreate_backend
Factory: create the appropriate backend from config.
lxc_autoscale/backends/__init__.py:9
↓ 2 callersMethodget_container_config
(self, ctid: str)
lxc_autoscale/backends/cli.py:84
↓ 2 callersMethodget_status
(self, ctid: str)
lxc_autoscale/backends/api.py:150
↓ 2 callersMethodis_mem_negative_cached
Check if cgroup memory path discovery should be skipped.
lxc_autoscale/state.py:67
↓ 2 callersMethodis_running
(self, ctid: str)
lxc_autoscale/backends/cli.py:102
↓ 2 callersMethodis_running
(self, ctid: str)
lxc_autoscale/backends/api.py:78
↓ 2 callersMethodlist_containers
(self)
lxc_autoscale/backends/cli.py:73
↓ 2 callersMethodlist_containers
(self)
lxc_autoscale/backends/api.py:60
↓ 2 callersMethodrecord_backup
Record that a backup was written.
lxc_autoscale/state.py:83
↓ 2 callersMethodrecord_pinning
Record that pinning was applied.
lxc_autoscale/state.py:91
↓ 2 callersFunctionresolve_cpu_pinning
(pinning_config: str)
lxc_autoscale/lxc_utils.py:365
next →1–100 of 603, ranked by callers