xautomata-hive 3.15.6__tar.gz → 3.16.0__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.
Files changed (76) hide show
  1. {xautomata-hive-3.15.6/xautomata_hive.egg-info → xautomata-hive-3.16.0}/PKG-INFO +2 -2
  2. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/api.py +3 -1
  3. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/cost_tagging.py +19 -18
  4. xautomata-hive-3.16.0/hive/cookbook/cost_tree_nodes.py +213 -0
  5. xautomata-hive-3.16.0/hive/cookbook/cost_tree_resources.py +155 -0
  6. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/cost_views.py +12 -9
  7. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/dispatchers.py +1 -1
  8. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/downtimes.py +1 -1
  9. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_cost_management.py +10 -7
  10. xautomata-hive-3.16.0/hive/tools.py +37 -0
  11. xautomata-hive-3.16.0/hive/version.py +1 -0
  12. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/setup.py +1 -1
  13. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0/xautomata_hive.egg-info}/PKG-INFO +2 -2
  14. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/xautomata_hive.egg-info/SOURCES.txt +2 -0
  15. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/xautomata_hive.egg-info/requires.txt +1 -1
  16. xautomata-hive-3.15.6/hive/tools.py +0 -18
  17. xautomata-hive-3.15.6/hive/version.py +0 -1
  18. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/LICENSE +0 -0
  19. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/README.md +0 -0
  20. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/__init__.py +0 -0
  21. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/__init__.py +0 -0
  22. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/acl_docs.py +0 -0
  23. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/acl_overrides.py +0 -0
  24. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/analytics.py +0 -0
  25. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/anomalies.py +0 -0
  26. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/calendars.py +0 -0
  27. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/contacts.py +0 -0
  28. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/cost_tags.py +0 -0
  29. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/customers.py +0 -0
  30. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/dashboards.py +0 -0
  31. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/external_tickets.py +0 -0
  32. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/features.py +0 -0
  33. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/firmware_updates.py +0 -0
  34. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/google.py +0 -0
  35. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/groups.py +0 -0
  36. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/jobs.py +0 -0
  37. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/last_status.py +0 -0
  38. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/login.py +0 -0
  39. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/messages.py +0 -0
  40. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/metric_ingest.py +0 -0
  41. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/metric_types.py +0 -0
  42. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/metrics.py +0 -0
  43. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/microsoft.py +0 -0
  44. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/notification_provider_types.py +0 -0
  45. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/notification_providers.py +0 -0
  46. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/objects.py +0 -0
  47. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/opening_reasons.py +0 -0
  48. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/probe_types.py +0 -0
  49. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/probes.py +0 -0
  50. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/probes_log_ingest.py +0 -0
  51. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/profile_topics.py +0 -0
  52. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/reason_for_closure.py +0 -0
  53. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/retention_rules.py +0 -0
  54. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/schedules.py +0 -0
  55. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/services.py +0 -0
  56. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/sites.py +0 -0
  57. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/terms_and_conditions.py +0 -0
  58. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/tree_hierarchy.py +0 -0
  59. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_cost_azure_raw.py +0 -0
  60. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_metric_status.py +0 -0
  61. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_metric_value.py +0 -0
  62. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_ntop_flows.py +0 -0
  63. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_service_status.py +0 -0
  64. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/ts_service_value.py +0 -0
  65. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/users.py +0 -0
  66. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/users_notifications.py +0 -0
  67. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/virtual_domains.py +0 -0
  68. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/webhooks.py +0 -0
  69. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/widget_groups.py +0 -0
  70. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/cookbook/widgets.py +0 -0
  71. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/decorators.py +0 -0
  72. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/exceptions.py +0 -0
  73. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/hive/infrastrucure_keys.py +0 -0
  74. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/setup.cfg +0 -0
  75. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/xautomata_hive.egg-info/dependency_links.txt +0 -0
  76. {xautomata-hive-3.15.6 → xautomata-hive-3.16.0}/xautomata_hive.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xautomata-hive
3
- Version: 3.15.6
3
+ Version: 3.16.0
4
4
  Home-page: https://github.com/sherlogic/xautomata-hive.git
5
5
  Author: Enrico Ferro - Andrea Jacassi
6
6
  Author-email:
@@ -9,7 +9,7 @@ Requires-Python: >=3.8.0
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: tqdm==4.64.1
12
- Requires-Dist: urllib3==1.26.17
12
+ Requires-Dist: urllib3==2.0.4
13
13
  Requires-Dist: requests==2.31.0
14
14
 
15
15
  # Xautomata API
@@ -474,6 +474,8 @@ from hive.cookbook.calendars import Calendars
474
474
  from hive.cookbook.cost_tagging import CostTagging
475
475
  from hive.cookbook.cost_tags import CostTags
476
476
  from hive.cookbook.cost_views import CostViews
