cloud-governance 1.1.357__py3-none-any.whl → 1.1.359__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -346,7 +346,8 @@ class EC2Operations:
346
346
  This method returns all images in the region
347
347
  @return:
348
348
  """
349
- return self.ec2_client.describe_images(Owners=['self'], **kwargs)['Images']
349
+ return self.ec2_client.describe_images(Owners=['self'], IncludeDeprecated=True, IncludeDisabled=True, **kwargs)[
350
+ 'Images']
350
351
 
351
352
  def get_snapshots(self):
352
353
  """
@@ -624,9 +625,12 @@ class EC2Operations:
624
625
  active_instances = {}
625
626
  active_regions = self.get_active_regions()
626
627
  for region_name in active_regions[::-1]:
627
- filters = [{'Name': f'tag:{tag_name}', 'Values': [tag_value, tag_value.upper(), tag_value.lower(), tag_value.title()]}]
628
+ filters = [{'Name': f'tag:{tag_name}',
629
+ 'Values': [tag_value, tag_value.upper(), tag_value.lower(), tag_value.title()]}]
628
630
  self.get_ec2_instance_list()
629
- active_instances_in_region = self.get_ec2_instance_list(Filters=filters, ec2_client=boto3.client('ec2', region_name=region_name), ignore_tag=ignore_tag)
631
+ active_instances_in_region = self.get_ec2_instance_list(Filters=filters, ec2_client=boto3.client('ec2',
632
+ region_name=region_name),
633
+ ignore_tag=ignore_tag)
630
634
  if active_instances_in_region:
631
635
  if skip_full_scan:
632
636
  return True
@@ -642,7 +646,8 @@ class EC2Operations:
642
646
  :return:
643
647
  """
644
648
  ignore_tag = 'TicketId'
645
- return self.get_active_instances(tag_name=tag_name, tag_value=tag_value, skip_full_scan=True, ignore_tag=ignore_tag)
649
+ return self.get_active_instances(tag_name=tag_name, tag_value=tag_value, skip_full_scan=True,
650
+ ignore_tag=ignore_tag)
646
651
 
647
652
  def describe_tags(self, **kwargs):
648
653
  """
@@ -27,19 +27,32 @@ class ElasticSearchOperations:
27
27
  MIN_SEARCH_RESULTS = 100
28
28
  DEFAULT_ES_BULK_LIMIT = 5000
29
29
 
