cloud-governance 1.1.355__py3-none-any.whl → 1.1.356__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.
- cloud_governance/policy/ibm/ibm_cost_report.py +9 -4
- {cloud_governance-1.1.355.dist-info → cloud_governance-1.1.356.dist-info}/METADATA +1 -1
- {cloud_governance-1.1.355.dist-info → cloud_governance-1.1.356.dist-info}/RECORD +6 -6
- {cloud_governance-1.1.355.dist-info → cloud_governance-1.1.356.dist-info}/WHEEL +1 -1
- {cloud_governance-1.1.355.dist-info → cloud_governance-1.1.356.dist-info}/licenses/LICENSE +0 -0
- {cloud_governance-1.1.355.dist-info → cloud_governance-1.1.356.dist-info}/top_level.txt +0 -0
|
@@ -51,6 +51,8 @@ class IBMCostReport:
|
|
|
51
51
|
hardware_tags = self.collect_tags_from_machines(
|
|
52
52
|
tags=self.classic_operations.get_hardware_tags(hardware_id=str(hardware.get('id'))))
|
|
53
53
|
hardware_tags['fqdn'] = hardware.get('fullyQualifiedDomainName').lower()
|
|
54
|
+
if 'budget' not in hardware_tags:
|
|
55
|
+
hardware_tags['budget'] = self.__environment_variables_dict.get('account')
|
|
54
56
|
collect_machines_data[hardware_tags['fqdn']] = hardware_tags
|
|
55
57
|
return collect_machines_data
|
|
56
58
|
|
|
@@ -86,7 +88,8 @@ class IBMCostReport:
|
|
|
86
88
|
if fqdn not in collect_machines_data:
|
|
87
89
|
user = [user for user in users if user in fqdn]
|
|
88
90
|
if user:
|
|
89
|
-
user_tags = self.ibm_account.get_user_tags_from_gsheet(username=f'{user[0]}@redhat.com',
|
|
91
|
+
user_tags = self.ibm_account.get_user_tags_from_gsheet(username=f'{user[0]}@redhat.com',
|
|
92
|
+
user_email='yes')
|
|
90
93
|
invoice_data[fqdn].update(self.collect_tags_from_machines(user_tags))
|
|
91
94
|
return invoice_data
|
|
92
95
|
|
|
@@ -112,15 +115,17 @@ class IBMCostReport:
|
|
|
112
115
|
collect_machines_data = self.get_hardware_data()
|
|
113
116
|
collect_machines_data.update(self.get_virtual_machine_data())
|
|
114
117
|
invoice_data = self.get_invoice_data(collect_machines_data=collect_machines_data)
|
|
115
|
-
cost_invoice_resource_data = self.concatenate_dictionaries(resource_data=collect_machines_data,
|
|
118
|
+
cost_invoice_resource_data = self.concatenate_dictionaries(resource_data=collect_machines_data,
|
|
119
|
+
invoice_data=invoice_data)
|
|
116
120
|
for tag_name in self.owned_tags:
|
|
117
121
|
cost_list_items = []
|
|
118
122
|
for _, data in cost_invoice_resource_data.items():
|
|
119
|
-
if data
|
|
123
|
+
if data.get(tag_name) != 0 or tag_name == 'budget':
|
|
120
124
|
cost_list_items.append({
|
|
121
125
|
tag_name.capitalize(): data[tag_name],
|
|
122
126
|
'Cost': data['cost'],
|
|
123
127
|
'Budget': self._elastic_upload.account
|
|
124
128
|
})
|
|
125
|
-
self._elastic_upload.es_upload_data(items=cost_list_items,
|
|
129
|
+
self._elastic_upload.es_upload_data(items=cost_list_items,
|
|
130
|
+
es_index=f'{self._elastic_upload.es_index}-{tag_name.lower()}')
|
|
126
131
|
return True
|
|
@@ -200,7 +200,7 @@ cloud_governance/policy/ibm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
|
200
200
|
cloud_governance/policy/ibm/cost_billing_reports.py,sha256=3qQlgugtBQGw_W3PhrsQCehi4r4o1QPr6G50ZWGATnE,4118
|
|
201
201
|
cloud_governance/policy/ibm/cost_usage_reports.py,sha256=UoiGugo9wCtoEKBWd-a4hbkbFhfWOf5BgM8Z6VkWnNU,2298
|
|
202
202
|
cloud_governance/policy/ibm/ibm_cost_over_usage.py,sha256=C9ZkpMjRao9FQ2iZSXFdXqGxctBZVoLe-JXEupqIJ10,3595
|
|
203
|
-
cloud_governance/policy/ibm/ibm_cost_report.py,sha256=
|
|
203
|
+
cloud_governance/policy/ibm/ibm_cost_report.py,sha256=xv-TX4eDgnTt5EM_iCLrUwj5hXRmHrsCfE6bs-bSlIo,5716
|
|
204
204
|
cloud_governance/policy/ibm/tag_baremetal.py,sha256=7vVh3t4mqs_RDEzSwUS1E2xQzHnwJYPs3lGn5V7d3RU,5329
|
|
205
205
|
cloud_governance/policy/ibm/tag_resources.py,sha256=g0ypZuKsQrJxscWDmcCdXHm9AS2fpMWsqpMCorF_Tdc,6324
|
|
206
206
|
cloud_governance/policy/ibm/tag_vm.py,sha256=G3QLYwuB2cWSHAsoR40BHVBV5nmGVcVzLtJLmM3MenA,4836
|
|
@@ -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.
|
|
267
|
-
cloud_governance-1.1.
|
|
268
|
-
cloud_governance-1.1.
|
|
269
|
-
cloud_governance-1.1.
|
|
270
|
-
cloud_governance-1.1.
|
|
266
|
+
cloud_governance-1.1.356.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
267
|
+
cloud_governance-1.1.356.dist-info/METADATA,sha256=mNvoFNdQ_M3Q5wLHAUhE4wmpfqZ_voKMcz_0AeMkiJw,11364
|
|
268
|
+
cloud_governance-1.1.356.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
269
|
+
cloud_governance-1.1.356.dist-info/top_level.txt,sha256=jfB1fgj7jvx3YZkZA4G6hFeS1RHO7J7XtnbjuMNMRww,17
|
|
270
|
+
cloud_governance-1.1.356.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|