477
+ from hive.cookbook.cost_tree_nodes import CostTreeNodes
478
+ from hive.cookbook.cost_tree_resources import CostTreeResources
477
479
  from hive.cookbook.contacts import Contacts
478
480
  from hive.cookbook.customers import Customers
479
481
  from hive.cookbook.dashboards import Dashboards
@@ -523,7 +525,7 @@ from hive.cookbook.widget_groups import WidgetGroups
523
525
  # hive imports stop
524
526
 
525
527
 
526
- class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, FirmwareUpdates, Groups, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, TermsAndConditions, TreeHierarchy, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
528
+ class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, CostTreeNodes, CostTreeResources, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, FirmwareUpdates, Groups, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, TermsAndConditions, TreeHierarchy, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
527
529
  """
528
530
  Class with each specific API, based on the ApiManager Class created for a more general interaction with Xautomata API
529
531
  """
@@ -19,6 +19,7 @@ class CostTagging(ApiManager):
19
19
  Keyword Args:
20
20
  sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
21
21
  uuid_view (string optional): additional filter - parameter
22
+ uuid_tag (string optional): additional filter - parameter
22
23
  tag_code (string optional): additional filter - parameter
23
24
  cost_category (string optional): additional filter - parameter
24
25
  cost_category_value (string optional): additional filter - parameter
@@ -32,14 +33,14 @@ class CostTagging(ApiManager):
32
33
  Returns: list"""
33
34
  if kwargs is None:
34
35
  kwargs = dict()
35
- official_params_list = ['sort_by', 'uuid_view', 'tag_code',
36
- 'cost_category', 'cost_category_value', 'null_fields', 'skip',
37
- 'limit', 'like', 'join', 'count']
38
- params.get('sort_by'), params.get('uuid_view'), params.get('tag_code'
39
- ), params.get('cost_category'), params.get('cost_category_value'
40
- ), params.get('null_fields'), params.get('skip'), params.get(
41
- 'limit'), params.get('like'), params.get('join'), params.get(
42
- 'count')
36
+ official_params_list = ['sort_by', 'uuid_view', 'uuid_tag',
37
+ 'tag_code', 'cost_category', 'cost_category_value',
38
+ 'null_fields', 'skip', 'limit', 'like', 'join', 'count']
39
+ params.get('sort_by'), params.get('uuid_view'), params.get('uuid_tag'
40
+ ), params.get('tag_code'), params.get('cost_category'), params.get(
41
+ 'cost_category_value'), params.get('null_fields'), params.get(
42
+ 'skip'), params.get('limit'), params.get('like'), params.get('join'
43
+ ), params.get('count')
43
44
  if not self._silence_warning:
44
45
  warning_wrong_parameters(self.cost_tagging.__name__, params,
45
46
  official_params_list)
@@ -56,18 +57,18 @@ class CostTagging(ApiManager):
56
57
  **payload: additional parameters for the API.
57
58
 
58
59
  Keyword Args:
59
- tag_code (string required): additional filter - payload
60
60
  cost_category_value (string required): additional filter - payload
61
61
  cost_category (string required): additional filter - payload
62
62
  uuid_view (string required): additional filter - payload
63
+ uuid_tag (string required): additional filter - payload
63
64
 
64
65
  Returns: list"""
65
66
  if kwargs is None:
66
67
  kwargs = dict()
67
- official_payload_list = ['tag_code', 'cost_category_value',
68
- 'cost_category', 'uuid_view']
69
- payload.get('tag_code'), payload.get('cost_category_value'
70
- ), payload.get('cost_category'), payload.get('uuid_view')
68
+ official_payload_list = ['cost_category_value', 'cost_category',
69
+ 'uuid_view', 'uuid_tag']
70
+ payload.get('cost_category_value'), payload.get('cost_category'
71
+ ), payload.get('uuid_view'), payload.get('uuid_tag')
71
72
  if not self._silence_warning:
72
73
  warning_wrong_parameters(self.cost_tagging_create.__name__,
73
74
  payload, official_payload_list)
@@ -112,18 +113,18 @@ class CostTagging(ApiManager):
112
113
  **payload: additional parameters for the API.
113
114
 
114
115
  Keyword Args:
115
- tag_code (string optional): additional filter - payload
116
116
  cost_category_value (string optional): additional filter - payload
117
117
  cost_category (string optional): additional filter - payload
118
118
  uuid_view (string optional): additional filter - payload
119
+ uuid_tag (string optional): additional filter - payload
119
120
 
