cloud-governance 1.1.351__tar.gz → 1.1.353__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.
- {cloud_governance-1.1.351/cloud_governance.egg-info → cloud_governance-1.1.353}/PKG-INFO +1 -1
- cloud_governance-1.1.353/cloud_governance/common/mails/postfix.py +213 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/utils/configs.py +1 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/tag_non_cluster_resources.py +39 -19
- {cloud_governance-1.1.351 → cloud_governance-1.1.353/cloud_governance.egg-info}/PKG-INFO +1 -1
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/setup.py +1 -1
- cloud_governance-1.1.351/cloud_governance/common/mails/postfix.py +0 -176
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/LICENSE +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/MANIFEST.in +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/README.md +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/aws_monitor_tickets.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/aws_tagging_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/collect_cro_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/cost_over_usage.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/monitor_cro_instances.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/run_cro.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/aws/ec2/tag_cro_instances.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/abstract_resource.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_monitor_tickets.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/azure_tagging_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/collect_cro_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/cost_over_usage.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/monitor_cro_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/azure/resource_groups/tag_cro_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/common/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/common/abstract_collect_cro_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/common/abstract_cost_over_usage.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/clouds/common/abstract_tagging_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/common/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/common/abstract_monitor_tickets.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/common/cro_object.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/common/run_cro.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/monitor/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/monitor/cloud_monitor.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/utils/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/utils/common_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/utils/constant_variables.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/cloud_resource_orchestration/utils/elastic_search_queries.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/athena/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/athena/abstract_athena_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/athena/boto3_client_athena_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/athena/pyathena_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cloudtrail/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cloudtrail/cloudtrail_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cloudwatch/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cloudwatch/cloudwatch_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cost_explorer/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/cost_explorer/cost_explorer_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/dynamodb/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/dynamodb/dynamodb_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/ec2/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/ec2/ec2_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/iam/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/iam/iam_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/price/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/price/price.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/price/resources_pricing.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/rds/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/rds/rds_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/resource_explorer/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/resource_explorer/resource_explorer_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/resource_tagging_api/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/resource_tagging_api/resource_tag_api_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/s3/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/s3/s3_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/savingsplan/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/savingsplan/savings_plans_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/sts/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/sts/sts_oprations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/support/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/support/support_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/utils/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/utils/common_methods.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/aws/utils/utils.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/common/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/common/common_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/compute/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/compute/compute_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/compute/network_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/compute/resource_group_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/cost_management/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/cost_management/cost_management_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/monitor/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/monitor/monitor_management_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/subscriptions/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/azure/subscriptions/azure_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/cloudability/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/cloudability/cloudability_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/cloudability/templates/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/cloudability/templates/cloudability_dimensions.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/gcp/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/gcp/google_account.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/account/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/account/ibm_account.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/account/ibm_authenticator.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/classic/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/classic/classic_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/developer_tools/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/developer_tools/schematic_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/platform_services/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/platform_services/platform_service_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/tagging/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/tagging/global_tagging_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/vpc/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/clouds/ibm/vpc/vpc_infra_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/elastic_upload.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/elasticsearch_exceptions.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/elasticsearch_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/modals/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/modals/cost_usage_reports_data.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/elasticsearch/modals/policy_es_data.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/google_drive/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/google_drive/gcp_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/google_drive/google_drive_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/google_drive/upload_to_gsheet.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/jira/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/jira/jira.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/jira/jira_exceptions.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/jira/jira_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/ldap/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/ldap/ldap_search.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/logger/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/logger/init_logger.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/logger/logger_time_stamp.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/gmail.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/mail_message.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/templates/cro_monitor_budget_remain_alert.j2 +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/templates/cro_monitor_budget_remain_high_alert.j2 +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/templates/cro_request_for_manager_approval.j2 +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/mails/templates/policy_alert_agg_message.j2 +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/pandas/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/pandas/pandas_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/tool/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/tool/tool.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/utils/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/utils/api_requests.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/utils/json_datetime_encoder.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/common/utils/utils.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/environment_variables.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/environment_variables_exceptions.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/es_uploader.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/main.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/main_common_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/main_oerations/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/main_oerations/main_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/main/run_cloud_resource_orchestration.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/database_idle.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/instance_idle.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/instance_run.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/unattached_volume.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cleanup/unused_nat_gateway.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cost_billing_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cost_explorer.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cost_explorer_payer_billings.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/cost_over_usage.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/ebs_in_use.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/ec2_stop.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/empty_roles.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/ip_unattached.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/monitor/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/monitor/cluster_run.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/monthly_report.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/optimize_resources_report.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/s3_inactive.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/skipped_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/spot_savings_analysis.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/zombie_cluster_resource.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/aws/zombie_snapshots.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/instance_idle.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/instance_run.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/ip_unattached.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/unattached_volume.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cleanup/unused_nat_gateway.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/azure/cost_billing_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/common_policies/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/common_policies/cloudability_cost_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/common_policies/send_aggregated_alerts.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/gcp/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/gcp/cost_billing_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/abstract_policy_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/aws/aws_policy_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/azure/azure_policy_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/helpers/cloudability_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/cost_billing_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/cost_usage_reports.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/ibm_cost_over_usage.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/ibm_cost_report.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/tag_baremetal.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/tag_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/ibm/tag_vm.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/cost_expenditure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/cost_expenditure/cost_report_policies.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/dynamodb_upload_data/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/dynamodb_upload_data/cloudtrail_to_dynamodb.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/dynamodb_upload_data/upload_data_to_dynamodb.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_cluster/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_cluster/remove_cluster_tags.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_cluster/run_tag_cluster_resouces.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_cluster/tag_cluster_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_cluster/tag_cluster_resouces.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/non_cluster_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/remove_non_cluster_tags.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/run_tag_non_cluster_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_non_cluster/update_na_tag_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_user/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_user/iam_user_tags.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_user/remove_user_tags.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_user/run_tag_iam_user.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/tag_user/tag_iam_user.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/delete_ec2_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/delete_iam_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/delete_s3_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/run_zombie_cluster_resources.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/validate_zombies.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_non_cluster/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_non_cluster/run_zombie_non_cluster_policies.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/aws/zombie_non_cluster/zombie_non_cluster_polices.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/azure/azure_policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/gcp/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/gcp/gcp_policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/gitleaks/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/gitleaks/gitleaks.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/ibm_operations/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/ibm_operations/ibm_policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/tagging/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_operations/ibm/tagging/tagging_operations.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/aws/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/aws/policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/aws/upload_s3.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/azure/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/azure/policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/common/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/common/abstract_policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/common/abstract_upload.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/common_policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/elasticsearch/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/elasticsearch/upload_elastic_search.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/ibm/__init__.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance/policy/policy_runners/ibm/policy_runner.py +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance.egg-info/SOURCES.txt +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance.egg-info/dependency_links.txt +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance.egg-info/not-zip-safe +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance.egg-info/requires.txt +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/cloud_governance.egg-info/top_level.txt +0 -0
- {cloud_governance-1.1.351 → cloud_governance-1.1.353}/setup.cfg +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
import os
|
|
3
|
+
import smtplib
|
|
4
|
+
from email.message import EmailMessage
|
|
5
|
+
from email.mime.multipart import MIMEMultipart
|
|
6
|
+
from email.mime.text import MIMEText
|
|
7
|
+
from typing import Union, Optional
|
|
8
|
+
|
|
9
|
+
from cloud_governance.common.clouds.aws.s3.s3_operations import S3Operations
|
|
10
|
+
from cloud_governance.common.elasticsearch.elasticsearch_operations import ElasticSearchOperations
|
|
11
|
+
from cloud_governance.common.ldap.ldap_search import LdapSearch
|
|
12
|
+
from cloud_governance.common.logger.init_logger import logger
|
|
13
|
+
|
|
14
|
+
# https://github.com/redhat-performance/quads/blob/master/quads/tools/postman.py
|
|
15
|
+
from cloud_governance.common.logger.logger_time_stamp import logger_time_stamp
|
|
16
|
+
from cloud_governance.common.utils.api_requests import APIRequests
|
|
17
|
+
from cloud_governance.main.environment_variables import environment_variables
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Postfix:
|
|
21
|
+
"""
|
|
22
|
+
This class send mail using the postfix configuration
|
|
23
|
+
install postfix and configure on machine
|
|
24
|
+
$ dnf install postfix -y
|
|
25
|
+
$ vi /etc/postfix/main.cf
|
|
26
|
+
relayhost = [smtp.corp.redhat.com]
|
|
27
|
+
inet_interfaces = all
|
|
28
|
+
inet_protocols = all
|
|
29
|
+
relay_domains = rdu2.scalelab.redhat.com, redhat.com
|
|
30
|
+
$ systemctl restart postfix
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self):
|
|
34
|
+
self.__environment_variables_dict = environment_variables.environment_variables_dict
|
|
35
|
+
self.__LDAP_HOST_NAME = self.__environment_variables_dict.get('LDAP_HOST_NAME')
|
|
36
|
+
self.__ldap_search = LdapSearch(ldap_host_name=self.__LDAP_HOST_NAME)
|
|
37
|
+
self.reply_to = self.__environment_variables_dict.get('REPLY_TO', 'dev-null@redhat.com')
|
|
38
|
+
self.__es_host = self.__environment_variables_dict.get('es_host', '')
|
|
39
|
+
self.__policy = self.__environment_variables_dict.get('policy', '')
|
|
40
|
+
self.__es_port = self.__environment_variables_dict.get('es_port', '')
|
|
41
|
+
self.__account = self.__environment_variables_dict.get('account', '')
|
|
42
|
+
self.__policy_output = self.__environment_variables_dict.get('policy_output', '')
|
|
43
|
+
self.__default_admins = self.__environment_variables_dict.get('DEFAULT_ADMINS')
|
|
44
|
+
self.__email_alert = self.__environment_variables_dict.get('EMAIL_ALERT')
|
|
45
|
+
self.__mail_to = self.__environment_variables_dict.get('EMAIL_TO')
|
|
46
|
+
self.__mail_cc = self.__environment_variables_dict.get('EMAIL_CC')
|
|
47
|
+
self.__POSTFIX_HOST = environment_variables.POSTFIX_HOST
|
|
48
|
+
self.__POSTFIX_PORT = environment_variables.POSTFIX_PORT
|
|
49
|
+
self.bucket_name, self.key = self.get_bucket_name()
|
|
50
|
+
self.__perf_services_url = os.environ.get('PERF_SERVICES_URL')
|
|
51
|
+
self.__es_index = 'cloud-governance-mail-messages'
|
|
52
|
+
self.__api_request = APIRequests()
|
|
53
|
+
if self.__es_host:
|
|
54
|
+
self.__es_operations = ElasticSearchOperations(es_host=self.__es_host, es_port=self.__es_port)
|
|
55
|
+
if self.__policy_output:
|
|
56
|
+
self.__s3_operations = S3Operations(region_name='us-east-1')
|
|
57
|
+
|
|
58
|
+
def get_bucket_name(self):
|
|
59
|
+
key = 'logs'
|
|
60
|
+
if 's3' in self.__policy_output.lower():
|
|
61
|
+
targets = self.__policy_output.split('/')
|
|
62
|
+
bucket_name = targets[2]
|
|
63
|
+
key = targets[3]
|
|
64
|
+
else:
|
|
65
|
+
bucket_name = self.__policy_output
|
|
66
|
+
return bucket_name, key
|
|
67
|
+
|
|
68
|
+
def split_emails(self, email_str: str):
|
|
69
|
+
"""
|
|
70
|
+
This method split the mail list
|
|
71
|
+
:param email_str:
|
|
72
|
+
:type email_str:
|
|
73
|
+
:return:
|
|
74
|
+
:rtype:
|
|
75
|
+
"""
|
|
76
|
+
splitter = "," if "," in email_str else " "
|
|
77
|
+
return [item.strip() for item in email_str.split(splitter)]
|
|
78
|
+
|
|
79
|
+
def prettify_to(self, to: Union[str, list]):
|
|
80
|
+
"""
|
|
81
|
+
This method prettifies to
|
|
82
|
+
:param to:
|
|
83
|
+
:type to:
|
|
84
|
+
:return:
|
|
85
|
+
:rtype:
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
if isinstance(to, str):
|
|
89
|
+
to = self.split_emails(email_str=to)
|
|
90
|
+
if isinstance(to, list):
|
|
91
|
+
return ','.join([item if '@redhat.com' in item else f'{item}@redhat.com' for item in to])
|
|
92
|
+
return to
|
|
93
|
+
|
|
94
|
+
def prettify_cc(self, cc: Union[str, list], to: str = ''):
|
|
95
|
+
"""
|
|
96
|
+
This method prettifies cc
|
|
97
|
+
:param to:
|
|
98
|
+
:type to:
|
|
99
|
+
:param cc:
|
|
100
|
+
:type cc:
|
|
101
|
+
:return:
|
|
102
|
+
:rtype:
|
|
103
|
+
"""
|
|
104
|
+
if isinstance(cc, str):
|
|
105
|
+
cc = self.split_emails(email_str=cc)
|
|
106
|
+
cc_unique_values = [cc_user if '@redhat.com' in cc_user else f'{cc_user}@redhat.com' for cc_user in cc]
|
|
107
|
+
to = self.prettify_to(to=to).split(',')
|
|
108
|
+
return ','.join(list(set(cc_unique_values) - set(to)))
|
|
109
|
+
|
|
110
|
+
def __save_to_elastic(self, **kwargs):
|
|
111
|
+
"""
|
|
112
|
+
This method uploads data to elasticsearch
|
|
113
|
+
:param kwargs:
|
|
114
|
+
:return:
|
|
115
|
+
"""
|
|
116
|
+
es_data = kwargs.get('es_data')
|
|
117
|
+
data = {'Policy': self.__policy,
|
|
118
|
+
'Account': self.__account.upper(),
|
|
119
|
+
'MessageType': kwargs.get('message_type', 'alert')}
|
|
120
|
+
if es_data:
|
|
121
|
+
data.update(es_data)
|
|
122
|
+
if kwargs.get('resource_id'):
|
|
123
|
+
data['resource_id'] = kwargs['resource_id']
|
|
124
|
+
if kwargs.get('extra_purse'):
|
|
125
|
+
data['extra_purse'] = round(kwargs['extra_purse'], 3)
|
|
126
|
+
if kwargs.get('remaining_budget'):
|
|
127
|
+
data['remaining_budget'] = kwargs['remaining_budget']
|
|
128
|
+
if self.__es_host:
|
|
129
|
+
self.__es_operations.upload_to_elasticsearch(data=data, index=self.__es_index)
|
|
130
|
+
logger.info(f'Uploaded to es index: {self.__es_index}')
|
|
131
|
+
else:
|
|
132
|
+
logger.info('Error missing the es_host')
|
|
133
|
+
|
|
134
|
+
def __save_to_s3(self, content: str, **kwargs):
|
|
135
|
+
"""
|
|
136
|
+
This method save mail message to s3 bucket
|
|
137
|
+
:return:
|
|
138
|
+
"""
|
|
139
|
+
if kwargs.get('filename'):
|
|
140
|
+
file_name = kwargs['filename'].split('/')[-1]
|
|
141
|
+
date_key = datetime.datetime.now().strftime("%Y%m%d%H")
|
|
142
|
+
if self.__policy_output:
|
|
143
|
+
self.__s3_operations.upload_file(file_name_path=kwargs['filename'],
|
|
144
|
+
bucket=self.bucket_name,
|
|
145
|
+
key=f'{self.key}/{self.__policy}/{date_key}',
|
|
146
|
+
upload_file=file_name)
|
|
147
|
+
s3_path = f'{self.__policy_output}/logs/{self.__policy}/{date_key}/{file_name}'
|
|
148
|
+
content += f'\n\nresource_file_path: s3://{s3_path}\n\n'
|
|
149
|
+
logger.info("File Saved to S3")
|
|
150
|
+
self.__save_to_elastic(**kwargs)
|
|
151
|
+
|
|
152
|
+
@logger_time_stamp
|
|
153
|
+
def send_email_postfix(self, subject: str, to: any, cc: list, content: str, **kwargs):
|
|
154
|
+
if self.__email_alert:
|
|
155
|
+
if self.__mail_to:
|
|
156
|
+
to = self.__mail_to
|
|
157
|
+
if self.__mail_cc:
|
|
158
|
+
cc = self.__mail_cc
|
|
159
|
+
if not self.__ldap_search.get_user_details(user_name=to):
|
|
160
|
+
cc.append('athiruma@redhat.com')
|
|
161
|
+
response = {'ok': True}
|
|
162
|
+
to = self.prettify_to(to)
|
|
163
|
+
cc = self.prettify_cc(cc)
|
|
164
|
+
kwargs.setdefault('es_data', {}).update({'To': to, 'Cc': cc, 'Message': content})
|
|
165
|
+
if self.__perf_services_url:
|
|
166
|
+
body = {
|
|
167
|
+
"cc": cc,
|
|
168
|
+
"to": to,
|
|
169
|
+
"subject": subject,
|
|
170
|
+
"mail_body": content,
|
|
171
|
+
}
|
|
172
|
+
if kwargs.get('filename'):
|
|
173
|
+
body['file_content'] = open(kwargs['filename']).read()
|
|
174
|
+
body['filename'] = kwargs['filename'].split('/')[-1]
|
|
175
|
+
api_url = self.__perf_services_url + f"/postfix/send_mail"
|
|
176
|
+
response = self.__api_request.post(api_url, json=body)
|
|
177
|
+
response = response.json()
|
|
178
|
+
else:
|
|
179
|
+
msg = MIMEMultipart('alternative')
|
|
180
|
+
msg["Subject"] = subject
|
|
181
|
+
msg["From"] = "%s <%s>" % (
|
|
182
|
+
'cloud-governance',
|
|
183
|
+
"@".join(["noreply-cloud-governance", 'redhat.com']),
|
|
184
|
+
)
|
|
185
|
+
msg["To"] = to
|
|
186
|
+
msg["Cc"] = cc
|
|
187
|
+
# msg.add_header("Reply-To", self.reply_to)
|
|
188
|
+
# msg.add_header("User-Agent", self.reply_to)
|
|
189
|
+
if kwargs.get('filename'):
|
|
190
|
+
attachment = MIMEText(open(kwargs['filename']).read())
|
|
191
|
+
attachment.add_header('Content-Disposition', 'attachment',
|
|
192
|
+
filename=kwargs['filename'].split('/')[-1])
|
|
193
|
+
msg.attach(attachment)
|
|
194
|
+
if kwargs.get('mime_type'):
|
|
195
|
+
msg.attach(MIMEText(content, kwargs.get('mime_type')))
|
|
196
|
+
else:
|
|
197
|
+
msg.attach(MIMEText(content))
|
|
198
|
+
try:
|
|
199
|
+
with smtplib.SMTP(self.__POSTFIX_HOST, self.__POSTFIX_PORT) as s:
|
|
200
|
+
try:
|
|
201
|
+
s.send_message(msg)
|
|
202
|
+
except smtplib.SMTPException as ex:
|
|
203
|
+
logger.error(f'Error while sending mail, {ex}')
|
|
204
|
+
response = {
|
|
205
|
+
'ok': True
|
|
206
|
+
}
|
|
207
|
+
except Exception as err:
|
|
208
|
+
logger.error(f'Some error occurred, {err}')
|
|
209
|
+
if isinstance(response, dict) and response.get('ok'):
|
|
210
|
+
logger.info(f'Mail sent successfully to {to}')
|
|
211
|
+
self.__save_to_s3(content, **kwargs)
|
|
212
|
+
return True
|
|
213
|
+
return False
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from datetime import datetime, timedelta
|
|
2
2
|
|
|
3
3
|
from cloud_governance.common.logger.init_logger import logger
|
|
4
|
+
from cloud_governance.common.utils.configs import INSTANCE_START_PREFIX
|
|
4
5
|
from cloud_governance.policy.policy_operations.aws.tag_non_cluster.non_cluster_operations import NonClusterOperations
|
|
5
6
|
|
|
6
7
|
|
|
@@ -36,7 +37,8 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
36
37
|
@param tags:
|
|
37
38
|
@return:
|
|
38
39
|
"""
|
|
39
|
-
username = self.get_username(start_time=launch_time, resource_id=instance_id,
|
|
40
|
+
username = self.get_username(start_time=launch_time, resource_id=instance_id,
|
|
41
|
+
resource_type='AWS::EC2::Instance', tags=tags)
|
|
40
42
|
search_tags = []
|
|
41
43
|
user_tags = []
|
|
42
44
|
if not username:
|
|
@@ -73,8 +75,10 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
73
75
|
if add_tags:
|
|
74
76
|
if self.dry_run == 'no':
|
|
75
77
|
try:
|
|
76
|
-
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
77
|
-
|
|
78
|
+
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
79
|
+
resource_ids=[instance_id], tags=add_tags)
|
|
80
|
+
logger.info(
|
|
81
|
+
f'Added tags to instance: {instance_id} total: {len(add_tags)} tags: {add_tags}')
|
|
78
82
|
except Exception as err:
|
|
79
83
|
logger.info(err)
|
|
80
84
|
instances_ids.append(instance_id)
|
|
@@ -94,7 +98,8 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
94
98
|
volume_id = volume.get('VolumeId')
|
|
95
99
|
tags = volume.get('Tags')
|
|
96
100
|
if not self.validate_existing_tag(tags=tags):
|
|
97
|
-
username = self.get_username(start_time=volume.get('CreateTime'), resource_id=volume_id,
|
|
101
|
+
username = self.get_username(start_time=volume.get('CreateTime'), resource_id=volume_id,
|
|
102
|
+
resource_type='AWS::EC2::Volume', tags=tags)
|
|
98
103
|
search_tags = []
|
|
99
104
|
if not username:
|
|
100
105
|
get_tags, username = self._get_tags_fom_attachments(attachments=volume.get('Attachments'))
|
|
@@ -120,8 +125,10 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
120
125
|
if volume_tags:
|
|
121
126
|
if self.dry_run == 'no':
|
|
122
127
|
try:
|
|
123
|
-
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
124
|
-
|
|
128
|
+
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
129
|
+
resource_ids=[volume_id], tags=volume_tags)
|
|
130
|
+
logger.info(
|
|
131
|
+
f'added tags to volume_id: {volume_id} total: {len(volume_tags)} tags: {volume_tags}')
|
|
125
132
|
except Exception as err:
|
|
126
133
|
logger.info(err)
|
|
127
134
|
volume_ids.append(volume_id)
|
|
@@ -141,24 +148,33 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
141
148
|
snapshot_id = snapshot.get('SnapshotId')
|
|
142
149
|
tags = snapshot.get('Tags')
|
|
143
150
|
if not self.validate_existing_tag(tags=tags):
|
|
144
|
-
username = self.get_username(start_time=snapshot.get('StartTime'), resource_id=snapshot_id,
|
|
151
|
+
username = self.get_username(start_time=snapshot.get('StartTime'), resource_id=snapshot_id,
|
|
152
|
+
resource_type='AWS::EC2::Snapshot', tags=tags)
|
|
145
153
|
if 'vm_import_image' in username:
|
|
146
154
|
start_time = snapshot.get('StartTime') + timedelta(seconds=5)
|
|
147
155
|
end_time = start_time + timedelta(minutes=30)
|
|
148
|
-
assume_username = self.get_username(start_time=start_time, resource_id=snapshot_id,
|
|
156
|
+
assume_username = self.get_username(start_time=start_time, resource_id=snapshot_id,
|
|
157
|
+
resource_type='AWS::EC2::Snapshot', tags=tags,
|
|
158
|
+
end_time=end_time)
|
|
149
159
|
if assume_username:
|
|
150
160
|
username = assume_username
|
|
151
161
|
search_tags = []
|
|
152
162
|
if not username:
|
|
153
163
|
if snapshot.get('Description') and 'Created' in snapshot.get('Description'):
|
|
154
|
-
image_tags, username = self._get_tags_from_snapshot_description_images(
|
|
164
|
+
image_tags, username = self._get_tags_from_snapshot_description_images(
|
|
165
|
+
description=snapshot.get('Description'))
|
|
155
166
|
if not username:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if
|
|
161
|
-
|
|
167
|
+
if INSTANCE_START_PREFIX in snapshot.get('Description'):
|
|
168
|
+
try:
|
|
169
|
+
instance_id = snapshot.get('Description').split(" ")[2].split("(")[1][:-1]
|
|
170
|
+
instances = self._get_instances_data(instance_id)
|
|
171
|
+
if instances:
|
|
172
|
+
for item in instances:
|
|
173
|
+
if item.get('InstanceId') == instance_id:
|
|
174
|
+
item_tags, username = self._get_tags_from_instance_item(
|
|
175
|
+
instance_item=item)
|
|
176
|
+
except Exception as err:
|
|
177
|
+
logger.info(err)
|
|
162
178
|
else:
|
|
163
179
|
search_tags.extend(self._append_input_tags())
|
|
164
180
|
if username:
|
|
@@ -179,8 +195,10 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
179
195
|
if snapshot_tags:
|
|
180
196
|
if self.dry_run == 'no':
|
|
181
197
|
try:
|
|
182
|
-
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
183
|
-
|
|
198
|
+
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
199
|
+
resource_ids=[snapshot_id], tags=snapshot_tags)
|
|
200
|
+
logger.info(
|
|
201
|
+
f'added tags to snapshots: {snapshot_id} total: {len(snapshot_tags)} tags: {snapshot_tags}')
|
|
184
202
|
except Exception as err:
|
|
185
203
|
logger.info(err)
|
|
186
204
|
snapshot_ids.append(snapshot_id)
|
|
@@ -203,7 +221,8 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
203
221
|
image_name = image.get('Name')
|
|
204
222
|
start_time = datetime.fromisoformat(image.get('CreationDate')[:-1] + '+00:00')
|
|
205
223
|
if not self.validate_existing_tag(tags=tags):
|
|
206
|
-
username = self.get_username(start_time=start_time, resource_id=image_id, resource_type='AWS::EC2::Ami',
|
|
224
|
+
username = self.get_username(start_time=start_time, resource_id=image_id, resource_type='AWS::EC2::Ami',
|
|
225
|
+
tags=tags, resource_name=image_name)
|
|
207
226
|
search_tags = []
|
|
208
227
|
search_tags.extend(self._append_input_tags())
|
|
209
228
|
if username:
|
|
@@ -223,7 +242,8 @@ class TagNonClusterResources(NonClusterOperations):
|
|
|
223
242
|
if image_tags:
|
|
224
243
|
if self.dry_run == 'no':
|
|
225
244
|
try:
|
|
226
|
-
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
245
|
+
self.utils.tag_aws_resources(client_method=self.ec2_client.create_tags,
|
|
246
|
+
resource_ids=[image_id], tags=image_tags)
|
|
227
247
|
logger.info(f'added tags to image: {image_id} total: {len(image_tags)} tags: {image_tags}')
|
|
228
248
|
except Exception as err:
|
|
229
249
|
logger.info(err)
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import smtplib
|
|
3
|
-
from email.message import EmailMessage
|
|
4
|
-
from email.mime.multipart import MIMEMultipart
|
|
5
|
-
from email.mime.text import MIMEText
|
|
6
|
-
from typing import Union, Optional
|
|
7
|
-
|
|
8
|
-
from cloud_governance.common.clouds.aws.s3.s3_operations import S3Operations
|
|
9
|
-
from cloud_governance.common.elasticsearch.elasticsearch_operations import ElasticSearchOperations
|
|
10
|
-
from cloud_governance.common.ldap.ldap_search import LdapSearch
|
|
11
|
-
from cloud_governance.common.logger.init_logger import logger
|
|
12
|
-
|
|
13
|
-
# https://github.com/redhat-performance/quads/blob/master/quads/tools/postman.py
|
|
14
|
-
from cloud_governance.common.logger.logger_time_stamp import logger_time_stamp
|
|
15
|
-
from cloud_governance.main.environment_variables import environment_variables
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Postfix:
|
|
19
|
-
"""
|
|
20
|
-
This class send mail using the postfix configuration
|
|
21
|
-
install postfix and configure on machine
|
|
22
|
-
$ dnf install postfix -y
|
|
23
|
-
$ vi /etc/postfix/main.cf
|
|
24
|
-
relayhost = [smtp.corp.redhat.com]
|
|
25
|
-
inet_interfaces = all
|
|
26
|
-
inet_protocols = all
|
|
27
|
-
relay_domains = rdu2.scalelab.redhat.com, redhat.com
|
|
28
|
-
$ systemctl restart postfix
|
|
29
|
-
"""
|
|
30
|
-
|
|
31
|
-
def __init__(self):
|
|
32
|
-
self.__environment_variables_dict = environment_variables.environment_variables_dict
|
|
33
|
-
self.__LDAP_HOST_NAME = self.__environment_variables_dict.get('LDAP_HOST_NAME')
|
|
34
|
-
self.__ldap_search = LdapSearch(ldap_host_name=self.__LDAP_HOST_NAME)
|
|
35
|
-
self.reply_to = self.__environment_variables_dict.get('REPLY_TO', 'dev-null@redhat.com')
|
|
36
|
-
self.__es_host = self.__environment_variables_dict.get('es_host', '')
|
|
37
|
-
self.__policy = self.__environment_variables_dict.get('policy', '')
|
|
38
|
-
self.__es_port = self.__environment_variables_dict.get('es_port', '')
|
|
39
|
-
self.__account = self.__environment_variables_dict.get('account', '')
|
|
40
|
-
self.__policy_output = self.__environment_variables_dict.get('policy_output', '')
|
|
41
|
-
self.__default_admins = self.__environment_variables_dict.get('DEFAULT_ADMINS')
|
|
42
|
-
self.__email_alert = self.__environment_variables_dict.get('EMAIL_ALERT')
|
|
43
|
-
self.__mail_to = self.__environment_variables_dict.get('EMAIL_TO')
|
|
44
|
-
self.__mail_cc = self.__environment_variables_dict.get('EMAIL_CC')
|
|
45
|
-
self.__POSTFIX_HOST = environment_variables.POSTFIX_HOST
|
|
46
|
-
self.__POSTFIX_PORT = environment_variables.POSTFIX_PORT
|
|
47
|
-
self.bucket_name, self.key = self.get_bucket_name()
|
|
48
|
-
self.__es_index = 'cloud-governance-mail-messages'
|
|
49
|
-
if self.__es_host:
|
|
50
|
-
self.__es_operations = ElasticSearchOperations(es_host=self.__es_host, es_port=self.__es_port)
|
|
51
|
-
if self.__policy_output:
|
|
52
|
-
self.__s3_operations = S3Operations(region_name='us-east-1')
|
|
53
|
-
|
|
54
|
-
def get_bucket_name(self):
|
|
55
|
-
key = 'logs'
|
|
56
|
-
if 's3' in self.__policy_output.lower():
|
|
57
|
-
targets = self.__policy_output.split('/')
|
|
58
|
-
bucket_name = targets[2]
|
|
59
|
-
key = targets[3]
|
|
60
|
-
else:
|
|
61
|
-
bucket_name = self.__policy_output
|
|
62
|
-
return bucket_name, key
|
|
63
|
-
|
|
64
|
-
def split_emails(self, email_str: str):
|
|
65
|
-
"""
|
|
66
|
-
This method split the mail list
|
|
67
|
-
:param email_str:
|
|
68
|
-
:type email_str:
|
|
69
|
-
:return:
|
|
70
|
-
:rtype:
|
|
71
|
-
"""
|
|
72
|
-
splitter = "," if "," in email_str else " "
|
|
73
|
-
return [item.strip() for item in email_str.split(splitter)]
|
|
74
|
-
|
|
75
|
-
def prettify_to(self, to: Union[str, list]):
|
|
76
|
-
"""
|
|
77
|
-
This method prettify to
|
|
78
|
-
:param to:
|
|
79
|
-
:type to:
|
|
80
|
-
:return:
|
|
81
|
-
:rtype:
|
|
82
|
-
"""
|
|
83
|
-
|
|
84
|
-
if isinstance(to, str):
|
|
85
|
-
to = self.split_emails(email_str=to)
|
|
86
|
-
if isinstance(to, list):
|
|
87
|
-
return ','.join([item if '@redhat.com' in item else f'{item}@redhat.com' for item in to])
|
|
88
|
-
return to
|
|
89
|
-
|
|
90
|
-
def prettify_cc(self, cc: Union[str, list], to: str = ''):
|
|
91
|
-
"""
|
|
92
|
-
This method prettify cc
|
|
93
|
-
:param to:
|
|
94
|
-
:type to:
|
|
95
|
-
:param cc:
|
|
96
|
-
:type cc:
|
|
97
|
-
:return:
|
|
98
|
-
:rtype:
|
|
99
|
-
"""
|
|
100
|
-
if isinstance(cc, str):
|
|
101
|
-
cc = self.split_emails(email_str=cc)
|
|
102
|
-
cc_unique_values = [cc_user if '@redhat.com' in cc_user else f'{cc_user}@redhat.com' for cc_user in cc]
|
|
103
|
-
to = self.prettify_to(to=to).split(',')
|
|
104
|
-
return ','.join(list(set(cc_unique_values) - set(to)))
|
|
105
|
-
|
|
106
|
-
@logger_time_stamp
|
|
107
|
-
def send_email_postfix(self, subject: str, to: any, cc: list, content: str, **kwargs):
|
|
108
|
-
if self.__email_alert:
|
|
109
|
-
if self.__mail_to:
|
|
110
|
-
to = self.__mail_to
|
|
111
|
-
if self.__mail_cc:
|
|
112
|
-
cc = self.__mail_cc
|
|
113
|
-
if not self.__ldap_search.get_user_details(user_name=to):
|
|
114
|
-
cc.append('athiruma@redhat.com')
|
|
115
|
-
msg = MIMEMultipart('alternative')
|
|
116
|
-
msg["Subject"] = subject
|
|
117
|
-
msg["From"] = "%s <%s>" % (
|
|
118
|
-
'cloud-governance',
|
|
119
|
-
"@".join(["noreply-cloud-governance", 'redhat.com']),
|
|
120
|
-
)
|
|
121
|
-
msg["To"] = self.prettify_to(to)
|
|
122
|
-
msg["Cc"] = self.prettify_cc(cc=cc, to=to)
|
|
123
|
-
# msg.add_header("Reply-To", self.reply_to)
|
|
124
|
-
# msg.add_header("User-Agent", self.reply_to)
|
|
125
|
-
if kwargs.get('filename'):
|
|
126
|
-
attachment = MIMEText(open(kwargs['filename']).read())
|
|
127
|
-
attachment.add_header('Content-Disposition', 'attachment',
|
|
128
|
-
filename=kwargs['filename'].split('/')[-1])
|
|
129
|
-
msg.attach(attachment)
|
|
130
|
-
if kwargs.get('mime_type'):
|
|
131
|
-
msg.attach(MIMEText(content, kwargs.get('mime_type')))
|
|
132
|
-
else:
|
|
133
|
-
msg.attach(MIMEText(content))
|
|
134
|
-
email_string = msg.as_string()
|
|
135
|
-
try:
|
|
136
|
-
with smtplib.SMTP(self.__POSTFIX_HOST, self.__POSTFIX_PORT) as s:
|
|
137
|
-
try:
|
|
138
|
-
logger.debug(email_string)
|
|
139
|
-
s.send_message(msg)
|
|
140
|
-
if isinstance(to, str):
|
|
141
|
-
logger.warn(f'Mail sent successfully to {to}@redhat.com')
|
|
142
|
-
elif isinstance(to, list):
|
|
143
|
-
logger.warn(f'Mail sent successfully to {", ".join(to)}@redhat.com')
|
|
144
|
-
if kwargs.get('filename'):
|
|
145
|
-
file_name = kwargs['filename'].split('/')[-1]
|
|
146
|
-
date_key = datetime.datetime.now().strftime("%Y%m%d%H")
|
|
147
|
-
if self.__policy_output:
|
|
148
|
-
self.__s3_operations.upload_file(file_name_path=kwargs['filename'],
|
|
149
|
-
bucket=self.bucket_name,
|
|
150
|
-
key=f'{self.key}/{self.__policy}/{date_key}',
|
|
151
|
-
upload_file=file_name)
|
|
152
|
-
s3_path = f'{self.__policy_output}/logs/{self.__policy}/{date_key}/{file_name}'
|
|
153
|
-
content += f'\n\nresource_file_path: s3://{s3_path}\n\n'
|
|
154
|
-
es_data = kwargs.get('es_data')
|
|
155
|
-
data = {'Policy': self.__policy, 'To': to, 'Cc': cc, 'Message': content,
|
|
156
|
-
'Account': self.__account.upper(), 'MessageType': kwargs.get('message_type', 'alert')}
|
|
157
|
-
if es_data:
|
|
158
|
-
data.update(es_data)
|
|
159
|
-
if kwargs.get('resource_id'):
|
|
160
|
-
data['resource_id'] = kwargs['resource_id']
|
|
161
|
-
if kwargs.get('extra_purse'):
|
|
162
|
-
data['extra_purse'] = round(kwargs['extra_purse'], 3)
|
|
163
|
-
if kwargs.get('remaining_budget'):
|
|
164
|
-
data['remaining_budget'] = kwargs['remaining_budget']
|
|
165
|
-
if self.__es_host:
|
|
166
|
-
self.__es_operations.upload_to_elasticsearch(data=data, index=self.__es_index)
|
|
167
|
-
logger.warn(f'Uploaded to es index: {self.__es_index}')
|
|
168
|
-
else:
|
|
169
|
-
logger.warn('Error missing the es_host')
|
|
170
|
-
except smtplib.SMTPException as ex:
|
|
171
|
-
logger.error(f'Error while sending mail, {ex}')
|
|
172
|
-
return False
|
|
173
|
-
return True
|
|
174
|
-
except Exception as err:
|
|
175
|
-
logger.error(f'Some error occurred, {err}')
|
|
176
|
-
return False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|