xautomata-hive 3.16.5__tar.gz → 3.17.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 (75) hide show
  1. {xautomata_hive-3.16.5/xautomata_hive.egg-info → xautomata_hive-3.17.0}/PKG-INFO +1 -1
  2. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/api.py +16 -9
  3. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/cost_tags.py +48 -0
  4. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/cost_tree_nodes.py +4 -4
  5. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/customers.py +66 -0
  6. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/dashboards.py +76 -17
  7. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/login.py +3 -2
  8. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/objects.py +48 -0
  9. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/services.py +7 -5
  10. xautomata_hive-3.17.0/hive/version.py +1 -0
  11. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0/xautomata_hive.egg-info}/PKG-INFO +1 -1
  12. xautomata_hive-3.16.5/hive/version.py +0 -1
  13. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/LICENSE +0 -0
  14. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/README.md +0 -0
  15. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/__init__.py +0 -0
  16. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/__init__.py +0 -0
  17. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/acl_docs.py +0 -0
  18. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/acl_overrides.py +0 -0
  19. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/analytics.py +0 -0
  20. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/anomalies.py +0 -0
  21. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/calendars.py +0 -0
  22. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/contacts.py +0 -0
  23. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/cost_tagging.py +0 -0
  24. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/cost_tree_resources.py +0 -0
  25. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/cost_views.py +0 -0
  26. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/dispatchers.py +0 -0
  27. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/downtimes.py +0 -0
  28. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/external_tickets.py +0 -0
  29. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/features.py +0 -0
  30. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/firmware_updates.py +0 -0
  31. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/google.py +0 -0
  32. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/groups.py +0 -0
  33. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/jobs.py +0 -0
  34. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/last_status.py +0 -0
  35. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/messages.py +0 -0
  36. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/metric_ingest.py +0 -0
  37. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/metric_types.py +0 -0
  38. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/metrics.py +0 -0
  39. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/microsoft.py +0 -0
  40. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/notification_provider_types.py +0 -0
  41. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/notification_providers.py +0 -0
  42. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/opening_reasons.py +0 -0
  43. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/probe_types.py +0 -0
  44. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/probes.py +0 -0
  45. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/probes_log_ingest.py +0 -0
  46. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/profile_topics.py +0 -0
  47. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/reason_for_closure.py +0 -0
  48. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/retention_rules.py +0 -0
  49. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/schedules.py +0 -0
  50. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/sites.py +0 -0
  51. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/terms_and_conditions.py +0 -0
  52. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/tree_hierarchy.py +0 -0
  53. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_cost_azure_raw.py +0 -0
  54. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_cost_management.py +0 -0
  55. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_metric_status.py +0 -0
  56. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_metric_value.py +0 -0
  57. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_ntop_flows.py +0 -0
  58. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_service_status.py +0 -0
  59. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/ts_service_value.py +0 -0
  60. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/users.py +0 -0
  61. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/users_notifications.py +0 -0
  62. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/virtual_domains.py +0 -0
  63. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/webhooks.py +0 -0
  64. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/widget_groups.py +0 -0
  65. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/cookbook/widgets.py +0 -0
  66. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/decorators.py +0 -0
  67. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/exceptions.py +0 -0
  68. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/infrastrucure_keys.py +0 -0
  69. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/hive/tools.py +0 -0
  70. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/setup.cfg +0 -0
  71. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/setup.py +0 -0
  72. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/xautomata_hive.egg-info/SOURCES.txt +0 -0
  73. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/xautomata_hive.egg-info/dependency_links.txt +0 -0
  74. {xautomata_hive-3.16.5 → xautomata_hive-3.17.0}/xautomata_hive.egg-info/requires.txt +0 -0
  75. {xautomata_hive-3.16.5 → xautomata_hive-3.17.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.16.5
3
+ Version: 3.17.0
4
4
  Home-page: https://github.com/sherlogic/xautomata-hive.git
5
5
  Author: Enrico Ferro - Andrea Jacassi
6
6
  Author-email:
@@ -12,11 +12,13 @@ from hive.infrastrucure_keys import Keys
12
12
  import warnings
13
13
  import gc
14
14
  import functools
15
-
15
+ import logging
16
16
 
17
17
  FORCE_STATUS = [429, 500, 502, 503, 504]
18
18
  # METHODS = ["HEAD", "GET", "OPTIONS", "POST"]
19
19
 
20
+ logger = logging.getLogger('hive')
21
+
20
22
 
21
23
  def get_session(timeout=150, total=5, backoff_factor=5):
22
24
  """
@@ -50,6 +52,7 @@ class ApiManager:
50
52
  _timeout_retry = 1 # di default non si fanno retry sui timeout
51
53
  _timeout_sleep_time = 120 # tempo di attesa tra un retry e quello successivo in caso di timeout
52
54
  _silence_warning = False # da implementare
55
+ num_items = None # serve per quando si mette la count a True, di default vale 0
53
56
 
54
57
  def __init__(self, root, user, password, ssl_verify: bool = True):
55
58
 
@@ -73,6 +76,7 @@ class ApiManager:
73
76
  response = get_session(self._timeout, self._timeout_get_session_retry, self._timeout_get_session_backoff_factor).post(f'{self.root}/login/access-token', auth_date, verify=self._SSL_verify)
74
77
  response.raise_for_status()
75
78
  self.token = json.loads(response.content.decode('utf-8'))['access_token']
79
+ logger.debug('authenticated')
76
80
 
77
81
  def openapi(self):
78
82
  """metodo che restituisce gli schema degli end point"""
@@ -157,20 +161,23 @@ class ApiManager:
157
161
  @timeout_retry(max_tries=self._timeout_retry, sleep_time=self._timeout_sleep_time)
158
162
  @ratelimiter
159
163
  def run_request(_mode, _url, _headers, _payload, _params, **_kwargs):
164
+ self.num_items = None # inizializzo a 0 il valore della count, cosi che non possa leggere il numero sbagliato dopo una richiesta non corretta
165
+
166
+ logger.debug(f'request url: {_url}')
167
+ logger.debug(f'request params (skip and limit may differ from your setting due pagination): {_params}')
168
+ logger.debug(f'request payload: {_payload}')
169
+
160
170
  response = get_session(self._timeout, self._timeout_get_session_retry, self._timeout_get_session_backoff_factor).request(_mode, url=_url, json=_payload, params=_params, headers=_headers, verify=self._SSL_verify, **_kwargs)
161
171
  if response.status_code == 401: raise UnauthorizedException
162
172
  if response.status_code != 200 and response.status_code != 504: # 504 non e' gestito dalle API per cui la responce non sarebbe json serializable
163
- print()
164
- print('-' * 50)
165
- print('error message:')
166
- print(response.json())
167
- print('-' * 50)
168
- print()
173
+ logger.error(response.json())
169
174
  response.raise_for_status()
170
175
 
171
176
  if response.status_code == 200 and _params.get('count', False):
172
- num_items = response.headers.get('x-num-items', 'count not found')
173
- return response.json(), num_items
177
+ self.num_items = response.headers.get('x-num-items', None)
178
+
179
+ logger.debug(f'responce: {response.json()}')
180
+ logger.debug(f'header: {response.headers}')
174
181
 
175
182
  return response.json()
176
183
 
@@ -74,6 +74,54 @@ class CostTags(ApiManager):
74
74
  payload, **kwargs)
75
75
  return response
76
76
 
77
+ def cost_tags_query(self, warm_start: bool = False,
78
+ single_page: bool = False, page_size: int = 5000,
79
+ kwargs: dict = None, **params) -> list:
80
+ """Read Cost Tags
81
+
82
+ Args:
83
+ 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.
84
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
85
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
86
+ kwargs (dict, optional): additional parameters for execute. Default to None.
87
+ **params: additional parameters for the API.
88
+
89
+ Keyword Args:
90
+ date_start (string required): additional filter - parameter
91
+ date_end (string required): additional filter - parameter
92
+ select_operation (None required): additional filter - parameter
93
+ selected_tags (string required): additional filter - parameter
94
+ unselect_operation (None optional): additional filter - parameter
95
+ unselected_tags (string optional): additional filter - parameter
96
+ 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
97
+ null_fields (string optional): additional filter - parameter
98
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
99
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
100
+ 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
101
+ 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
102
+ 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
103
+
104
+ Returns: list"""
105
+ if kwargs is None:
106
+ kwargs = dict()
107
+ official_params_list = ['date_start', 'date_end',
108
+ 'select_operation', 'selected_tags', 'unselect_operation',
109
+ 'unselected_tags', 'sort_by', 'null_fields', 'skip', 'limit',
110
+ 'like', 'join', 'count']
111
+ params.get('date_start'), params.get('date_end'), params.get(
112
+ 'select_operation'), params.get('selected_tags'), params.get(
113
+ 'unselect_operation'), params.get('unselected_tags'), params.get(
114
+ 'sort_by'), params.get('null_fields'), params.get('skip'
115
+ ), params.get('limit'), params.get('like'), params.get('join'
116
+ ), params.get('count')
117
+ if not self._silence_warning:
118
+ warning_wrong_parameters(self.cost_tags_query.__name__, params,
119
+ official_params_list)
120
+ response = self.execute('GET', path=f'/cost_tags/query/',
121
+ single_page=single_page, page_size=page_size, warm_start=
122
+ warm_start, params=params, **kwargs)
123
+ return response
124
+
77
125
  def cost_tag(self, uuid: str, warm_start: bool = False,
78
126
  kwargs: dict = None, **params) -> list:
79
127
  """Read Cost Tag
@@ -191,16 +191,16 @@ class CostTreeNodes(ApiManager):
191
191
  **params: additional parameters for the API.
192
192
 
193
193
  Keyword Args:
194
- ts_start (string required): additional filter - parameter
195
- ts_end (string required): additional filter - parameter
194
+ date_start (string required): additional filter - parameter
195
+ date_end (string required): additional filter - parameter
196
196
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
197
197
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
198
198
 
199
199
  Returns: list"""
200
200
  if kwargs is None:
201
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'
202
+ official_params_list = ['date_start', 'date_end', 'skip', 'limit']
203
+ params.get('date_start'), params.get('date_end'), params.get('skip'
204
204
  ), params.get('limit')
205
205
  if not self._silence_warning:
206
206
  warning_wrong_parameters(self.
@@ -734,6 +734,72 @@ class Customers(ApiManager):
734
734
  warm_start=warm_start, **kwargs)
735
735
  return response
736
736
 
737
+ def customers_dashboards(self, uuid: str, warm_start: bool = False,
738
+ single_page: bool = False, page_size: int = 5000,
739
+ kwargs: dict = None, **params) -> list:
740
+ """List Dashboard
741
+
742
+ Args:
743
+ uuid (str, required): uuid
744
+ 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.
745
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
746
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
747
+ kwargs (dict, optional): additional parameters for execute. Default to None.
748
+ **params: additional parameters for the API.
749
+
750
+ Keyword Args:
751
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
752
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
753
+ 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
754
+ 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
755
+ 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
756
+
757
+ Returns: list"""
758
+ if kwargs is None:
759
+ kwargs = dict()
760
+ official_params_list = ['skip', 'limit', 'like', 'join', 'count']
761
+ params.get('skip'), params.get('limit'), params.get('like'
762
+ ), params.get('join'), params.get('count')
763
+ if not self._silence_warning:
764
+ warning_wrong_parameters(self.customers_dashboards.__name__,
765
+ params, official_params_list)
766
+ response = self.execute('GET', path=f'/customers/{uuid}/dashboards',
767
+ single_page=single_page, page_size=page_size, warm_start=
768
+ warm_start, params=params, **kwargs)
769
+ return response
770
+
771
+ def customers_dashboards_create(self, uuid: str, uuid_dashboard: str,
772
+ kwargs: dict = None) -> list:
773
+ """Create Customer Dashboard Association
774
+
775
+ Args:
776
+ uuid (str, required): uuid
777
+ uuid_dashboard (str, required): uuid_dashboard
778
+ kwargs (dict, optional): additional parameters for execute. Default to None.
779
+
780
+ Returns: list"""
781
+ if kwargs is None:
782
+ kwargs = dict()
783
+ response = self.execute('POST', path=
784
+ f'/customers/{uuid}/dashboards/{uuid_dashboard}', **kwargs)
785
+ return response
786
+
787
+ def customers_dashboards_delete(self, uuid: str, uuid_dashboard: str,
788
+ kwargs: dict = None) -> list:
789
+ """Remove Customer Dashboard Association
790
+
791
+ Args:
792
+ uuid (str, required): uuid
793
+ uuid_dashboard (str, required): uuid_dashboard
794
+ kwargs (dict, optional): additional parameters for execute. Default to None.
795
+
796
+ Returns: list"""
797
+ if kwargs is None:
798
+ kwargs = dict()
799
+ response = self.execute('DELETE', path=
800
+ f'/customers/{uuid}/dashboards/{uuid_dashboard}', **kwargs)
801
+ return response
802
+
737
803
  def customers_bulk(self, payload: list, warm_start: bool = False,
738
804
  single_page: bool = False, page_size: int = 50, kwargs: dict = None,
739
805
  **params) -> list:
@@ -23,7 +23,6 @@ class Dashboards(ApiManager):
23
23
  description (string optional): additional filter - parameter
24
24
  type (string optional): additional filter - parameter
25
25
  username (string optional): additional filter - parameter
26
- profile (string optional): additional filter - parameter
27
26
  priority (integer optional): additional filter - parameter
28
27
  refresh_interval (integer optional): additional filter - parameter
29
28
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
@@ -36,14 +35,13 @@ class Dashboards(ApiManager):
36
35
  if kwargs is None:
37
36
  kwargs = dict()
38
37
  official_params_list = ['sort_by', 'null_fields', 'name',
39
- 'description', 'type', 'username', 'profile', 'priority',
38
+ 'description', 'type', 'username', 'priority',
40
39
  'refresh_interval', 'skip', 'limit', 'like', 'join', 'count']
41
40
  params.get('sort_by'), params.get('null_fields'), params.get('name'
42
41
  ), params.get('description'), params.get('type'), params.get(
43
- 'username'), params.get('profile'), params.get('priority'
44
- ), params.get('refresh_interval'), params.get('skip'), params.get(
45
- 'limit'), params.get('like'), params.get('join'), params.get(
46
- 'count')
42
+ 'username'), params.get('priority'), params.get('refresh_interval'
43
+ ), params.get('skip'), params.get('limit'), params.get('like'
44
+ ), params.get('join'), params.get('count')
47
45
  if not self._silence_warning:
48
46
  warning_wrong_parameters(self.dashboards.__name__, params,
49
47
  official_params_list)
@@ -64,7 +62,6 @@ class Dashboards(ApiManager):
64
62
  type (string optional): additional filter - payload
65
63
  username (string optional): additional filter - payload
66
64
  description (string optional): additional filter - payload
67
- profile (string required): additional filter - payload
68
65
  priority (integer optional): additional filter - payload
69
66
  refresh_interval (integer optional): additional filter - payload
70
67
  image_name (string optional): additional filter - payload
@@ -73,11 +70,10 @@ class Dashboards(ApiManager):
73
70
  if kwargs is None:
74
71
  kwargs = dict()
75
72
  official_payload_list = ['name', 'type', 'username', 'description',
76
- 'profile', 'priority', 'refresh_interval', 'image_name']
73
+ 'priority', 'refresh_interval', 'image_name']
77
74
  payload.get('name'), payload.get('type'), payload.get('username'
78
- ), payload.get('description'), payload.get('profile'), payload.get(
79
- 'priority'), payload.get('refresh_interval'), payload.get(
80
- 'image_name')
75
+ ), payload.get('description'), payload.get('priority'
76
+ ), payload.get('refresh_interval'), payload.get('image_name')
81
77
  if not self._silence_warning:
82
78
  warning_wrong_parameters(self.dashboards_create.__name__,
83
79
  payload, official_payload_list)
@@ -126,7 +122,6 @@ class Dashboards(ApiManager):
126
122
  type (string optional): additional filter - payload
127
123
  username (string optional): additional filter - payload
128
124
  description (string optional): additional filter - payload
129
- profile (string optional): additional filter - payload
130
125
  priority (integer optional): additional filter - payload
131
126
  refresh_interval (integer optional): additional filter - payload
132
127
  image_name (string optional): additional filter - payload
@@ -135,11 +130,10 @@ class Dashboards(ApiManager):
135
130
  if kwargs is None:
136
131
  kwargs = dict()
137
132
  official_payload_list = ['name', 'type', 'username', 'description',
138
- 'profile', 'priority', 'refresh_interval', 'image_name']
133
+ 'priority', 'refresh_interval', 'image_name']
139
134
  payload.get('name'), payload.get('type'), payload.get('username'
140
- ), payload.get('description'), payload.get('profile'), payload.get(
141
- 'priority'), payload.get('refresh_interval'), payload.get(
142
- 'image_name')
135
+ ), payload.get('description'), payload.get('priority'
136
+ ), payload.get('refresh_interval'), payload.get('image_name')
143
137
  if not self._silence_warning:
144
138
  warning_wrong_parameters(self.dashboards_put.__name__, payload,
145
139
  official_payload_list)
@@ -396,6 +390,72 @@ class Dashboards(ApiManager):
396
390
  f'/dashboards/dashboard_widget/{uuid}', **kwargs)
397
391
  return response
398
392
 
393
+ def dashboards_customers(self, uuid: str, warm_start: bool = False,
394
+ single_page: bool = False, page_size: int = 5000,
395
+ kwargs: dict = None, **params) -> list:
396
+ """List Dashboard
397
+
398
+ Args:
399
+ uuid (str, required): uuid
400
+ 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.
401
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
402
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
403
+ kwargs (dict, optional): additional parameters for execute. Default to None.
404
+ **params: additional parameters for the API.
405
+
406
+ Keyword Args:
407
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
408
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
409
+ 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
410
+ 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
411
+ 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
412
+
413
+ Returns: list"""
414
+ if kwargs is None:
415
+ kwargs = dict()
416
+ official_params_list = ['skip', 'limit', 'like', 'join', 'count']
417
+ params.get('skip'), params.get('limit'), params.get('like'
418
+ ), params.get('join'), params.get('count')
419
+ if not self._silence_warning:
420
+ warning_wrong_parameters(self.dashboards_customers.__name__,
421
+ params, official_params_list)
422
+ response = self.execute('GET', path=f'/dashboards/{uuid}/customers',
423
+ single_page=single_page, page_size=page_size, warm_start=
424
+ warm_start, params=params, **kwargs)
425
+ return response
426
+
427
+ def dashboards_customers_create(self, uuid: str, uuid_customer: str,
428
+ kwargs: dict = None) -> list:
429
+ """Create Customer Dashboard Association
430
+
431
+ Args:
432
+ uuid (str, required): uuid
433
+ uuid_customer (str, required): uuid_customer
434
+ kwargs (dict, optional): additional parameters for execute. Default to None.
435
+
436
+ Returns: list"""
437
+ if kwargs is None:
438
+ kwargs = dict()
439
+ response = self.execute('POST', path=
440
+ f'/dashboards/{uuid}/customers/{uuid_customer}', **kwargs)
441
+ return response
442
+
443
+ def dashboards_dashboards_delete(self, uuid: str, uuid_customer: str,
444
+ kwargs: dict = None) -> list:
445
+ """Remove Customer Dashboard Association
446
+
447
+ Args:
448
+ uuid (str, required): uuid
449
+ uuid_customer (str, required): uuid_customer
450
+ kwargs (dict, optional): additional parameters for execute. Default to None.
451
+
452
+ Returns: list"""
453
+ if kwargs is None:
454
+ kwargs = dict()
455
+ response = self.execute('DELETE', path=
456
+ f'/dashboards/{uuid}/dashboards/{uuid_customer}', **kwargs)
457
+ return response
458
+
399
459
  def dashboards_bulk(self, payload: list, warm_start: bool = False,
400
460
  single_page: bool = False, page_size: int = 50, kwargs: dict = None,
401
461
  **params) -> list:
@@ -454,7 +514,6 @@ class Dashboards(ApiManager):
454
514
  "type": "string", optional
455
515
  "username": "string", optional
456
516
  "description": "string", optional
457
- "profile": "string", required
458
517
  "priority": "integer", optional
459
518
  "refresh_interval": "integer", optional
460
519
  "image_name": "string", optional
@@ -150,15 +150,16 @@ class Login(ApiManager):
150
150
  password (string optional): additional filter - payload
151
151
  email (string optional): additional filter - payload
152
152
  stage (string optional): additional filter - payload
153
+ active (boolean optional): additional filter - payload
153
154
 
154
155
  Returns: list"""
155
156
  if kwargs is None:
156
157
  kwargs = dict()
157
158
  official_payload_list = ['phone', 'verified_email', 'profile',
158
- 'password', 'email', 'stage']
159
+ 'password', 'email', 'stage', 'active']
159
160
  payload.get('phone'), payload.get('verified_email'), payload.get(
160
161
  'profile'), payload.get('password'), payload.get('email'
161
- ), payload.get('stage')
162
+ ), payload.get('stage'), payload.get('active')
162
163
  if not self._silence_warning:
163
164
  warning_wrong_parameters(self.login_current_user_put.__name__,
164
165
  payload, official_payload_list)
@@ -769,6 +769,54 @@ class Objects(ApiManager):
769
769
  page_size=page_size, payload=payload, **kwargs)
770
770
  return response
771
771
 
772
+ def objects_downtimes_bulk(self, payload: list,
773
+ warm_start: bool = False, single_page: bool = False,
774
+ page_size: int = 50, kwargs: dict = None, **params) -> list:
775
+ """Bulk Read Downtimes
776
+
777
+ Args:
778
+ payload (list[dict], optional): List dict to create.
779
+ 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.
780
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
781
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 50.
782
+ kwargs (dict, optional): additional parameters for execute. Default to None.
783
+ **params: additional parameters for the API.
784
+
785
+ Keyword Args:
786
+ code (string optional): additional filter - parameter
787
+ status (string optional): additional filter - parameter
788
+ active_at_timestamp (string optional): additional filter - parameter
789
+ active_after_timestamp (string optional): additional filter - parameter
790
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
791
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
792
+ 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
793
+ 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
794
+ 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
795
+
796
+ Examples:
797
+ payload =
798
+ [
799
+ "uuid": "str", required
800
+ ]
801
+
802
+ Returns: list"""
803
+ if kwargs is None:
804
+ kwargs = dict()
805
+ official_params_list = ['code', 'status', 'active_at_timestamp',
806
+ 'active_after_timestamp', 'skip', 'limit', 'like', 'join', 'count']
807
+ params.get('code'), params.get('status'), params.get(
808
+ 'active_at_timestamp'), params.get('active_after_timestamp'
809
+ ), params.get('skip'), params.get('limit'), params.get('like'
810
+ ), params.get('join'), params.get('count')
811
+ if not self._silence_warning:
812
+ warning_wrong_parameters(self.objects_downtimes_bulk.__name__,
813
+ params, official_params_list)
814
+ response = self.execute('POST', path=
815
+ f'/objects/bulk/read/downtimes/', single_page=single_page,
816
+ page_size=page_size, warm_start=warm_start, params=params,
817
+ payload=payload, **kwargs)
818
+ return response
819
+
772
820
  def objects_probes_create_bulk(self, payload: list,
773
821
  single_page: bool = False, page_size: int = 50, kwargs: dict = None,
774
822
  **params) -> list:
@@ -425,6 +425,7 @@ class Services(ApiManager):
425
425
  service_name (string optional): additional filter - parameter
426
426
  service_description (string optional): additional filter - parameter
427
427
  service_status (string optional): additional filter - parameter
428
+ service_automata_domain (string optional): additional filter - parameter
428
429
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
429
430
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
430
431
  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
@@ -444,8 +445,9 @@ class Services(ApiManager):
444
445
  'metric_type_status', 'uuid_metric', 'metric_name',
445
446
  'metric_status', 'metric_profile', 'service_uuid_parent',
446
447
  'uuid_service', 'service_profile', 'service_name',
447
- 'service_description', 'service_status', 'skip', 'limit',
448
- 'like', 'join', 'count']
448
+ 'service_description', 'service_status',
449
+ 'service_automata_domain', 'skip', 'limit', 'like', 'join', 'count'
450
+ ]
449
451
  params.get('sort_by'), params.get('null_fields'), params.get(
450
452
  'uuid_customer'), params.get('customer_code'), params.get(
451
453
  'customer_status'), params.get('uuid_site'), params.get('site_code'
@@ -462,9 +464,9 @@ class Services(ApiManager):
462
464
  ), params.get('metric_profile'), params.get('service_uuid_parent'
463
465
  ), params.get('uuid_service'), params.get('service_profile'
464
466
  ), params.get('service_name'), params.get('service_description'
465
- ), params.get('service_status'), params.get('skip'), params.get(
466
- 'limit'), params.get('like'), params.get('join'), params.get(
467
- 'count')
467
+ ), params.get('service_status'), params.get(
468
+ 'service_automata_domain'), params.get('skip'), params.get('limit'
469
+ ), params.get('like'), params.get('join'), params.get('count')
468
470
  if not self._silence_warning:
469
471
  warning_wrong_parameters(self.services_query.__name__, params,
470
472
  official_params_list)
@@ -0,0 +1 @@
1
+ version = '3.17.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xautomata-hive
3
- Version: 3.16.5
3
+ Version: 3.17.0
4
4
  Home-page: https://github.com/sherlogic/xautomata-hive.git
5
5
  Author: Enrico Ferro - Andrea Jacassi
6
6
  Author-email:
@@ -1 +0,0 @@
1
- version = '3.16.5'
File without changes