robusta-cli 0.13.0a1__tar.gz → 1.0a0__tar.gz
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.
- {robusta_cli-0.13.0a1 → robusta_cli-1.0a0}/LICENSE +1 -1
- robusta_cli-1.0a0/PKG-INFO +30 -0
- robusta_cli-1.0a0/README.md +1 -0
- robusta_cli-1.0a0/pyproject.toml +31 -0
- {robusta_cli-0.13.0a1/src/robusta → robusta_cli-1.0a0/robusta_cli}/_version.py +1 -1
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/auth.py +4 -4
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/backend_profile.py +1 -1
- robusta_cli-1.0a0/robusta_cli/demo_alert.py +155 -0
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/eula.py +1 -1
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/integrations_cmd.py +2 -2
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/main.py +28 -148
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/playbooks_cmd.py +1 -1
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/self_host.py +2 -2
- robusta_cli-1.0a0/robusta_cli/simple_sink_config.py +34 -0
- robusta_cli-0.13.0a1/PKG-INFO +0 -60
- robusta_cli-0.13.0a1/pyproject.toml +0 -141
- robusta_cli-0.13.0a1/src/robusta/api/__init__.py +0 -330
- robusta_cli-0.13.0a1/src/robusta/cli/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/discovery/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/discovery/discovery.py +0 -818
- robusta_cli-0.13.0a1/src/robusta/core/discovery/resource_names.py +0 -88
- robusta_cli-0.13.0a1/src/robusta/core/discovery/top_service_resolver.py +0 -76
- robusta_cli-0.13.0a1/src/robusta/core/discovery/utils.py +0 -45
- robusta_cli-0.13.0a1/src/robusta/core/exceptions.py +0 -16
- robusta_cli-0.13.0a1/src/robusta/core/model/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/model/base_params.py +0 -346
- robusta_cli-0.13.0a1/src/robusta/core/model/cluster_status.py +0 -34
- robusta_cli-0.13.0a1/src/robusta/core/model/env_vars.py +0 -121
- robusta_cli-0.13.0a1/src/robusta/core/model/events.py +0 -168
- robusta_cli-0.13.0a1/src/robusta/core/model/helm_release.py +0 -67
- robusta_cli-0.13.0a1/src/robusta/core/model/jobs.py +0 -182
- robusta_cli-0.13.0a1/src/robusta/core/model/k8s_operation_type.py +0 -7
- robusta_cli-0.13.0a1/src/robusta/core/model/namespaces.py +0 -20
- robusta_cli-0.13.0a1/src/robusta/core/model/nodes.py +0 -51
- robusta_cli-0.13.0a1/src/robusta/core/model/pods.py +0 -264
- robusta_cli-0.13.0a1/src/robusta/core/model/runner_config.py +0 -102
- robusta_cli-0.13.0a1/src/robusta/core/model/services.py +0 -127
- robusta_cli-0.13.0a1/src/robusta/core/persistency/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/persistency/in_memory.py +0 -20
- robusta_cli-0.13.0a1/src/robusta/core/persistency/scheduled_jobs_states_dal.py +0 -66
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/actions_registry.py +0 -109
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/base_trigger.py +0 -36
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/common.py +0 -121
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/container_playbook_utils.py +0 -69
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/crash_reporter.py +0 -65
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/generation.py +0 -131
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/internal/discovery_events.py +0 -87
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/job_utils.py +0 -47
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/node_playbook_utils.py +0 -28
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/oom_killer_utils.py +0 -95
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/playbook_utils.py +0 -67
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/playbooks_event_handler.py +0 -76
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/playbooks_event_handler_impl.py +0 -365
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/pod_utils/crashloop_utils.py +0 -62
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/pod_utils/imagepull_utils.py +0 -229
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/pod_utils/pending_pod_utils.py +0 -162
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/prometheus_enrichment_utils.py +0 -542
- robusta_cli-0.13.0a1/src/robusta/core/playbooks/trigger.py +0 -27
- robusta_cli-0.13.0a1/src/robusta/core/pubsub/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/pubsub/event_emitter.py +0 -7
- robusta_cli-0.13.0a1/src/robusta/core/pubsub/event_subscriber.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/pubsub/events_pubsub.py +0 -20
- robusta_cli-0.13.0a1/src/robusta/core/reporting/__init__.py +0 -67
- robusta_cli-0.13.0a1/src/robusta/core/reporting/action_requests.py +0 -57
- robusta_cli-0.13.0a1/src/robusta/core/reporting/base.py +0 -383
- robusta_cli-0.13.0a1/src/robusta/core/reporting/blocks.py +0 -820
- robusta_cli-0.13.0a1/src/robusta/core/reporting/callbacks.py +0 -49
- robusta_cli-0.13.0a1/src/robusta/core/reporting/consts.py +0 -96
- robusta_cli-0.13.0a1/src/robusta/core/reporting/custom_rendering.py +0 -76
- robusta_cli-0.13.0a1/src/robusta/core/reporting/finding_subjects.py +0 -52
- robusta_cli-0.13.0a1/src/robusta/core/reporting/utils.py +0 -46
- robusta_cli-0.13.0a1/src/robusta/core/schedule/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/schedule/model.py +0 -47
- robusta_cli-0.13.0a1/src/robusta/core/schedule/scheduler.py +0 -153
- robusta_cli-0.13.0a1/src/robusta/core/sinks/__init__.py +0 -3
- robusta_cli-0.13.0a1/src/robusta/core/sinks/common/__init__.py +0 -1
- robusta_cli-0.13.0a1/src/robusta/core/sinks/common/channel_transformer.py +0 -106
- robusta_cli-0.13.0a1/src/robusta/core/sinks/common/html_tools.py +0 -108
- robusta_cli-0.13.0a1/src/robusta/core/sinks/datadog/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/datadog/datadog_sink.py +0 -127
- robusta_cli-0.13.0a1/src/robusta/core/sinks/datadog/datadog_sink_params.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/sinks/discord/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/discord/discord_sink.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/core/sinks/discord/discord_sink_params.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/sinks/file/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/file/file_sink.py +0 -33
- robusta_cli-0.13.0a1/src/robusta/core/sinks/file/file_sink_params.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/core/sinks/file/object_traverser.py +0 -90
- robusta_cli-0.13.0a1/src/robusta/core/sinks/google_chat/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/google_chat/google_chat.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/core/sinks/google_chat/google_chat_params.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/core/sinks/jira/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/jira/jira_sink.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/core/sinks/jira/jira_sink_params.py +0 -31
- robusta_cli-0.13.0a1/src/robusta/core/sinks/kafka/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/kafka/kafka_sink.py +0 -80
- robusta_cli-0.13.0a1/src/robusta/core/sinks/kafka/kafka_sink_params.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mail/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mail/mail_sink.py +0 -18
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mail/mail_sink_params.py +0 -27
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mattermost/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mattermost/mattermost_sink.py +0 -26
- robusta_cli-0.13.0a1/src/robusta/core/sinks/mattermost/mattermost_sink_params.py +0 -35
- robusta_cli-0.13.0a1/src/robusta/core/sinks/msteams/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/msteams/msteams_sink.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/core/sinks/msteams/msteams_sink_params.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/sinks/opsgenie/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/opsgenie/opsgenie_sink.py +0 -103
- robusta_cli-0.13.0a1/src/robusta/core/sinks/opsgenie/opsgenie_sink_params.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pagerduty/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pagerduty/pagerduty_sink.py +0 -254
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pagerduty/pagerduty_sink_params.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pushover/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pushover/pushover_client.py +0 -60
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pushover/pushover_sink.py +0 -123
- robusta_cli-0.13.0a1/src/robusta/core/sinks/pushover/pushover_sink_params.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/dal/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/dal/model_conversion.py +0 -203
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/dal/supabase_dal.py +0 -691
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/discovery_metrics.py +0 -30
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/prometheus_health_checker.py +0 -108
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/robusta_sink.py +0 -675
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/robusta_sink_params.py +0 -29
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/account_resource_fetcher.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/base_resource_manager.py +0 -13
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/prometheus_alert_resource_manager.py +0 -202
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/rrm.py +0 -85
- robusta_cli-0.13.0a1/src/robusta/core/sinks/robusta/rrm/types.py +0 -62
- robusta_cli-0.13.0a1/src/robusta/core/sinks/rocketchat/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/rocketchat/rocketchat_sink.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/core/sinks/rocketchat/rocketchat_sink_params.py +0 -27
- robusta_cli-0.13.0a1/src/robusta/core/sinks/servicenow/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/core/sinks/servicenow/servicenow_sink.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/core/sinks/servicenow/servicenow_sink_params.py +0 -24
- robusta_cli-0.13.0a1/src/robusta/core/sinks/sink_base.py +0 -185
- robusta_cli-0.13.0a1/src/robusta/core/sinks/sink_base_params.py +0 -158
- robusta_cli-0.13.0a1/src/robusta/core/sinks/sink_config.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/core/sinks/sink_factory.py +0 -64
- robusta_cli-0.13.0a1/src/robusta/core/sinks/slack/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/slack/slack_sink.py +0 -80
- robusta_cli-0.13.0a1/src/robusta/core/sinks/slack/slack_sink_params.py +0 -32
- robusta_cli-0.13.0a1/src/robusta/core/sinks/telegram/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/telegram/telegram_client.py +0 -47
- robusta_cli-0.13.0a1/src/robusta/core/sinks/telegram/telegram_sink.py +0 -93
- robusta_cli-0.13.0a1/src/robusta/core/sinks/telegram/telegram_sink_params.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/core/sinks/timing.py +0 -67
- robusta_cli-0.13.0a1/src/robusta/core/sinks/transformer.py +0 -262
- robusta_cli-0.13.0a1/src/robusta/core/sinks/victorops/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/victorops/victorops_sink.py +0 -82
- robusta_cli-0.13.0a1/src/robusta/core/sinks/victorops/victorops_sink_params.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webex/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webex/webex_sink.py +0 -20
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webex/webex_sink_params.py +0 -18
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webhook/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webhook/webhook_sink.py +0 -140
- robusta_cli-0.13.0a1/src/robusta/core/sinks/webhook/webhook_sink_params.py +0 -23
- robusta_cli-0.13.0a1/src/robusta/core/sinks/yamessenger/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/yamessenger/yamessenger_client.py +0 -84
- robusta_cli-0.13.0a1/src/robusta/core/sinks/yamessenger/yamessenger_sink.py +0 -96
- robusta_cli-0.13.0a1/src/robusta/core/sinks/yamessenger/yamessenger_sink_params.py +0 -30
- robusta_cli-0.13.0a1/src/robusta/core/sinks/zulip/__init__.py +0 -2
- robusta_cli-0.13.0a1/src/robusta/core/sinks/zulip/zulip_sink.py +0 -32
- robusta_cli-0.13.0a1/src/robusta/core/sinks/zulip/zulip_sink_params.py +0 -28
- robusta_cli-0.13.0a1/src/robusta/core/triggers/container_oom_killed_trigger.py +0 -32
- robusta_cli-0.13.0a1/src/robusta/core/triggers/custom_triggers.py +0 -31
- robusta_cli-0.13.0a1/src/robusta/core/triggers/error_event_trigger.py +0 -150
- robusta_cli-0.13.0a1/src/robusta/core/triggers/helm_releases_triggers.py +0 -176
- robusta_cli-0.13.0a1/src/robusta/core/triggers/job_failed_trigger.py +0 -53
- robusta_cli-0.13.0a1/src/robusta/core/triggers/multi_resources_trigger.py +0 -59
- robusta_cli-0.13.0a1/src/robusta/core/triggers/oom_killed_trigger_base.py +0 -110
- robusta_cli-0.13.0a1/src/robusta/core/triggers/pod_crash_loop_trigger.py +0 -75
- robusta_cli-0.13.0a1/src/robusta/core/triggers/pod_evicted_trigger.py +0 -55
- robusta_cli-0.13.0a1/src/robusta/core/triggers/pod_image_pull_backoff.py +0 -83
- robusta_cli-0.13.0a1/src/robusta/core/triggers/pod_oom_killed_trigger.py +0 -32
- robusta_cli-0.13.0a1/src/robusta/integrations/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/argocd/argocd_client.py +0 -25
- robusta_cli-0.13.0a1/src/robusta/integrations/common/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/common/requests.py +0 -72
- robusta_cli-0.13.0a1/src/robusta/integrations/discord/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/discord/sender.py +0 -300
- robusta_cli-0.13.0a1/src/robusta/integrations/git/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/git/git_repo.py +0 -296
- robusta_cli-0.13.0a1/src/robusta/integrations/git/well_known_hosts.py +0 -16
- robusta_cli-0.13.0a1/src/robusta/integrations/google_chat/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/google_chat/sender.py +0 -143
- robusta_cli-0.13.0a1/src/robusta/integrations/grafana.py +0 -118
- robusta_cli-0.13.0a1/src/robusta/integrations/helper.py +0 -16
- robusta_cli-0.13.0a1/src/robusta/integrations/jira/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/jira/client.py +0 -294
- robusta_cli-0.13.0a1/src/robusta/integrations/jira/sender.py +0 -252
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/api_client_utils.py +0 -288
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/events.py +0 -1219
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/models.py +0 -12
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/triggers.py +0 -2035
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/v1/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/autogenerated/v1/models.py +0 -27
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/base_event.py +0 -33
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/base_triggers.py +0 -282
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/custom_models.py +0 -763
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/model_not_found_exception.py +0 -4
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/process_utils.py +0 -125
- robusta_cli-0.13.0a1/src/robusta/integrations/kubernetes/templates.py +0 -31
- robusta_cli-0.13.0a1/src/robusta/integrations/mail/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/mail/sender.py +0 -109
- robusta_cli-0.13.0a1/src/robusta/integrations/mattermost/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/mattermost/client.py +0 -167
- robusta_cli-0.13.0a1/src/robusta/integrations/mattermost/sender.py +0 -169
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/__init__.py +0 -1
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_adaptive_card_files.py +0 -27
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_adaptive_card_files_image.py +0 -69
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_adaptive_card_files_text.py +0 -170
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_action.py +0 -28
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_base.py +0 -6
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_card.py +0 -20
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_column.py +0 -38
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_container.py +0 -24
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_images.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_table.py +0 -24
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_elements/msteams_text_block.py +0 -74
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_mark_down_fix_url.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/msteams_msg.py +0 -184
- robusta_cli-0.13.0a1/src/robusta/integrations/msteams/sender.py +0 -66
- robusta_cli-0.13.0a1/src/robusta/integrations/openshift/__init__.py +0 -1
- robusta_cli-0.13.0a1/src/robusta/integrations/openshift/token.py +0 -17
- robusta_cli-0.13.0a1/src/robusta/integrations/prometheus/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/prometheus/models.py +0 -235
- robusta_cli-0.13.0a1/src/robusta/integrations/prometheus/trigger.py +0 -207
- robusta_cli-0.13.0a1/src/robusta/integrations/prometheus/utils.py +0 -178
- robusta_cli-0.13.0a1/src/robusta/integrations/receiver.py +0 -346
- robusta_cli-0.13.0a1/src/robusta/integrations/resource_analysis/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/resource_analysis/cpu_analyzer.py +0 -28
- robusta_cli-0.13.0a1/src/robusta/integrations/resource_analysis/memory_analyzer.py +0 -138
- robusta_cli-0.13.0a1/src/robusta/integrations/resource_analysis/node_cpu_analyzer.py +0 -96
- robusta_cli-0.13.0a1/src/robusta/integrations/resource_analysis/prometheus_analyzer.py +0 -49
- robusta_cli-0.13.0a1/src/robusta/integrations/rocketchat/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/rocketchat/sender.py +0 -371
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/event.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/models.py +0 -7
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/playbook_scheduler.py +0 -19
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/playbook_scheduler_manager.py +0 -10
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/playbook_scheduler_manager_impl.py +0 -127
- robusta_cli-0.13.0a1/src/robusta/integrations/scheduled/trigger.py +0 -55
- robusta_cli-0.13.0a1/src/robusta/integrations/servicenow/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/servicenow/sender.py +0 -138
- robusta_cli-0.13.0a1/src/robusta/integrations/slack/__init__.py +0 -1
- robusta_cli-0.13.0a1/src/robusta/integrations/slack/sender.py +0 -519
- robusta_cli-0.13.0a1/src/robusta/integrations/webex/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/integrations/webex/sender.py +0 -193
- robusta_cli-0.13.0a1/src/robusta/integrations/zulip/__init__.py +0 -1
- robusta_cli-0.13.0a1/src/robusta/integrations/zulip/sender.py +0 -171
- robusta_cli-0.13.0a1/src/robusta/model/alert_relabel_config.py +0 -14
- robusta_cli-0.13.0a1/src/robusta/model/config.py +0 -223
- robusta_cli-0.13.0a1/src/robusta/model/playbook_action.py +0 -23
- robusta_cli-0.13.0a1/src/robusta/model/playbook_definition.py +0 -44
- robusta_cli-0.13.0a1/src/robusta/patch/patch.py +0 -167
- robusta_cli-0.13.0a1/src/robusta/runner/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/runner/config_loader.py +0 -286
- robusta_cli-0.13.0a1/src/robusta/runner/log_init.py +0 -21
- robusta_cli-0.13.0a1/src/robusta/runner/main.py +0 -53
- robusta_cli-0.13.0a1/src/robusta/runner/not_found_exception.py +0 -5
- robusta_cli-0.13.0a1/src/robusta/runner/object_updater.py +0 -14
- robusta_cli-0.13.0a1/src/robusta/runner/process_setup.py +0 -21
- robusta_cli-0.13.0a1/src/robusta/runner/ssl_utils.py +0 -40
- robusta_cli-0.13.0a1/src/robusta/runner/telemetry.py +0 -21
- robusta_cli-0.13.0a1/src/robusta/runner/telemetry_service.py +0 -64
- robusta_cli-0.13.0a1/src/robusta/runner/web.py +0 -166
- robusta_cli-0.13.0a1/src/robusta/runner/web_api.py +0 -84
- robusta_cli-0.13.0a1/src/robusta/utils/__init__.py +0 -0
- robusta_cli-0.13.0a1/src/robusta/utils/auth_provider.py +0 -54
- robusta_cli-0.13.0a1/src/robusta/utils/base64_utils.py +0 -9
- robusta_cli-0.13.0a1/src/robusta/utils/cluster_provider_discovery.py +0 -111
- robusta_cli-0.13.0a1/src/robusta/utils/common.py +0 -43
- robusta_cli-0.13.0a1/src/robusta/utils/decorators.py +0 -22
- robusta_cli-0.13.0a1/src/robusta/utils/docs.py +0 -52
- robusta_cli-0.13.0a1/src/robusta/utils/documented_pydantic.py +0 -61
- robusta_cli-0.13.0a1/src/robusta/utils/error_codes.py +0 -41
- robusta_cli-0.13.0a1/src/robusta/utils/file_system_watcher.py +0 -49
- robusta_cli-0.13.0a1/src/robusta/utils/function_hashes.py +0 -24
- robusta_cli-0.13.0a1/src/robusta/utils/json_schema.py +0 -162
- robusta_cli-0.13.0a1/src/robusta/utils/parsing.py +0 -23
- robusta_cli-0.13.0a1/src/robusta/utils/rate_limiter.py +0 -29
- robusta_cli-0.13.0a1/src/robusta/utils/scope.py +0 -95
- robusta_cli-0.13.0a1/src/robusta/utils/server_start.py +0 -15
- robusta_cli-0.13.0a1/src/robusta/utils/service_discovery.py +0 -25
- robusta_cli-0.13.0a1/src/robusta/utils/silence_utils.py +0 -170
- robusta_cli-0.13.0a1/src/robusta/utils/stack_tracer.py +0 -25
- robusta_cli-0.13.0a1/src/robusta/utils/task_queue.py +0 -73
- {robusta_cli-0.13.0a1/src/robusta → robusta_cli-1.0a0/robusta_cli}/__init__.py +0 -0
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/slack_feedback_message.py +0 -0
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/slack_verification.py +0 -0
- {robusta_cli-0.13.0a1/src/robusta/cli → robusta_cli-1.0a0/robusta_cli}/utils.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: robusta-cli
|
|
3
|
+
Version: 1.0a0
|
|
4
|
+
Summary:
|
|
5
|
+
Author: Natan Yellin
|
|
6
|
+
Author-email: aantn@users.noreply.github.com
|
|
7
|
+
Requires-Python: >=3.8,<3.13
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Requires-Dist: certifi (>=2024.2.2,<2025.0.0)
|
|
15
|
+
Requires-Dist: click-spinner (>=0.1.10,<0.2.0)
|
|
16
|
+
Requires-Dist: cryptography (>=42.0.7,<43.0.0)
|
|
17
|
+
Requires-Dist: dpath (>=2.0.5,<3.0.0)
|
|
18
|
+
Requires-Dist: hikaru-model-28 (>=1.1.0,<2.0.0)
|
|
19
|
+
Requires-Dist: kubernetes (>=29,<30)
|
|
20
|
+
Requires-Dist: pydantic (>=1.0,<2.0)
|
|
21
|
+
Requires-Dist: pyjwt (>=2.4.0,<3.0.0)
|
|
22
|
+
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
23
|
+
Requires-Dist: requests (>=2.32.2,<3.0.0)
|
|
24
|
+
Requires-Dist: slack-sdk (>=3,<4)
|
|
25
|
+
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
26
|
+
Requires-Dist: typer (>=0.12.3,<0.13.0)
|
|
27
|
+
Requires-Dist: types-toml (>=0.10.2,<0.11.0)
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# robusta-cli
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# robusta-cli
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "robusta-cli"
|
|
3
|
+
version = "1.0-alpha"
|
|
4
|
+
description = ""
|
|
5
|
+
authors = ["Natan Yellin <aantn@users.noreply.github.com>"]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
|
|
8
|
+
[tool.poetry.scripts]
|
|
9
|
+
robusta = "robusta_cli.main:app"
|
|
10
|
+
|
|
11
|
+
[tool.poetry.dependencies]
|
|
12
|
+
python = "^3.8, <3.13"
|
|
13
|
+
typer = "^0.12.3"
|
|
14
|
+
pyyaml = "^6.0.1"
|
|
15
|
+
click-spinner = "^0.1.10"
|
|
16
|
+
cryptography = "^42.0.7"
|
|
17
|
+
dpath = "^2.0.5"
|
|
18
|
+
pydantic = "^1.0"
|
|
19
|
+
slack-sdk = "^3"
|
|
20
|
+
pyjwt = "^2.4.0"
|
|
21
|
+
requests = "^2.32.2"
|
|
22
|
+
certifi = "^2024.2.2"
|
|
23
|
+
types-toml = "^0.10.2"
|
|
24
|
+
toml = "^0.10.2"
|
|
25
|
+
hikaru-model-28 = "^1.1.0"
|
|
26
|
+
kubernetes = "^29"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["poetry-core"]
|
|
31
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# this is updated by .github/workflows/release.yaml
|
|
2
|
-
__version__ = "
|
|
2
|
+
__version__ = "1.0-alpha"
|
|
@@ -14,9 +14,9 @@ from cryptography.hazmat.primitives.serialization import Encoding, NoEncryption,
|
|
|
14
14
|
from dpath.util import get
|
|
15
15
|
from pydantic import BaseModel
|
|
16
16
|
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
17
|
+
from robusta_cli.backend_profile import backend_profile
|
|
18
|
+
from robusta_cli.playbooks_cmd import NAMESPACE_EXPLANATION, get_playbooks_config
|
|
19
|
+
from robusta_cli.utils import exec_in_robusta_runner_output, namespace_to_kubectl
|
|
20
20
|
|
|
21
21
|
AUTH_SECRET_NAME = "robusta-auth-config-secret"
|
|
22
22
|
app = typer.Typer(add_completion=False)
|
|
@@ -86,7 +86,7 @@ def _get_signing_key_from_env_variable(namespace: Optional[str], env_var_name: s
|
|
|
86
86
|
return str(exec_in_robusta_runner_output(f'echo "${env_var_name}"', namespace), "utf-8").strip()
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
@app.command(name="web-connect")
|
|
89
|
+
@app.command(name="web-connect") # TODO consider removing this
|
|
90
90
|
@app.command()
|
|
91
91
|
def gen_token(
|
|
92
92
|
account_id: str = typer.Option(
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import random
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from hikaru.model.rel_1_28 import Container, Job, JobSpec, ObjectMeta, PodSpec, PodTemplateSpec, SecurityContext
|
|
6
|
+
from kubernetes import client, config
|
|
7
|
+
|
|
8
|
+
from kubernetes.client import V1ServiceList
|
|
9
|
+
from kubernetes.client.models.v1_service import V1Service
|
|
10
|
+
|
|
11
|
+
import logging
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AlertManagerDiscovery:
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def find_service_url(label_selector):
|
|
18
|
+
"""
|
|
19
|
+
Get the url of an in-cluster service with a specific label
|
|
20
|
+
"""
|
|
21
|
+
# we do it this way because there is a weird issue with hikaru's ServiceList.listServiceForAllNamespaces()
|
|
22
|
+
v1 = client.CoreV1Api()
|
|
23
|
+
svc_list: V1ServiceList = v1.list_service_for_all_namespaces(label_selector=label_selector)
|
|
24
|
+
if not svc_list.items:
|
|
25
|
+
return None
|
|
26
|
+
svc: V1Service = svc_list.items[0]
|
|
27
|
+
name = svc.metadata.name
|
|
28
|
+
namespace = svc.metadata.namespace
|
|
29
|
+
port = svc.spec.ports[0].port
|
|
30
|
+
cluster_domain = 'cluster.local'
|
|
31
|
+
url = f"http://{name}.{namespace}.svc.{cluster_domain}:{port}"
|
|
32
|
+
logging.info(f"discovered service with label-selector: `{label_selector}` at url: `{url}`")
|
|
33
|
+
return url
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def find_url(selectors: List[str], error_msg: str) -> Optional[str]:
|
|
37
|
+
"""
|
|
38
|
+
Try to autodiscover the url of an in-cluster service
|
|
39
|
+
"""
|
|
40
|
+
for label_selector in selectors:
|
|
41
|
+
service_url = AlertManagerDiscovery.find_service_url(label_selector)
|
|
42
|
+
if service_url:
|
|
43
|
+
return service_url
|
|
44
|
+
|
|
45
|
+
logging.debug(error_msg)
|
|
46
|
+
return None
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
def find_alert_manager_url() -> Optional[str]:
|
|
50
|
+
return AlertManagerDiscovery.find_url(
|
|
51
|
+
selectors=[
|
|
52
|
+
"app=kube-prometheus-stack-alertmanager",
|
|
53
|
+
"app=prometheus,component=alertmanager",
|
|
54
|
+
"app=prometheus-operator-alertmanager",
|
|
55
|
+
"app=alertmanager",
|
|
56
|
+
"app=rancher-monitoring-alertmanager",
|
|
57
|
+
"app=prometheus-alertmanager",
|
|
58
|
+
"operated-alertmanager=true",
|
|
59
|
+
"app.kubernetes.io/name=alertmanager",
|
|
60
|
+
"app.kubernetes.io/name=vmalertmanager",
|
|
61
|
+
],
|
|
62
|
+
error_msg="Alert manager url could not be found. Add 'alertmanager_url' under global_config",
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class AlertManagerException(Exception):
|
|
67
|
+
def __init__(self, message: str):
|
|
68
|
+
super().__init__(message)
|
|
69
|
+
self.message = message
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def create_demo_alert(
|
|
73
|
+
alertmanager_url: str,
|
|
74
|
+
namespaces: List[str],
|
|
75
|
+
alert: str,
|
|
76
|
+
labels: str,
|
|
77
|
+
kube_config: str,
|
|
78
|
+
image: str
|
|
79
|
+
):
|
|
80
|
+
config.load_kube_config(kube_config)
|
|
81
|
+
if not alertmanager_url:
|
|
82
|
+
# search cluster alertmanager by known alertmanager labels
|
|
83
|
+
alertmanager_url = AlertManagerDiscovery.find_alert_manager_url()
|
|
84
|
+
if not alertmanager_url:
|
|
85
|
+
raise AlertManagerException("Alertmanager service could not be auto-discovered. Please use the --alertmanager-url parameter")
|
|
86
|
+
|
|
87
|
+
pod = None
|
|
88
|
+
for namespace in namespaces:
|
|
89
|
+
pods = client.CoreV1Api().list_namespaced_pod(namespace)
|
|
90
|
+
if pods.items:
|
|
91
|
+
pod = pods.items[0]
|
|
92
|
+
break
|
|
93
|
+
|
|
94
|
+
if not pod:
|
|
95
|
+
raise AlertManagerException(f"Could not find any pod on namespace {namespaces}. Please use the --namespaces parameter to specify a namespace with pods")
|
|
96
|
+
|
|
97
|
+
alert_labels = {
|
|
98
|
+
"alertname": alert,
|
|
99
|
+
"severity": "critical",
|
|
100
|
+
"pod": pod.metadata.name,
|
|
101
|
+
"namespace": pod.metadata.namespace,
|
|
102
|
+
}
|
|
103
|
+
if labels:
|
|
104
|
+
for label in labels.split(","):
|
|
105
|
+
label_key = label.split("=")[0].strip()
|
|
106
|
+
label_value = label.split("=")[1].strip()
|
|
107
|
+
alert_labels[label_key] = label_value
|
|
108
|
+
|
|
109
|
+
demo_alerts = [
|
|
110
|
+
{
|
|
111
|
+
"status": "firing",
|
|
112
|
+
"labels": alert_labels,
|
|
113
|
+
"annotations": {
|
|
114
|
+
"summary": "This is a demo alert manager alert created by Robusta",
|
|
115
|
+
"description": "Nothing wrong here. This alert will be resolved soon",
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
command = [
|
|
121
|
+
"curl",
|
|
122
|
+
"-X",
|
|
123
|
+
"POST",
|
|
124
|
+
f"{alertmanager_url}/api/v1/alerts",
|
|
125
|
+
"-H",
|
|
126
|
+
"Content-Type: application/json",
|
|
127
|
+
"-d",
|
|
128
|
+
f"{json.dumps(demo_alerts)}",
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
job: Job = Job(
|
|
132
|
+
metadata=ObjectMeta(
|
|
133
|
+
name=f"alert-job-{random.randint(0, 10000)}",
|
|
134
|
+
namespace=pod.metadata.namespace,
|
|
135
|
+
),
|
|
136
|
+
spec=JobSpec(
|
|
137
|
+
template=PodTemplateSpec(
|
|
138
|
+
spec=PodSpec(
|
|
139
|
+
containers=[
|
|
140
|
+
Container(
|
|
141
|
+
name="alert-curl",
|
|
142
|
+
image=image,
|
|
143
|
+
command=command,
|
|
144
|
+
securityContext=SecurityContext(runAsUser=2000),
|
|
145
|
+
)
|
|
146
|
+
],
|
|
147
|
+
restartPolicy="Never",
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
completions=1,
|
|
151
|
+
ttlSecondsAfterFinished=0, # delete immediately when finished
|
|
152
|
+
),
|
|
153
|
+
)
|
|
154
|
+
job.create()
|
|
155
|
+
return pod.metadata.name, pod.metadata.namespace
|
|
@@ -9,8 +9,8 @@ from typing import Tuple
|
|
|
9
9
|
import requests
|
|
10
10
|
import typer
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from robusta_cli.backend_profile import backend_profile
|
|
13
|
+
from robusta_cli.utils import log_title
|
|
14
14
|
|
|
15
15
|
app = typer.Typer(add_completion=False)
|
|
16
16
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import base64
|
|
2
2
|
import json
|
|
3
3
|
import os
|
|
4
|
-
import random
|
|
5
4
|
import subprocess
|
|
6
5
|
import time
|
|
7
6
|
import traceback
|
|
@@ -11,28 +10,27 @@ from typing import Dict, List, Optional, Union
|
|
|
11
10
|
import certifi
|
|
12
11
|
import typer
|
|
13
12
|
import yaml
|
|
14
|
-
|
|
15
|
-
from kubernetes import client, config
|
|
13
|
+
|
|
16
14
|
from pydantic import BaseModel, Extra
|
|
17
15
|
|
|
18
|
-
from
|
|
19
|
-
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
16
|
+
from robusta_cli._version import __version__
|
|
17
|
+
|
|
18
|
+
from robusta_cli.auth import app as auth_commands
|
|
19
|
+
from robusta_cli.backend_profile import backend_profile
|
|
20
|
+
from robusta_cli.eula import handle_eula
|
|
21
|
+
from robusta_cli.integrations_cmd import app as integrations_commands
|
|
22
|
+
from robusta_cli.integrations_cmd import get_slack_key, get_ui_key
|
|
23
|
+
from robusta_cli.playbooks_cmd import app as playbooks_commands
|
|
24
|
+
from robusta_cli.self_host import app as self_host_commands
|
|
25
|
+
from robusta_cli.slack_feedback_message import SlackFeedbackMessagesSender
|
|
26
|
+
from robusta_cli.slack_verification import verify_slack_channel
|
|
27
|
+
from robusta_cli.utils import get_runner_pod, log_title, namespace_to_kubectl
|
|
28
|
+
from robusta_cli.simple_sink_config import MsTeamsSinkConfigWrapper, MsTeamsSinkParams
|
|
29
|
+
from robusta_cli.simple_sink_config import RobustaSinkConfigWrapper, RobustaSinkParams
|
|
30
|
+
from robusta_cli.simple_sink_config import SlackSinkConfigWrapper, SlackSinkParams
|
|
31
|
+
from robusta_cli.demo_alert import create_demo_alert, AlertManagerException
|
|
33
32
|
|
|
34
33
|
ADDITIONAL_CERTIFICATE: str = os.environ.get("CERTIFICATE", "")
|
|
35
|
-
# TODO - separate shared classes to a separated shared repo, to remove dependencies between the cli and runner
|
|
36
34
|
|
|
37
35
|
|
|
38
36
|
def cert_already_exists(new_cert: bytes) -> bool:
|
|
@@ -63,12 +61,6 @@ app.add_typer(auth_commands, name="auth", help="Authentication commands menu")
|
|
|
63
61
|
app.add_typer(self_host_commands, name="self-host", help="Self-host commands menu")
|
|
64
62
|
|
|
65
63
|
|
|
66
|
-
def get_runner_url(runner_version=None):
|
|
67
|
-
if runner_version is None:
|
|
68
|
-
runner_version = __version__
|
|
69
|
-
return f"https://gist.githubusercontent.com/robusta-lab/6b809d508dfc3d8d92afc92c7bbbe88e/raw/robusta-{runner_version}.yaml"
|
|
70
|
-
|
|
71
|
-
|
|
72
64
|
class GlobalConfig(BaseModel):
|
|
73
65
|
signing_key: str = ""
|
|
74
66
|
account_id: str = ""
|
|
@@ -77,8 +69,8 @@ class GlobalConfig(BaseModel):
|
|
|
77
69
|
class HelmValues(BaseModel, extra=Extra.allow):
|
|
78
70
|
globalConfig: GlobalConfig
|
|
79
71
|
sinksConfig: List[Union[SlackSinkConfigWrapper, RobustaSinkConfigWrapper, MsTeamsSinkConfigWrapper]]
|
|
80
|
-
clusterName: Optional[str]
|
|
81
|
-
isSmallCluster: Optional[bool]
|
|
72
|
+
clusterName: Optional[str] = None
|
|
73
|
+
isSmallCluster: Optional[bool] = None
|
|
82
74
|
enablePrometheusStack: bool = False
|
|
83
75
|
disableCloudRouting: bool = False
|
|
84
76
|
enablePlatformPlaybooks: bool = False
|
|
@@ -309,43 +301,11 @@ def gen_config(
|
|
|
309
301
|
typer.secho(slack_feedback_heads_up_message)
|
|
310
302
|
|
|
311
303
|
|
|
312
|
-
@app.command()
|
|
313
|
-
def update_config(
|
|
314
|
-
existing_values: str = typer.Option(
|
|
315
|
-
...,
|
|
316
|
-
help="Existing values.yaml file name. You can run `helm get values` to get it from the cluster.",
|
|
317
|
-
),
|
|
318
|
-
):
|
|
319
|
-
"""
|
|
320
|
-
Update an existing values.yaml file.
|
|
321
|
-
Add RSA key-pair if it doesn't exist
|
|
322
|
-
Add a signing key if it doesn't exist, or replace with a valid one if the key has an invalid format
|
|
323
|
-
"""
|
|
324
|
-
with open(existing_values, "r") as existing_values_file:
|
|
325
|
-
values: HelmValues = HelmValues(**yaml.safe_load(existing_values_file))
|
|
326
|
-
|
|
327
|
-
if not values.globalConfig.signing_key:
|
|
328
|
-
typer.secho("Generating signing key", fg="green")
|
|
329
|
-
values.globalConfig.signing_key = str(uuid.uuid4())
|
|
330
|
-
|
|
331
|
-
try:
|
|
332
|
-
uuid.UUID(values.globalConfig.signing_key)
|
|
333
|
-
except ValueError:
|
|
334
|
-
typer.secho("Invalid signing key. Generating a new one", fg="green")
|
|
335
|
-
values.globalConfig.signing_key = str(uuid.uuid4())
|
|
336
|
-
|
|
337
|
-
write_values_file("updated_values.yaml", values)
|
|
338
|
-
typer.secho(
|
|
339
|
-
"Run `helm upgrade robusta robusta/robusta -f ./updated_values.yaml`",
|
|
340
|
-
fg="green",
|
|
341
|
-
)
|
|
342
|
-
|
|
343
|
-
|
|
344
304
|
@app.command()
|
|
345
305
|
def version():
|
|
346
306
|
"""Show the version of the local robusta-cli"""
|
|
347
307
|
if __version__ == "0.0.0":
|
|
348
|
-
typer.echo("running with development version from git")
|
|
308
|
+
typer.echo("running with development version from git (0.0.0)")
|
|
349
309
|
else:
|
|
350
310
|
typer.echo(f"version {__version__}")
|
|
351
311
|
|
|
@@ -421,96 +381,16 @@ def demo_alert(
|
|
|
421
381
|
Create a demo alert on AlertManager.
|
|
422
382
|
The alert pod is selected randomly from the pods in the current namespace
|
|
423
383
|
"""
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
# search cluster alertmanager by known alertmanager labels
|
|
427
|
-
alertmanager_url = AlertManagerDiscovery.find_alert_manager_url()
|
|
428
|
-
if not alertmanager_url:
|
|
429
|
-
typer.secho(
|
|
430
|
-
"Alertmanager service could not be auto-discovered. " "Please use the --alertmanager-url parameter",
|
|
431
|
-
fg="red",
|
|
432
|
-
)
|
|
433
|
-
return
|
|
434
|
-
|
|
435
|
-
pod = None
|
|
436
|
-
for namespace in namespaces:
|
|
437
|
-
pods = client.CoreV1Api().list_namespaced_pod(namespace)
|
|
438
|
-
if pods.items:
|
|
439
|
-
pod = pods.items[0]
|
|
440
|
-
break
|
|
441
|
-
|
|
442
|
-
if not pod:
|
|
384
|
+
try:
|
|
385
|
+
pod_name, namespace = create_demo_alert(alertmanager_url, namespaces, alert, labels, kube_config, image)
|
|
443
386
|
typer.secho(
|
|
444
|
-
f"
|
|
445
|
-
f"
|
|
446
|
-
fg="
|
|
387
|
+
f"Created Alertmanager alert: alert-name: {alert} pod: {pod_name} "
|
|
388
|
+
f"namespace: {namespace}",
|
|
389
|
+
fg="green",
|
|
447
390
|
)
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
"alertname": alert,
|
|
452
|
-
"severity": "critical",
|
|
453
|
-
"pod": pod.metadata.name,
|
|
454
|
-
"namespace": pod.metadata.namespace,
|
|
455
|
-
}
|
|
456
|
-
if labels:
|
|
457
|
-
for label in labels.split(","):
|
|
458
|
-
label_key = label.split("=")[0].strip()
|
|
459
|
-
label_value = label.split("=")[1].strip()
|
|
460
|
-
alert_labels[label_key] = label_value
|
|
461
|
-
|
|
462
|
-
demo_alerts = [
|
|
463
|
-
{
|
|
464
|
-
"status": "firing",
|
|
465
|
-
"labels": alert_labels,
|
|
466
|
-
"annotations": {
|
|
467
|
-
"summary": "This is a demo alert manager alert created by Robusta",
|
|
468
|
-
"description": "Nothing wrong here. This alert will be resolved soon",
|
|
469
|
-
},
|
|
470
|
-
}
|
|
471
|
-
]
|
|
472
|
-
|
|
473
|
-
command = [
|
|
474
|
-
"curl",
|
|
475
|
-
"-X",
|
|
476
|
-
"POST",
|
|
477
|
-
f"{alertmanager_url}/api/v1/alerts",
|
|
478
|
-
"-H",
|
|
479
|
-
"Content-Type: application/json",
|
|
480
|
-
"-d",
|
|
481
|
-
f"{json.dumps(demo_alerts)}",
|
|
482
|
-
]
|
|
483
|
-
|
|
484
|
-
job: Job = Job(
|
|
485
|
-
metadata=ObjectMeta(
|
|
486
|
-
name=f"alert-job-{random.randint(0, 10000)}",
|
|
487
|
-
namespace=pod.metadata.namespace,
|
|
488
|
-
),
|
|
489
|
-
spec=JobSpec(
|
|
490
|
-
template=PodTemplateSpec(
|
|
491
|
-
spec=PodSpec(
|
|
492
|
-
containers=[
|
|
493
|
-
Container(
|
|
494
|
-
name="alert-curl",
|
|
495
|
-
image=image,
|
|
496
|
-
command=command,
|
|
497
|
-
securityContext=SecurityContext(runAsUser=2000),
|
|
498
|
-
)
|
|
499
|
-
],
|
|
500
|
-
restartPolicy="Never",
|
|
501
|
-
),
|
|
502
|
-
),
|
|
503
|
-
completions=1,
|
|
504
|
-
ttlSecondsAfterFinished=0, # delete immediately when finished
|
|
505
|
-
),
|
|
506
|
-
)
|
|
507
|
-
job.create()
|
|
508
|
-
typer.secho(
|
|
509
|
-
f"Created Alertmanager alert: alert-name: {alert} pod: {pod.metadata.name} "
|
|
510
|
-
f"namespace: {pod.metadata.namespace}",
|
|
511
|
-
fg="green",
|
|
512
|
-
)
|
|
513
|
-
typer.echo("\n")
|
|
391
|
+
typer.echo("\n")
|
|
392
|
+
except AlertManagerException as e:
|
|
393
|
+
typer.secho(e.message, fg="red")
|
|
514
394
|
|
|
515
395
|
|
|
516
396
|
if __name__ == "__main__":
|
|
@@ -9,8 +9,8 @@ import typer
|
|
|
9
9
|
import yaml
|
|
10
10
|
from pydantic import BaseModel
|
|
11
11
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
12
|
+
from robusta_cli.backend_profile import BackendProfile
|
|
13
|
+
from robusta_cli.utils import host_for_params
|
|
14
14
|
|
|
15
15
|
ISSUER: str = "supabase"
|
|
16
16
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
|
|
3
|
+
# from robusta.core.sinks.msteams.msteams_sink_params import MsTeamsSinkConfigWrapper, MsTeamsSinkParams
|
|
4
|
+
# from robusta.core.sinks.robusta.robusta_sink_params import RobustaSinkConfigWrapper, RobustaSinkParams
|
|
5
|
+
# from robusta.core.sinks.slack.slack_sink_params import SlackSinkConfigWrapper, SlackSinkParams
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SinkBaseParams(BaseModel):
|
|
9
|
+
name: str
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class SlackSinkParams(SinkBaseParams):
|
|
13
|
+
slack_channel: str
|
|
14
|
+
api_key: str
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SlackSinkConfigWrapper(BaseModel):
|
|
18
|
+
slack_sink: SlackSinkParams
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class MsTeamsSinkParams(SinkBaseParams):
|
|
22
|
+
webhook_url: str
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MsTeamsSinkConfigWrapper(BaseModel):
|
|
26
|
+
ms_teams_sink: MsTeamsSinkParams
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class RobustaSinkParams(SinkBaseParams):
|
|
30
|
+
token: str
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class RobustaSinkConfigWrapper(BaseModel):
|
|
34
|
+
robusta_sink: RobustaSinkParams
|
robusta_cli-0.13.0a1/PKG-INFO
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: robusta-cli
|
|
3
|
-
Version: 0.13.0a1
|
|
4
|
-
Summary:
|
|
5
|
-
Author: Natan Yellin
|
|
6
|
-
Author-email: aantn@users.noreply.github.com
|
|
7
|
-
Requires-Python: >=3.8,<3.11
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
-
Provides-Extra: all
|
|
13
|
-
Requires-Dist: CairoSVG (>=2.5.2,<3.0.0) ; extra == "all"
|
|
14
|
-
Requires-Dist: Flask (>=3.0.0,<4.0.0) ; extra == "all"
|
|
15
|
-
Requires-Dist: PyJWT (==2.4.0)
|
|
16
|
-
Requires-Dist: apprise (>=1.5.0,<2.0.0)
|
|
17
|
-
Requires-Dist: attrs (>=23.1.0,<24.0.0)
|
|
18
|
-
Requires-Dist: better-exceptions (>=0.3.3,<0.4.0) ; extra == "all"
|
|
19
|
-
Requires-Dist: bitmath (>=1.3.3.1,<2.0.0.0)
|
|
20
|
-
Requires-Dist: boto3 (==1.28.72)
|
|
21
|
-
Requires-Dist: botocore (==1.31.72)
|
|
22
|
-
Requires-Dist: click-spinner (>=0.1.10,<0.2.0)
|
|
23
|
-
Requires-Dist: colorlog (>=5.0.1,<6.0.0)
|
|
24
|
-
Requires-Dist: croniter (>=1.3.15,<2.0.0)
|
|
25
|
-
Requires-Dist: cryptography (>=42.0.5,<43.0.0)
|
|
26
|
-
Requires-Dist: datadog-api-client (>=1.2.0,<2.0.0) ; extra == "all"
|
|
27
|
-
Requires-Dist: docutils (==0.19)
|
|
28
|
-
Requires-Dist: dpath (>=2.0.5,<3.0.0)
|
|
29
|
-
Requires-Dist: dulwich (==0.20.28) ; extra == "all"
|
|
30
|
-
Requires-Dist: fpdf2 (>=2.7.1,<3.0.0)
|
|
31
|
-
Requires-Dist: grafana-api (>=1.0.3,<2.0.0) ; extra == "all"
|
|
32
|
-
Requires-Dist: hikaru-model-26 (>=1.1.1,<2.0.0)
|
|
33
|
-
Requires-Dist: humanize (>=3.13.1,<4.0.0)
|
|
34
|
-
Requires-Dist: idna (>=3.7)
|
|
35
|
-
Requires-Dist: jinja2 (>=3.1.4)
|
|
36
|
-
Requires-Dist: kafka-python (>=2.0.2,<3.0.0) ; extra == "all"
|
|
37
|
-
Requires-Dist: kubernetes (>=26.1.0,<27.0.0)
|
|
38
|
-
Requires-Dist: markdown2 (>=2.4.2,<3.0.0)
|
|
39
|
-
Requires-Dist: opsgenie-sdk (>=2.1.5,<3.0.0)
|
|
40
|
-
Requires-Dist: poetry-core (==1.1.0a7) ; extra == "all"
|
|
41
|
-
Requires-Dist: prometheus-client (>=0.12.0,<0.13.0)
|
|
42
|
-
Requires-Dist: prometrix (==0.1.16)
|
|
43
|
-
Requires-Dist: pydantic (>=1.8.1,<2.0.0)
|
|
44
|
-
Requires-Dist: pydash (==8.0.0)
|
|
45
|
-
Requires-Dist: pymsteams (>=0.1.16,<0.2.0)
|
|
46
|
-
Requires-Dist: pytz (>=2021.3,<2022.0)
|
|
47
|
-
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
48
|
-
Requires-Dist: rocketchat-api (>=1.30.0,<2.0.0)
|
|
49
|
-
Requires-Dist: sentry-sdk (>=1.5.2,<2.0.0) ; extra == "all"
|
|
50
|
-
Requires-Dist: setuptools (>=68.2.2,<69.0.0)
|
|
51
|
-
Requires-Dist: slack-sdk (>=3.23.0,<4.0.0)
|
|
52
|
-
Requires-Dist: supabase (>=2.4,<3.0) ; extra == "all"
|
|
53
|
-
Requires-Dist: tabulate (>=0.8.10,<0.9.0) ; extra == "all"
|
|
54
|
-
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
55
|
-
Requires-Dist: typer (>=0.4.1,<0.5.0)
|
|
56
|
-
Requires-Dist: watchdog (>=2.1.0,<3.0.0) ; extra == "all"
|
|
57
|
-
Requires-Dist: watchgod (>=0.7,<0.8)
|
|
58
|
-
Requires-Dist: webexteamssdk (>=1.6.1,<2.0.0)
|
|
59
|
-
Requires-Dist: websocket-client (==1.3.3)
|
|
60
|
-
Requires-Dist: werkzeug (>=3.0.3)
|