120
121
  Returns: list"""
121
122
  if kwargs is None:
122
123
  kwargs = dict()
123
- official_payload_list = ['tag_code', 'cost_category_value',
124
- 'cost_category', 'uuid_view']
125
- payload.get('tag_code'), payload.get('cost_category_value'
126
- ), payload.get('cost_category'), payload.get('uuid_view')
124
+ official_payload_list = ['cost_category_value', 'cost_category',
125
+ 'uuid_view', 'uuid_tag']
126
+ payload.get('cost_category_value'), payload.get('cost_category'
127
+ ), payload.get('uuid_view'), payload.get('uuid_tag')
127
128
  if not self._silence_warning:
128
129
  warning_wrong_parameters(self.cost_tagging_put.__name__,
129
130
  payload, official_payload_list)
@@ -0,0 +1,213 @@
1
+ from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
2
+
3
+
4
+ class CostTreeNodes(ApiManager):
5
+ """Class that handles all the XAutomata cost_tree_nodes APIs"""
6
+
7
+ def cost_tree_nodes(self, warm_start: bool = False,
8
+ single_page: bool = False, page_size: int = 5000,
9
+ kwargs: dict = None, **params) -> list:
10
+ """Read Cost Tree Nodes
11
+
12
+ Args:
13
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
14
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
15
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
16
+ kwargs (dict, optional): additional parameters for execute. Default to None.
17
+ **params: additional parameters for the API.
18
+
19
+ Keyword Args:
20
+ sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
21
+ uuid_parent (string optional): additional filter - parameter
22
+ code (string optional): additional filter - parameter
23
+ description (string optional): additional filter - parameter
24
+ uuid_view (string optional): additional filter - parameter
25
+ budget (integer optional): additional filter - parameter
26
+ null_fields (string optional): additional filter - parameter
27
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
28
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
29
+ like (boolean optional): Se True, eventuali filtri richiesti dalla API vengono presi come porzioni di testo, se False il matching sul campo dei filtri deve essere esatto. Default to True. - parameter
30
+ join (boolean optional): Se join = true, ogni riga restituita conterra' chiavi aggiuntive che fanno riferimento ad altre entita', con cui la riga ha relazioni 1:1. Default to False - parameter
31
+ count (boolean optional): Se True nel header della risposta e' presente la dimensione massima a db della chiamata fatta, sconsigliabile perche raddoppia il tempo per chiamata. Default to False. - parameter
32
+
33
+ Returns: list"""
34
+ if kwargs is None:
35
+ kwargs = dict()
36
+ official_params_list = ['sort_by', 'uuid_parent', 'code',
37
+ 'description', 'uuid_view', 'budget', 'null_fields', 'skip',
38
+ 'limit', 'like', 'join', 'count']
39
+ params.get('sort_by'), params.get('uuid_parent'), params.get('code'
40
+ ), params.get('description'), params.get('uuid_view'), params.get(
41
+ 'budget'), params.get('null_fields'), params.get('skip'
42
+ ), params.get('limit'), params.get('like'), params.get('join'
43
+ ), params.get('count')
44
+ if not self._silence_warning:
45
+ warning_wrong_parameters(self.cost_tree_nodes.__name__, params,
46
+ official_params_list)
47
+ response = self.execute('GET', path=f'/cost_tree_nodes/',
48
+ single_page=single_page, page_size=page_size, warm_start=
49
+ warm_start, params=params, **kwargs)
50
+ return response
51
+
52
+ def cost_tree_nodes_create(self, kwargs: dict = None, **payload) -> list:
53
+ """Create Cost Tree Node
54
+
55
+ Args:
56
+ kwargs (dict, optional): additional parameters for execute. Default to None.
57
+ **payload: additional parameters for the API.
58
+
59
+ Keyword Args:
60
+ uuid_parent (string optional): additional filter - payload
61
+ code (string required): additional filter - payload
62
+ description (string optional): additional filter - payload
63
+ uuid_view (string required): additional filter - payload
64
+ budget (integer optional): additional filter - payload
65
+
66
+ Returns: list"""
67
+ if kwargs is None:
68
+ kwargs = dict()
69
+ official_payload_list = ['uuid_parent', 'code', 'description',
70
+ 'uuid_view', 'budget']
71
+ payload.get('uuid_parent'), payload.get('code'), payload.get(
72
+ 'description'), payload.get('uuid_view'), payload.get('budget')
73
+ if not self._silence_warning:
74
+ warning_wrong_parameters(self.cost_tree_nodes_create.__name__,
75
+ payload, official_payload_list)
76
+ response = self.execute('POST', path=f'/cost_tree_nodes/', payload=
77
+ payload, **kwargs)
78
+ return response
79
+
80
+ def cost_tree_node(self, uuid: str, warm_start: bool = False,
81
+ kwargs: dict = None, **params) -> list:
82
+ """Read Cost Tree Node
83
+
84
+ Args:
85
+ uuid (str, required): uuid
86
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
87
+ kwargs (dict, optional): additional parameters for execute. Default to None.
88
+ **params: additional parameters for the API.
89
+
90
+ Keyword Args:
91
+ join (boolean optional): Se join = true, ogni riga restituita conterra' chiavi aggiuntive che fanno riferimento ad altre entita', con cui la riga ha relazioni 1:1. Default to False - parameter
92
+
93
+ Returns: list"""
94
+ if kwargs is None:
95
+ kwargs = dict()
96
+ kwargs, params = handling_single_page_methods(kwargs=kwargs, params
97
+ =params)
98
+ official_params_list = ['join']
99
+ params.get('join')
100
+ if not self._silence_warning:
101
+ warning_wrong_parameters(self.cost_tree_node.__name__, params,
102
+ official_params_list)
103
+ response = self.execute('GET', path=f'/cost_tree_nodes/{uuid}',
104
+ warm_start=warm_start, params=params, **kwargs)
105
+ return response
106
+
107
+ def cost_tree_nodes_put(self, uuid: str, kwargs: dict = None, **payload
108
+ ) -> list:
109
+ """Update Cost Tree Node
110
+
111
+ Args:
112
+ uuid (str, required): uuid
113
+ kwargs (dict, optional): additional parameters for execute. Default to None.
114
+ **payload: additional parameters for the API.
115
+
116
+ Keyword Args:
117
+ uuid_parent (string optional): additional filter - payload
118
+ code (string optional): additional filter - payload
119
+ description (string optional): additional filter - payload
120
+ uuid_view (string optional): additional filter - payload
121
+ budget (integer optional): additional filter - payload
122
+
123
+ Returns: list"""
124
+ if kwargs is None:
125
+ kwargs = dict()
126
+ official_payload_list = ['uuid_parent', 'code', 'description',
127
+ 'uuid_view', 'budget']
128
+ payload.get('uuid_parent'), payload.get('code'), payload.get(
129
+ 'description'), payload.get('uuid_view'), payload.get('budget')
130
+ if not self._silence_warning:
131
+ warning_wrong_parameters(self.cost_tree_nodes_put.__name__,
132
+ payload, official_payload_list)
133
+ response = self.execute('PUT', path=f'/cost_tree_nodes/{uuid}',
134
+ payload=payload, **kwargs)
135
+ return response
136
+
137
+ def cost_tree_nodes_delete(self, uuid: str, kwargs: dict = None) -> list:
138
+ """Delete Cost Tree Node
139
+
140
+ Args:
141
+ uuid (str, required): uuid
142
+ kwargs (dict, optional): additional parameters for execute. Default to None.
143
+
144
+ Returns: list"""
145
+ if kwargs is None:
146
+ kwargs = dict()
147
+ response = self.execute('DELETE', path=f'/cost_tree_nodes/{uuid}',
148
+ **kwargs)
149
+ return response
150
+
151
+ def cost_tree_nodes_navigate_tree(self, uuid: str,
152
+ warm_start: bool = False, kwargs: dict = None, **params) -> list:
153
+ """Get Tree From Node
154
+
155
+ Args:
156
+ uuid (str, required): uuid
157
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
158
+ kwargs (dict, optional): additional parameters for execute. Default to None.
159
+ **params: additional parameters for the API.
160
+
161
+ Keyword Args:
162
+ ts_start (string required): additional filter - parameter
163
+ ts_end (string required): additional filter - parameter
164
+
165
+ Returns: list"""
166
+ if kwargs is None:
167
+ kwargs = dict()
168
+ kwargs, params = handling_single_page_methods(kwargs=kwargs, params
169
+ =params)
170
+ official_params_list = ['ts_start', 'ts_end']
171
+ params.get('ts_start'), params.get('ts_end')
172
+ if not self._silence_warning:
173
+ warning_wrong_parameters(self.cost_tree_nodes_navigate_tree.
174
+ __name__, params, official_params_list)
175
+ response = self.execute('GET', path=
176
+ f'/cost_tree_nodes/navigate_tree/{uuid}', warm_start=warm_start,
177
+ params=params, **kwargs)
178
+ return response
179
+
180
+ def cost_tree_nodes_get_node_resources(self, uuid: str,
181
+ warm_start: bool = False, single_page: bool = False,
182
+ page_size: int = 5000, kwargs: dict = None, **params) -> list:
183
+ """Get Resources From Node
184
+
185
+ Args:
186
+ uuid (str, required): uuid
187
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
188
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
189
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
190
+ kwargs (dict, optional): additional parameters for execute. Default to None.
191
+ **params: additional parameters for the API.
192
+
193
+ Keyword Args:
194
+ ts_start (string required): additional filter - parameter
195
+ ts_end (string required): additional filter - parameter
196
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
197
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
198
+
199
+ Returns: list"""
200
+ if kwargs is None:
201
+ kwargs = dict()
202
+ official_params_list = ['ts_start', 'ts_end', 'skip', 'limit']
203
+ params.get('ts_start'), params.get('ts_end'), params.get('skip'
204
+ ), params.get('limit')
205
+ if not self._silence_warning:
206
+ warning_wrong_parameters(self.
207
+ cost_tree_nodes_get_node_resources.__name__, params,
208
+ official_params_list)
209
+ response = self.execute('GET', path=
210
+ f'/cost_tree_nodes/get_node_resources/{uuid}', single_page=
211
+ single_page, page_size=page_size, warm_start=warm_start, params
212
+ =params, **kwargs)
213
+ return response
@@ -0,0 +1,155 @@
1
+ from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
2
+
3
+
4
+ class CostTreeResources(ApiManager):
5
+ """Class that handles all the XAutomata cost_tree_resources APIs"""
6
+
7
+ def cost_tree_resources(self, warm_start: bool = False,
8
+ single_page: bool = False, page_size: int = 5000,
9
+ kwargs: dict = None, **params) -> list:
10
+ """Read Cost Tree Resources
11
+
12
+ Args:
13
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
14
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
15
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
16
+ kwargs (dict, optional): additional parameters for execute. Default to None.
17
+ **params: additional parameters for the API.
18
+
19
+ Keyword Args:
20
+ sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
21
+ uuid_tree_node (string optional): additional filter - parameter
22
+ uuid_tag (string optional): additional filter - parameter
23
+ cost_category (string optional): additional filter - parameter
24
+ cost_category_value (string optional): additional filter - parameter
25
+ percentage (integer optional): additional filter - parameter
26
+ null_fields (string optional): additional filter - parameter
27
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
28
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
29
+ like (boolean optional): Se True, eventuali filtri richiesti dalla API vengono presi come porzioni di testo, se False il matching sul campo dei filtri deve essere esatto. Default to True. - parameter
30
+ join (boolean optional): Se join = true, ogni riga restituita conterra' chiavi aggiuntive che fanno riferimento ad altre entita', con cui la riga ha relazioni 1:1. Default to False - parameter
31
+ count (boolean optional): Se True nel header della risposta e' presente la dimensione massima a db della chiamata fatta, sconsigliabile perche raddoppia il tempo per chiamata. Default to False. - parameter
32
+
33
+ Returns: list"""
34
+ if kwargs is None:
35
+ kwargs = dict()
36
+ official_params_list = ['sort_by', 'uuid_tree_node', 'uuid_tag',
37
+ 'cost_category', 'cost_category_value', 'percentage',
38
+ 'null_fields', 'skip', 'limit', 'like', 'join', 'count']
39
+ params.get('sort_by'), params.get('uuid_tree_node'), params.get(
40
+ 'uuid_tag'), params.get('cost_category'), params.get(
41
+ 'cost_category_value'), params.get('percentage'), params.get(
42
+ 'null_fields'), params.get('skip'), params.get('limit'
43
+ ), params.get('like'), params.get('join'), params.get('count')
44
+ if not self._silence_warning:
45
+ warning_wrong_parameters(self.cost_tree_resources.__name__,
46
+ params, official_params_list)
47
+ response = self.execute('GET', path=f'/cost_tree_resources/',
48
+ single_page=single_page, page_size=page_size, warm_start=
49
+ warm_start, params=params, **kwargs)
50
+ return response
51
+
52
+ def cost_tree_resources_create(self, kwargs: dict = None, **payload
53
+ ) -> list:
54
+ """Create Cost Tree Resource
55
+
56
+ Args:
57
+ kwargs (dict, optional): additional parameters for execute. Default to None.
58
+ **payload: additional parameters for the API.
59
+
60
+ Keyword Args:
61
+ uuid_tree_node (string required): additional filter - payload
62
+ cost_category (string required): additional filter - payload
63
+ cost_category_value (string required): additional filter - payload
64
+ percentage (integer optional): additional filter - payload
65
+
66
+ Returns: list"""
67
+ if kwargs is None:
68
+ kwargs = dict()
69
+ official_payload_list = ['uuid_tree_node', 'cost_category',
70
+ 'cost_category_value', 'percentage']
71
+ payload.get('uuid_tree_node'), payload.get('cost_category'
72
+ ), payload.get('cost_category_value'), payload.get('percentage')
73
+ if not self._silence_warning:
74
+ warning_wrong_parameters(self.cost_tree_resources_create.
75
+ __name__, payload, official_payload_list)
76
+ response = self.execute('POST', path=f'/cost_tree_resources/',
77
+ payload=payload, **kwargs)
78
+ return response
79
+
80
+ def cost_tree_resources_uuid_tree_node(self, uuid_tree_node: str,
81
+ uuid_tag: str, warm_start: bool = False, kwargs: dict = None, **params
82
+ ) -> list:
83
+ """Read Cost Tree Resources
84
+
85
+ Args:
86
+ uuid_tree_node (str, required): uuid_tree_node
87
+ uuid_tag (str, required): uuid_tag
88
+ warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
89
+ kwargs (dict, optional): additional parameters for execute. Default to None.
90
+ **params: additional parameters for the API.
91
+
92
+ Keyword Args:
93
+ join (boolean optional): Se join = true, ogni riga restituita conterra' chiavi aggiuntive che fanno riferimento ad altre entita', con cui la riga ha relazioni 1:1. Default to False - parameter
94
+
95
+ Returns: list"""
96
+ if kwargs is None:
97
+ kwargs = dict()
98
+ kwargs, params = handling_single_page_methods(kwargs=kwargs, params
99
+ =params)
100
+ official_params_list = ['join']
101
+ params.get('join')
102
+ if not self._silence_warning:
103
+ warning_wrong_parameters(self.cost_tree_resources.__name__,
104
+ params, official_params_list)
105
+ response = self.execute('GET', path=
106
+ f'/cost_tree_resources/{uuid_tree_node}/{uuid_tag}', warm_start
107
+ =warm_start, params=params, **kwargs)
108
+ return response
109
+
110
+ def cost_tree_resources_put(self, uuid_tree_node: str, uuid_tag: str,
111
+ kwargs: dict = None, **payload) -> list:
112
+ """Update Cost Tree Resources
113
+
114
+ Args:
115
+ uuid_tree_node (str, required): uuid_tree_node
116
+ uuid_tag (str, required): uuid_tag
117
+ kwargs (dict, optional): additional parameters for execute. Default to None.
118
+ **payload: additional parameters for the API.
119
+
120
+ Keyword Args:
121
+ uuid_tree_node (string optional): additional filter - payload
122
+ cost_category (string optional): additional filter - payload
123
+ cost_category_value (string optional): additional filter - payload
124
+ percentage (integer optional): additional filter - payload
125
+
126
+ Returns: list"""
127
+ if kwargs is None:
128
+ kwargs = dict()
129
+ official_payload_list = ['uuid_tree_node', 'cost_category',
130
+ 'cost_category_value', 'percentage']
131
+ payload.get('uuid_tree_node'), payload.get('cost_category'
132
+ ), payload.get('cost_category_value'), payload.get('percentage')
133
+ if not self._silence_warning:
134
+ warning_wrong_parameters(self.cost_tree_resources_put.__name__,
135
+ payload, official_payload_list)
136
+ response = self.execute('PUT', path=
137
+ f'/cost_tree_resources/{uuid_tree_node}/{uuid_tag}', payload=
138
+ payload, **kwargs)
139
+ return response
140
+
141
+ def cost_tree_resources_delete(self, uuid_tree_node: str, uuid_tag: str,
142
+ kwargs: dict = None) -> list:
143
+ """Delete Cost Tree Resources
144
+
145
+ Args:
146
+ uuid_tree_node (str, required): uuid_tree_node
147
+ uuid_tag (str, required): uuid_tag
148
+ kwargs (dict, optional): additional parameters for execute. Default to None.
149
+
150
+ Returns: list"""
151
+ if kwargs is None:
152
+ kwargs = dict()
153
+ response = self.execute('DELETE', path=
154
+ f'/cost_tree_resources/{uuid_tree_node}/{uuid_tag}', **kwargs)
155
+ return response
@@ -20,6 +20,7 @@ class CostViews(ApiManager):
20
20
  sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
21
21
  name (string optional): additional filter - parameter
22
22
  description (string optional): additional filter - parameter
23
+ type (string optional): additional filter - parameter
23
24
  null_fields (string optional): additional filter - parameter
24
25
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
25
26
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
@@ -30,12 +31,12 @@ class CostViews(ApiManager):
30
31
  Returns: list"""