30
- def __init__(self, es_host: str = None, es_port: str = None, region: str = '', bucket: str = '',
30
+ def __init__(self,
31
+ es_host: str = None,
32
+ es_port: str = None,
33
+ region: str = '',
34
+ es_user: str = None,
35
+ es_password: str = None,
36
+ bucket: str = '',
31
37
  logs_bucket_key: str = '',
32
38
  timeout: int = 2000):
33
39
  self.__environment_variables_dict = environment_variables.environment_variables_dict
34
40
  self.__es_host = es_host if es_host else self.__environment_variables_dict.get('es_host')
35
41
  self.__es_port = es_port if es_port else self.__environment_variables_dict.get('es_port')
42
+ self.__es_user = es_user if es_user else self.__environment_variables_dict.get('es_user')
43
+ self.__es_password = es_password if es_password else self.__environment_variables_dict.get('es_password')
36
44
  self.__region = region
37
45
  self.__timeout = int(
38
46
  self.__environment_variables_dict.get('ES_TIMEOUT')) if self.__environment_variables_dict.get(
39
47
  'ES_TIMEOUT') else timeout
40
48
  self.__account = self.__environment_variables_dict.get('account')
41
49
  try:
42
- self.__es = Elasticsearch([{'host': self.__es_host, 'port': self.__es_port}], timeout=self.__timeout,
50
+ add_host = {'host': self.__es_host, 'port': self.__es_port,
51
+ 'http_auth': f'{self.__es_user}:{self.__es_password}'}
52
+ if int(self.__es_port) == 443:
53
+ add_host['use_ssl'] = True
54
+ self.__es = Elasticsearch([add_host],
55
+ timeout=self.__timeout,
43
56
  max_retries=2)
44
57
  except Exception as err:
45
58
  self.__es = None
@@ -184,6 +184,8 @@ class EnvironmentVariables:
184
184
  self._environment_variables_dict['upload_data_es'] = EnvironmentVariables.get_env('upload_data_es', '')
185
185
  self._environment_variables_dict['es_host'] = EnvironmentVariables.get_env('es_host', '')
186
186
  self._environment_variables_dict['es_port'] = EnvironmentVariables.get_env('es_port', '')
187
+ self._environment_variables_dict['es_user'] = EnvironmentVariables.get_env('es_user', '')
188
+ self._environment_variables_dict['es_password'] = EnvironmentVariables.get_env('es_password', '')
187
189
  self._environment_variables_dict['es_index'] = EnvironmentVariables.get_env('es_index', es_index)
188
190
  self._environment_variables_dict['es_doc_type'] = EnvironmentVariables.get_env('es_doc_type', '')
189
191
  self._environment_variables_dict['ES_TIMEOUT'] = EnvironmentVariables.get_env('ES_TIMEOUT', 2000)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloud-governance
3
- Version: 1.1.357
3
+ Version: 1.1.359
4
4
  Summary: Cloud Governance Tool
5
5
  Home-page: https://github.com/redhat-performance/cloud-governance
6
6
  Author: Red Hat
@@ -25,8 +25,8 @@ Requires-Dist: azure-mgmt-resource==23.0.1
25
25
  Requires-Dist: azure-mgmt-compute==30.1.0
26
26
  Requires-Dist: azure-mgmt-network==25.0.0
27
27
  Requires-Dist: azure-mgmt-monitor==6.0.2
28
- Requires-Dist: boto3==1.26.4
29
- Requires-Dist: botocore==1.29.4
28
+ Requires-Dist: boto3==1.33.1
29
+ Requires-Dist: botocore==1.33.8
30
30
  Requires-Dist: elasticsearch-dsl==7.4.0
31
31
  Requires-Dist: elasticsearch==7.13.4
32
32
  Requires-Dist: google-api-python-client==2.57.0
@@ -49,7 +49,7 @@ cloud_governance/common/clouds/aws/cost_explorer/cost_explorer_operations.py,sha
49
49
  cloud_governance/common/clouds/aws/dynamodb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  cloud_governance/common/clouds/aws/dynamodb/dynamodb_operations.py,sha256=eeV3YgT2bAMwb3UmQjCGdh3ie3-Q8UvKNv4iOypYwNg,4916
51
51
  cloud_governance/common/clouds/aws/ec2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
- cloud_governance/common/clouds/aws/ec2/ec2_operations.py,sha256=2km09WsFrFWZ1IEyiqER9rF05W4jnfRABb9OwQgEYFI,23990
52
+ cloud_governance/common/clouds/aws/ec2/ec2_operations.py,sha256=wt5gLCe5EFtooaukWRS6QBliCy_1_LDurTs5i1IZH4Y,24291
53
53
  cloud_governance/common/clouds/aws/iam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  cloud_governance/common/clouds/aws/iam/iam_operations.py,sha256=ngVh19oIse1UjzvUkImYzs3xBFt74LhdUGbOhI58ZMA,4843
55
55
  cloud_governance/common/clouds/aws/price/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -108,7 +108,7 @@ cloud_governance/common/clouds/ibm/vpc/vpc_infra_operations.py,sha256=W-NgQRwA15
108
108
  cloud_governance/common/elasticsearch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
109
  cloud_governance/common/elasticsearch/elastic_upload.py,sha256=OGdc6ZQ9L8Fjj8mhVARg1flUQ_SKB7J0HVcFVWt67Q0,2576
110
110
  cloud_governance/common/elasticsearch/elasticsearch_exceptions.py,sha256=6rwxbRYv93w7qvVaiSDJnwVgxG1A-kwU8IBzAU8iBmg,485
111
- cloud_governance/common/elasticsearch/elasticsearch_operations.py,sha256=IQOk0ycdPvXNr4qvl9hT97qo03jUk-CwH7AV6m2R4CI,15934
111
+ cloud_governance/common/elasticsearch/elasticsearch_operations.py,sha256=WsAAjjCh-vX6K25SzQRP-rvPJ59RJ4dAtcXHCtmRUOQ,16529
112
112
  cloud_governance/common/elasticsearch/modals/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  cloud_governance/common/elasticsearch/modals/cost_usage_reports_data.py,sha256=xDxGIxJwhOtSh2VOnYx7XShRF90WPPlaQrfVm3fLQr8,1396
114
114
  cloud_governance/common/elasticsearch/modals/policy_es_data.py,sha256=6ydpSP_3e1OgyxM9IucohU8wSl0D2quisbmVlkM6WOA,1436
@@ -143,7 +143,7 @@ cloud_governance/common/utils/configs.py,sha256=8ry4UQT9s_GUivhrCdwS0vOWYN6OJIHD
143
143
  cloud_governance/common/utils/json_datetime_encoder.py,sha256=_-jzRTe0UqAKTn2E9qaU8SYIxHUoRA5ElWuVA0Y54Xw,338
144
144
  cloud_governance/common/utils/utils.py,sha256=ZUsi4ax2XhDIV-EQ5kJt5Ppd72kmm2psqcg1cNDZrvc,4349
145
145
  cloud_governance/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
- cloud_governance/main/environment_variables.py,sha256=5LgGK2QiRJd7Z0Pr7sRODPNmOFUrb_XhNFfWIgaqd0M,28024
146
+ cloud_governance/main/environment_variables.py,sha256=78sP8Mp69Ucv1RVBV6em8VXCk1WswF6MoLmsvlMDEWI,28228
147
147
  cloud_governance/main/environment_variables_exceptions.py,sha256=UR0Ith0P0oshsDZdJRlRq8ZUTt0h8jFvUtrnP4m4AIY,437
148
148
  cloud_governance/main/es_uploader.py,sha256=6Ify5CS2NtUF1xXZ-rMwpYxVzDKfEZhv2vogWFltt98,10656
149
149
  cloud_governance/main/main.py,sha256=ydKIGwRjYAxjpGbqcPGBS14E5fZ1k66y3mpmTUIf1HI,18884
@@ -263,8 +263,8 @@ cloud_governance/policy/policy_runners/elasticsearch/__init__.py,sha256=47DEQpj8
263
263
  cloud_governance/policy/policy_runners/elasticsearch/upload_elastic_search.py,sha256=pOwUJWXjJbyTy8iv3Ap8xJGnqQe-5lZgoR8-vGfAVos,1881
264
264
  cloud_governance/policy/policy_runners/ibm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
265
265
  cloud_governance/policy/policy_runners/ibm/policy_runner.py,sha256=V0E_f7F3hXit0aSq4BlfX1Jd4vjR2NEvOWsJ5upvZ4o,1302
266
- cloud_governance-1.1.357.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
267
- cloud_governance-1.1.357.dist-info/METADATA,sha256=usz6LlExIPvmpIG16VhTuw4WsCUNgRkUhK6BzJ4ieXs,11364
268
- cloud_governance-1.1.357.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
269
- cloud_governance-1.1.357.dist-info/top_level.txt,sha256=jfB1fgj7jvx3YZkZA4G6hFeS1RHO7J7XtnbjuMNMRww,17
270
- cloud_governance-1.1.357.dist-info/RECORD,,
266
+ cloud_governance-1.1.359.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
267
+ cloud_governance-1.1.359.dist-info/METADATA,sha256=Reuh_6B0aEckOZ7F9hqzbKdYpFYYlExT8jkaAH0Z7gU,11364
268
+ cloud_governance-1.1.359.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
269
+ cloud_governance-1.1.359.dist-info/top_level.txt,sha256=jfB1fgj7jvx3YZkZA4G6hFeS1RHO7J7XtnbjuMNMRww,17
270
+ cloud_governance-1.1.359.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5