31
32
  if kwargs is None:
32
33
  kwargs = dict()
33
- official_params_list = ['sort_by', 'name', 'description',
34
+ official_params_list = ['sort_by', 'name', 'description', 'type',
34
35
  'null_fields', 'skip', 'limit', 'like', 'join', 'count']
35
36
  params.get('sort_by'), params.get('name'), params.get('description'
36
- ), params.get('null_fields'), params.get('skip'), params.get(
37
- 'limit'), params.get('like'), params.get('join'), params.get(
38
- 'count')
37
+ ), params.get('type'), params.get('null_fields'), params.get('skip'
38
+ ), params.get('limit'), params.get('like'), params.get('join'
39
+ ), params.get('count')
39
40
  if not self._silence_warning:
40
41
  warning_wrong_parameters(self.cost_views.__name__, params,
41
42
  official_params_list)
@@ -53,13 +54,14 @@ class CostViews(ApiManager):
53
54
 
54
55
  Keyword Args:
55
56
  name (string required): additional filter - payload
56
- description (string required): additional filter - payload
57
+ description (string optional): additional filter - payload
58
+ type (string optional): additional filter - payload
57
59
 
58
60
  Returns: list"""
59
61
  if kwargs is None:
60
62
  kwargs = dict()
61
- official_payload_list = ['name', 'description']
62
- payload.get('name'), payload.get('description')
63
+ official_payload_list = ['name', 'description', 'type']
64
+ payload.get('name'), payload.get('description'), payload.get('type')
63
65
  if not self._silence_warning:
64
66
  warning_wrong_parameters(self.cost_views_create.__name__,
65
67
  payload, official_payload_list)
@@ -106,12 +108,13 @@ class CostViews(ApiManager):
106
108
  Keyword Args:
107
109
  name (string optional): additional filter - payload
108
110
  description (string optional): additional filter - payload
111
+ type (string optional): additional filter - payload
109
112
 
110
113
  Returns: list"""
111
114
  if kwargs is None:
112
115
  kwargs = dict()
113
- official_payload_list = ['name', 'description']
114
- payload.get('name'), payload.get('description')
116
+ official_payload_list = ['name', 'description', 'type']
117
+ payload.get('name'), payload.get('description'), payload.get('type')
115
118
  if not self._silence_warning:
116
119
  warning_wrong_parameters(self.cost_views_put.__name__, payload,
117
120
  official_payload_list)
@@ -432,7 +432,7 @@ class Dispatchers(ApiManager):
432
432
 
433
433
  def dispatchers_objects_delete(self, uuid: str, uuid_object: str,
434
434
  kwargs: dict = None) -> list:
435
- """Removeect
435
+ """Remove Object
436
436
 
437
437
  Args:
438
438
  uuid (str, required): uuid
@@ -287,7 +287,7 @@ class Downtimes(ApiManager):
287
287
 
288
288
  def downtimes_objects_delete(self, uuid: str, uuid_object: str,
289
289
  kwargs: dict = None) -> list:
290
- """Removeect
290
+ """Remove Object
291
291
 
292
292
  Args:
293
293
  uuid (str, required): uuid
@@ -39,6 +39,7 @@ class TsCostManagement(ApiManager):
39
39
  local_currency (string optional): additional filter - parameter
40
40
  provider_currency (string optional): additional filter - parameter
41
41
  uuid_customer (string optional): additional filter - parameter
42
+ resource_id (string optional): additional filter - parameter
42
43
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
43
44
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
44
45
  like (boolean optional): Se True, eventuali filtri richiesti dalla API vengono presi come porzioni di testo, se False il matching sul campo dei filtri deve essere esatto. Default to True. - parameter
@@ -53,8 +54,8 @@ class TsCostManagement(ApiManager):
53
54
  'subscription_type', 'subscription_id', 'subscription_name',
54
55
  'family', 'category', 'subcategory', 'object', 'metric', 'unit',
55
56
  'resource_group', 'reservation_name', 'publisher_name',
56
- 'local_currency', 'provider_currency', 'uuid_customer', 'skip',
57
- 'limit', 'like', 'join', 'count']
57
+ 'local_currency', 'provider_currency', 'uuid_customer',
58
+ 'resource_id', 'skip', 'limit', 'like', 'join', 'count']
58
59
  params.get('sort_by'), params.get('null_fields'), params.get(
59
60
  'uuid_metric'), params.get('date_start'), params.get('date_end'
60
61
  ), params.get('cloud_provider'), params.get('resource_location'
@@ -65,8 +66,8 @@ class TsCostManagement(ApiManager):
65
66
  'resource_group'), params.get('reservation_name'), params.get(
66
67
  'publisher_name'), params.get('local_currency'), params.get(
67
68
  'provider_currency'), params.get('uuid_customer'), params.get(
68
- 'skip'), params.get('limit'), params.get('like'), params.get('join'
69
- ), params.get('count')
69
+ 'resource_id'), params.get('skip'), params.get('limit'
70
+ ), params.get('like'), params.get('join'), params.get('count')
70
71
  if not self._silence_warning:
71
72
  warning_wrong_parameters(self.ts_cost_management.__name__,
72
73
  params, official_params_list)
@@ -116,6 +117,7 @@ class TsCostManagement(ApiManager):
116
117
  resource_group (string required): additional filter - payload
117
118
  reservation_name (string required): additional filter - payload
118
119
  publisher_name (string required): additional filter - payload
120
+ resource_id (string required): additional filter - payload
119
121
  tenant_id (string optional): additional filter - payload
120
122
 
121
123
  Returns: list"""
@@ -130,8 +132,8 @@ class TsCostManagement(ApiManager):
130
132
  'unit_revenue_pc', 'total_revenue_pc', 'cumulative_qnt',
131
133
  'cumulative_unit_cost', 'cumulative_total_cost',
132
134
  'cumulative_unit_revenue', 'cumulative_total_revenue',
133
- 'resource_group', 'reservation_name', 'publisher_name', 'tenant_id'
134
- ]
135
+ 'resource_group', 'reservation_name', 'publisher_name',
136
+ 'resource_id', 'tenant_id']
135
137
  payload.get('uuid_metric'), payload.get('date'), payload.get(
136
138
  'cloud_provider'), payload.get('resource_location'), payload.get(
137
139
  'subscription_type'), payload.get('subscription_id'), payload.get(
@@ -147,7 +149,8 @@ class TsCostManagement(ApiManager):
147
149
  ), payload.get('cumulative_total_cost'), payload.get(
148
150
  'cumulative_unit_revenue'), payload.get('cumulative_total_revenue'
149
151
  ), payload.get('resource_group'), payload.get('reservation_name'
150
- ), payload.get('publisher_name'), payload.get('tenant_id')
152
+ ), payload.get('publisher_name'), payload.get('resource_id'
153
+ ), payload.get('tenant_id')
151
154
  if not self._silence_warning:
152
155
  warning_wrong_parameters(self.ts_cost_management_create.
153
156
  __name__, payload, official_payload_list)
@@ -0,0 +1,37 @@
1
+ def dict_by_request(responce_list: list, univocal_keys: list):
2
+ """
3
+ Given a responce list it turn the List[Dict] into a Dict[Dict] where the keys are the univocal_keys given in the arguments.
4
+
5
+ Args:
6
+ responce_list (list[dict]): API responce
7
+ univocal_keys (list[str]): list of keys to use to identify the univocal arguments to be turned into the new dict keys
8
+
9
+ Returns: dict
10
+ """
11
+ responce_dict = dict()
12
+ for cont in responce_list:
13
+ chiave = tuple(cont[k] for k in univocal_keys)
14
+ responce_dict[chiave] = cont
15
+ return responce_dict
16
+
17
+
18
+ def order_by_request(params_list, responce_list, univocal_keys):
19
+ """
20
+ Given a API responce, its univocal keys and the params list used to get that responce, a new
21
+ Args:
22
+ params_list: params given to the API
23
+ responce_list: API responce
24
+ univocal_keys: keys that represents the univocal field of the responce
25
+
26
+ Returns: Dict
27
+
28
+ """
29
+ responce_dict = dict_by_request(responce_list, univocal_keys)
30
+ response_content = [None for _ in range(len(params_list))]
31
+ for i, ele in enumerate(params_list):
32
+ chiave = tuple(ele[k] for k in univocal_keys)
33
+ if chiave in responce_dict:
34
+ response_content[i] = responce_dict[chiave]
35
+ else:
36
+ response_content[i] = None
37
+ return response_content
@@ -0,0 +1 @@
1
+ version = '3.16.0'
@@ -16,7 +16,7 @@ version = version[0].split("'")[1]
16
16
 
17
17
  # version go
18
18
  tqdm = 'tqdm==4.64.1'
19
- urllib3 = 'urllib3==1.26.17'
19
+ urllib3 = 'urllib3==2.0.4'
20
20
  requests = 'requests==2.31.0'
21
21
  # version end
22
22
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xautomata-hive
3
- Version: 3.15.6
3
+ Version: 3.16.0
4
4
  Home-page: https://github.com/sherlogic/xautomata-hive.git
5
5
  Author: Enrico Ferro - Andrea Jacassi
6
6
  Author-email:
@@ -9,7 +9,7 @@ Requires-Python: >=3.8.0
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: tqdm==4.64.1
12
- Requires-Dist: urllib3==1.26.17
12
+ Requires-Dist: urllib3==2.0.4
13
13
  Requires-Dist: requests==2.31.0
14
14
 
15
15
  # Xautomata API
@@ -17,6 +17,8 @@ hive/cookbook/calendars.py
17
17
  hive/cookbook/contacts.py
18
18
  hive/cookbook/cost_tagging.py
19
19
  hive/cookbook/cost_tags.py
20
+ hive/cookbook/cost_tree_nodes.py
21
+ hive/cookbook/cost_tree_resources.py
20
22
  hive/cookbook/cost_views.py
21
23
  hive/cookbook/customers.py
22
24
  hive/cookbook/dashboards.py
@@ -1,3 +1,3 @@
1
1
  tqdm==4.64.1
2
- urllib3==1.26.17
2
+ urllib3==2.0.4
3
3
  requests==2.31.0
@@ -1,18 +0,0 @@
1
- def dict_by_request(responce_list, univocal_keys):
2
- responce_dict = dict()
3
- for cont in responce_list:
4
- chiave = tuple(cont[k] for k in univocal_keys)
5
- responce_dict[chiave] = cont
6
- return responce_dict
7
-
8
-
9
- def order_by_request(params_list, responce_list, univocal_keys):
10
- responce_dict = dict_by_request(responce_list, univocal_keys)
11
- response_content = [None for _ in range(len(params_list))]
12
- for i, ele in enumerate(params_list):
13
- chiave = tuple(ele[k] for k in univocal_keys)
14
- if chiave in responce_dict:
15
- response_content[i] = responce_dict[chiave]
16
- else:
17
- response_content[i] = None
18
- return response_content
@@ -1 +0,0 @@
1
- version = '3.15.6'
File without changes