xautomata-hive 3.19.0__py3-none-any.whl → 3.20.0__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.
hive/api.py CHANGED
@@ -9,7 +9,6 @@ from requests import HTTPError
9
9
  from hive.decorators import ratelimiter, refresh, paginate, warmstart, timeout_retry
10
10
  from hive.exceptions import UnauthorizedException
11
11
  from hive.infrastrucure_keys import Keys
12
- import warnings
13
12
  import gc
14
13
  import functools
15
14
  import logging
@@ -56,7 +55,7 @@ class ApiManager:
56
55
 
57
56
  def __init__(self, root, user, password, ssl_verify: bool = True):
58
57
 
59
- if 'api/v' not in root: warnings.warn(f'{root} does not have the api/v* in the root, mandatory to point at the API')
58
+ if 'api/v' not in root: logger.warning(f'{root} does not have the api/v* in the root, mandatory to point at the API')
60
59
 
61
60
  self._SSL_verify = ssl_verify
62
61
  self.root = root.rstrip('/')
@@ -141,7 +140,7 @@ class ApiManager:
141
140
 
142
141
  # il controllo qui impedisce di fare chiamate se in modalita POST DELETE PUT se in modalita test,
143
142
  # con l'eccezione della presenza della parola read nel path che indica una bulk in lettura
144
- if self._get_only and not(read and bulk) and not query:
143
+ if self._get_only and not (read and bulk) and not query:
145
144
  raise ValueError('you are trying to access a not get_only API')
146
145
 
147
146
  # tutto quello che non è bulk e query gli viene impedito di paginare
@@ -411,7 +410,7 @@ class ApiManager:
411
410
  uuid_res.append(val['uuid'])
412
411
 
413
412
  if none_count > 0:
414
- warnings.warn(f'{none_count} elements have not been matched with a uuid and can be found as None in the resutl list')
413
+ logger.warning(f'{none_count} elements have not been matched with a uuid and can be found as None in the resutl list')
415
414
 
416
415
  return uuid_res, get_count, post_count, put_count
417
416
 
@@ -468,7 +467,7 @@ def warning_wrong_parameters(func_name: str, params_from_user: dict, ufficial_pa
468
467
  if ufficial_params_list is None: ufficial_params_list = []
469
468
  for par in params_from_user:
470
469
  if par not in ufficial_params_list:
471
- print(f'WARNING: from {func_name}, {par} is not in the official list of params.')
470
+ logger.warning(f'from {func_name}, {par} is not in the official list of params.')
472
471
 
473
472
 
474
473
  # gli import vengono messi qui per evitare una parziale import di api.py
@@ -509,17 +508,21 @@ from hive.cookbook.opening_reasons import OpeningReasons
509
508
  from hive.cookbook.probes import Probes
510
509
  from hive.cookbook.probe_types import ProbeTypes
511
510
  from hive.cookbook.profile_topics import ProfileTopics
511
+ from hive.cookbook.questions import Questions
512
512
  from hive.cookbook.reason_for_closure import ReasonForClosure
513
513
  from hive.cookbook.retention_rules import RetentionRules
514
514
  from hive.cookbook.schedules import Schedules
515
515
  from hive.cookbook.services import Services
516
516
  from hive.cookbook.sites import Sites
517
517
  from hive.cookbook.last_status import LastStatus
518
+ from hive.cookbook.last_status_v2 import LastStatusV2
518
519
  from hive.cookbook.terms_and_conditions import TermsAndConditions
519
520
  from hive.cookbook.tree_hierarchy import TreeHierarchy
521
+ from hive.cookbook.tree_hierarchy_v2 import TreeHierarchyV2
520
522
  from hive.cookbook.ts_automata_state import TsAutomataState
521
523
  from hive.cookbook.ts_cost_azure_raw import TsCostAzureRaw
522
524
  from hive.cookbook.ts_cost_management import TsCostManagement
525
+ from hive.cookbook.ts_cost_management_v2 import TsCostManagementV2
523
526
  from hive.cookbook.ts_metric_status import TsMetricStatus
524
527
  from hive.cookbook.ts_metric_value import TsMetricValue
525
528
  from hive.cookbook.ts_ntop_flows import TsNtopFlows
@@ -534,7 +537,7 @@ from hive.cookbook.widget_groups import WidgetGroups
534
537
  # hive imports stop
535
538
 
536
539
 
537
- class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, CostTreeNodes, CostTreeResources, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, FirmwareUpdates, Groups, AutomataIngest, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, TermsAndConditions, TreeHierarchy, TsAutomataState, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
540
+ class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, CostTreeNodes, CostTreeResources, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, FirmwareUpdates, Groups, AutomataIngest, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, Questions, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, LastStatusV2, TermsAndConditions, TreeHierarchy, TreeHierarchyV2, TsAutomataState, TsCostAzureRaw, TsCostManagement, TsCostManagementV2, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
538
541
  """
539
542
  Class with each specific API, based on the ApiManager Class created for a more general interaction with Xautomata API
540
543
  """
@@ -140,18 +140,28 @@ class CostTreeNodes(ApiManager):
140
140
  payload=payload, **kwargs)
141
141
  return response
142
142
 
143
- def cost_tree_nodes_delete(self, uuid: str, kwargs: dict = None) -> list:
143
+ def cost_tree_nodes_delete(self, uuid: str, kwargs: dict = None, **params
144
+ ) -> list:
144
145
  """Delete Cost Tree Node
145
146
 
146
147
  Args:
147
148
  uuid (str, required): uuid
148
149
  kwargs (dict, optional): additional parameters for execute. Default to None.
150
+ **params: additional parameters for the API.
151
+
152
+ Keyword Args:
153
+ delete_resources (boolean optional): additional filter - parameter
149
154
 
150
155
  Returns: list"""
151
156
  if kwargs is None:
152
157
  kwargs = dict()
158
+ official_params_list = ['delete_resources']
159
+ params.get('delete_resources')
160
+ if not self._silence_warning:
161
+ warning_wrong_parameters(self.cost_tree_nodes_delete.__name__,
162
+ params, official_params_list)
153
163
  response = self.execute('DELETE', path=f'/cost_tree_nodes/{uuid}',
154
- **kwargs)
164
+ params=params, **kwargs)
155
165
  return response
156
166
 
157
167
  def cost_tree_nodes_navigate_tree(self, uuid: str,
@@ -156,12 +156,15 @@ class CostTreeResources(ApiManager):
156
156
  return response
157
157
 
158
158
  def cost_tree_resources_unfully_assigned_resources(self, uuid_view: str,
159
- warm_start: bool = False, kwargs: dict = None, **params) -> list:
159
+ warm_start: bool = False, single_page: bool = False,
160
+ page_size: int = 5000, kwargs: dict = None, **params) -> list:
160
161
  """Get Unfully Assigned Resources
161
162
 
162
163
  Args:
163
164
  uuid_view (str, required): uuid_view
164
165
  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.
166
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
167
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
165
168
  kwargs (dict, optional): additional parameters for execute. Default to None.
166
169
  **params: additional parameters for the API.
167
170
 
@@ -169,25 +172,27 @@ class CostTreeResources(ApiManager):
169
172
  date_start (string required): additional filter - parameter
170
173
  date_end (string required): additional filter - parameter
171
174
  resource_id (string optional): additional filter - parameter
175
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
172
176
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
177
+ 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
173
178
  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
174
179
 
175
180
  Returns: list"""
176
181
  if kwargs is None:
177
182
  kwargs = dict()
178
- kwargs, params = handling_single_page_methods(kwargs=kwargs, params
179
- =params)
180
183
  official_params_list = ['date_start', 'date_end', 'resource_id',
181
- 'limit', 'sort_by']
184
+ 'skip', 'limit', 'count', 'sort_by']
182
185
  params.get('date_start'), params.get('date_end'), params.get(
183
- 'resource_id'), params.get('limit'), params.get('sort_by')
186
+ 'resource_id'), params.get('skip'), params.get('limit'
187
+ ), params.get('count'), params.get('sort_by')
184
188
  if not self._silence_warning:
185
189
  warning_wrong_parameters(self.
186
190
  cost_tree_resources_unfully_assigned_resources.__name__,
187
191
  params, official_params_list)
188
192
  response = self.execute('GET', path=
189
193
  f'/cost_tree_resources/{uuid_view}/unfully_assigned_resources/',
190
- warm_start=warm_start, params=params, **kwargs)
194
+ single_page=single_page, page_size=page_size, warm_start=
195
+ warm_start, params=params, **kwargs)
191
196
  return response
192
197
 
193
198
  def cost_tree_resources_delete_bulk(self, payload: list,
@@ -309,6 +309,57 @@ class Customers(ApiManager):
309
309
  warm_start, params=params, **kwargs)
310
310
  return response
311
311
 
312
+ def customers_groups_v2(self, uuid: str, warm_start: bool = False,
313
+ single_page: bool = False, page_size: int = 5000,
314
+ kwargs: dict = None, **params) -> list:
315
+ """List Groups V2
316
+
317
+ Args:
318
+ uuid (str, required): uuid
319
+ 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.
320
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
321
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
322
+ kwargs (dict, optional): additional parameters for execute. Default to None.
323
+ **params: additional parameters for the API.
324
+
325
+ Keyword Args:
326
+ 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
327
+ null_fields (string optional): additional filter - parameter
328
+ uuid_parent (string optional): additional filter - parameter
329
+ uuid_site (string optional): additional filter - parameter
330
+ uuid_virtual_domain (string optional): additional filter - parameter
331
+ object_profile (string optional): additional filter - parameter
332
+ type (string optional): additional filter - parameter
333
+ name (string optional): additional filter - parameter
334
+ description (string optional): additional filter - parameter
335
+ status (string optional): additional filter - parameter
336
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
337
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
338
+ 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
339
+ 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
340
+ 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
341
+
342
+ Returns: list"""
343
+ if kwargs is None:
344
+ kwargs = dict()
345
+ official_params_list = ['sort_by', 'null_fields', 'uuid_parent',
346
+ 'uuid_site', 'uuid_virtual_domain', 'object_profile', 'type',
347
+ 'name', 'description', 'status', 'skip', 'limit', 'like',
348
+ 'join', 'count']
349
+ params.get('sort_by'), params.get('null_fields'), params.get(
350
+ 'uuid_parent'), params.get('uuid_site'), params.get(
351
+ 'uuid_virtual_domain'), params.get('object_profile'), params.get(
352
+ 'type'), params.get('name'), params.get('description'), params.get(
353
+ 'status'), params.get('skip'), params.get('limit'), params.get(
354
+ 'like'), params.get('join'), params.get('count')
355
+ if not self._silence_warning:
356
+ warning_wrong_parameters(self.customers_groups_v2.__name__,
357
+ params, official_params_list)
358
+ response = self.execute('GET', path=f'/customers/{uuid}/groups/v2/',
359
+ single_page=single_page, page_size=page_size, warm_start=
360
+ warm_start, params=params, **kwargs)
361
+ return response
362
+
312
363
  def customers_image(self, uuid: str, warm_start: bool = False,
313
364
  kwargs: dict = None) -> list:
314
365
  """Get Customer Image
hive/cookbook/features.py CHANGED
@@ -4,16 +4,28 @@ from hive.api import ApiManager, handling_single_page_methods, warning_wrong_par
4
4
  class Features(ApiManager):
5
5
  """Class that handles all the XAutomata features APIs"""
6
6
 
7
- def features(self, warm_start: bool = False, kwargs: dict = None) -> list:
7
+ def features(self, warm_start: bool = False, kwargs: dict = None, **params
8
+ ) -> list:
8
9
  """Get Api Features Settings
9
10
 
10
11
  Args:
11
12
  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.
12
13
  kwargs (dict, optional): additional parameters for execute. Default to None.
14
+ **params: additional parameters for the API.
15
+
16
+ Keyword Args:
17
+ user-agent (string optional): additional filter - parameter
13
18
 
14
19
  Returns: list"""
15
20
  if kwargs is None:
16
21
  kwargs = dict()
22
+ kwargs, params = handling_single_page_methods(kwargs=kwargs, params
23
+ =params)
24
+ official_params_list = ['user-agent']
25
+ params.get('user-agent')
26
+ if not self._silence_warning:
27
+ warning_wrong_parameters(self.features.__name__, params,
28
+ official_params_list)
17
29
  response = self.execute('GET', path=f'/features/', warm_start=
18
- warm_start, **kwargs)
30
+ warm_start, params=params, **kwargs)
19
31
  return response
hive/cookbook/groups.py CHANGED
@@ -87,6 +87,55 @@ class Groups(ApiManager):
87
87
  **kwargs)
88
88
  return response
89
89
 
90
+ def groups_v2(self, warm_start: bool = False, single_page: bool = False,
91
+ page_size: int = 5000, kwargs: dict = None, **params) -> list:
92
+ """Read Groups V2
93
+
94
+ Args:
95
+ 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.
96
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
97
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
98
+ kwargs (dict, optional): additional parameters for execute. Default to None.
99
+ **params: additional parameters for the API.
100
+
101
+ Keyword Args:
102
+ 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
103
+ null_fields (string optional): additional filter - parameter
104
+ uuid_parent (string optional): additional filter - parameter
105
+ uuid_site (string optional): additional filter - parameter
106
+ uuid_virtual_domain (string optional): additional filter - parameter
107
+ type (string optional): additional filter - parameter
108
+ name (string optional): additional filter - parameter
109
+ description (string optional): additional filter - parameter
110
+ status (string optional): additional filter - parameter
111
+ extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
112
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
113
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
114
+ 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
115
+ 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
116
+ 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
117
+
118
+ Returns: list"""
119
+ if kwargs is None:
120
+ kwargs = dict()
121
+ official_params_list = ['sort_by', 'null_fields', 'uuid_parent',
122
+ 'uuid_site', 'uuid_virtual_domain', 'type', 'name',
123
+ 'description', 'status', 'extract_severity', 'skip', 'limit',
124
+ 'like', 'join', 'count']
125
+ params.get('sort_by'), params.get('null_fields'), params.get(
126
+ 'uuid_parent'), params.get('uuid_site'), params.get(
127
+ 'uuid_virtual_domain'), params.get('type'), params.get('name'
128
+ ), params.get('description'), params.get('status'), params.get(
129
+ 'extract_severity'), params.get('skip'), params.get('limit'
130
+ ), params.get('like'), params.get('join'), params.get('count')
131
+ if not self._silence_warning:
132
+ warning_wrong_parameters(self.groups_v2.__name__, params,
133
+ official_params_list)
134
+ response = self.execute('GET', path=f'/groups/v2/', single_page=
135
+ single_page, page_size=page_size, warm_start=warm_start, params
136
+ =params, **kwargs)
137
+ return response
138
+
90
139
  def group(self, uuid: str, warm_start: bool = False,
91
140
  kwargs: dict = None, **params) -> list:
92
141
  """Read Group
@@ -207,6 +256,51 @@ class Groups(ApiManager):
207
256
  warm_start, params=params, **kwargs)
208
257
  return response
209
258
 
259
+ def groups_objects_v2(self, uuid: str, warm_start: bool = False,
260
+ single_page: bool = False, page_size: int = 5000,
261
+ kwargs: dict = None, **params) -> list:
262
+ """List Objects
263
+
264
+ Args:
265
+ uuid (str, required): uuid
266
+ 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.
267
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
268
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
269
+ kwargs (dict, optional): additional parameters for execute. Default to None.
270
+ **params: additional parameters for the API.
271
+
272
+ Keyword Args:
273
+ 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
274
+ not_in (boolean optional): additional filter - parameter
275
+ name (string optional): additional filter - parameter
276
+ profile (string optional): additional filter - parameter
277
+ extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
278
+ object_profile (string optional): additional filter - parameter
279
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
280
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
281
+ 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
282
+ 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
283
+ 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
284
+
285
+ Returns: list"""
286
+ if kwargs is None:
287
+ kwargs = dict()
288
+ official_params_list = ['sort_by', 'not_in', 'name', 'profile',
289
+ 'extract_severity', 'object_profile', 'skip', 'limit', 'like',
290
+ 'join', 'count']
291
+ params.get('sort_by'), params.get('not_in'), params.get('name'
292
+ ), params.get('profile'), params.get('extract_severity'
293
+ ), params.get('object_profile'), params.get('skip'), params.get(
294
+ 'limit'), params.get('like'), params.get('join'), params.get(
295
+ 'count')
296
+ if not self._silence_warning:
297
+ warning_wrong_parameters(self.groups_objects_v2.__name__,
298
+ params, official_params_list)
299
+ response = self.execute('GET', path=f'/groups/{uuid}/objects/v2/',
300
+ single_page=single_page, page_size=page_size, warm_start=
301
+ warm_start, params=params, **kwargs)
302
+ return response
303
+
210
304
  def groups_objects_create(self, uuid: str, uuid_object: str,
211
305
  kwargs: dict = None) -> list:
212
306
  """Add Object
@@ -328,6 +422,7 @@ class Groups(ApiManager):
328
422
  status (string optional): additional filter - parameter
329
423
  active_at_timestamp (string optional): additional filter - parameter
330
424
  active_after_timestamp (string optional): additional filter - parameter
425
+ active_at_or_after_timestamp (string optional): additional filter - parameter
331
426
  skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
332
427
  limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
333
428
  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
@@ -338,12 +433,15 @@ class Groups(ApiManager):
338
433
  if kwargs is None:
339
434
  kwargs = dict()
340
435
  official_params_list = ['not_in', 'code', 'status',
341
- 'active_at_timestamp', 'active_after_timestamp', 'skip',
342
- 'limit', 'like', 'join', 'count']
436
+ 'active_at_timestamp', 'active_after_timestamp',
437
+ 'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
438
+ 'count']
343
439
  params.get('not_in'), params.get('code'), params.get('status'
344
440
  ), params.get('active_at_timestamp'), params.get(
345
- 'active_after_timestamp'), params.get('skip'), params.get('limit'
346
- ), params.get('like'), params.get('join'), params.get('count')
441
+ 'active_after_timestamp'), params.get(
442
+ 'active_at_or_after_timestamp'), params.get('skip'), params.get(
443
+ 'limit'), params.get('like'), params.get('join'), params.get(
444
+ 'count')
347
445
  if not self._silence_warning:
348
446
  warning_wrong_parameters(self.groups_downtimes.__name__, params,
349
447
  official_params_list)
@@ -669,6 +767,7 @@ class Groups(ApiManager):
669
767
  Keyword Args:
670
768
  active_at_timestamp (string optional): additional filter - parameter
671
769
  active_after_timestamp (string optional): additional filter - parameter
770
+ active_at_or_after_timestamp (string optional): additional filter - parameter
672
771
  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
673
772
 
674
773
  Examples:
@@ -681,9 +780,9 @@ class Groups(ApiManager):
681
780
  if kwargs is None:
682
781
  kwargs = dict()
683
782
  official_params_list = ['active_at_timestamp',
684
- 'active_after_timestamp', 'join']
783
+ 'active_after_timestamp', 'active_at_or_after_timestamp', 'join']
685
784
  params.get('active_at_timestamp'), params.get('active_after_timestamp'
686
- ), params.get('join')
785
+ ), params.get('active_at_or_after_timestamp'), params.get('join')
687
786
  if not self._silence_warning:
688
787
  warning_wrong_parameters(self.groups_downtimes_bulk.__name__,
689
788
  params, official_params_list)
@@ -0,0 +1,196 @@
1
+ from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
2
+
3
+
4
+ class LastStatusV2(ApiManager):
5
+ """Class that handles all the XAutomata last_status_v2 APIs"""
6
+
7
+ def last_status_v2(self, warm_start: bool = False,
8
+ single_page: bool = False, page_size: int = 5000,
9
+ kwargs: dict = None, **params) -> list:
10
+ """Read Last Admin Status
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
+ extract_valueless_metrics (boolean optional): additional filter - parameter
21
+ extract_automata_domain (None optional): additional filter - parameter
22
+ 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
23
+ null_fields (string optional): additional filter - parameter
24
+ uuid_customer (string optional): additional filter - parameter
25
+ customer_code (string optional): additional filter - parameter
26
+ customer_status (string optional): additional filter - parameter
27
+ uuid_site (string optional): additional filter - parameter
28
+ site_code (string optional): additional filter - parameter
29
+ site_description (string optional): additional filter - parameter
30
+ site_address (string optional): additional filter - parameter
31
+ site_zip_code (string optional): additional filter - parameter
32
+ site_city (string optional): additional filter - parameter
33
+ site_country (string optional): additional filter - parameter
34
+ site_state_province (string optional): additional filter - parameter
35
+ site_status (string optional): additional filter - parameter
36
+ uuid_group (string optional): additional filter - parameter
37
+ group_name (string optional): additional filter - parameter
38
+ group_status (string optional): additional filter - parameter
39
+ group_type (string optional): additional filter - parameter
40
+ uuid_object (string optional): additional filter - parameter
41
+ object_name (string optional): additional filter - parameter
42
+ object_status (string optional): additional filter - parameter
43
+ object_profile (string optional): additional filter - parameter
44
+ uuid_metric_type (string optional): additional filter - parameter
45
+ metric_type_name (string optional): additional filter - parameter
46
+ metric_type_status (string optional): additional filter - parameter
47
+ uuid_metric (string optional): additional filter - parameter
48
+ metric_name (string optional): additional filter - parameter
49
+ metric_status (string optional): additional filter - parameter
50
+ metric_profile (string optional): additional filter - parameter
51
+ topic (string optional): additional filter - parameter
52
+ last_value_uuid_probe (string optional): additional filter - parameter
53
+ last_value_timestamp_start (string optional): additional filter - parameter
54
+ last_value_timestamp_end (string optional): additional filter - parameter
55
+ last_value_object_type (string optional): additional filter - parameter
56
+ last_value_name (string optional): additional filter - parameter
57
+ last_value_value (string optional): additional filter - parameter
58
+ last_value_unit (string optional): additional filter - parameter
59
+ last_value_description (string optional): additional filter - parameter
60
+ last_value_status (None optional): additional filter - parameter
61
+ last_value_ranking (integer optional): additional filter - parameter
62
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
63
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
64
+ 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
65
+ 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
66
+ 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
67
+
68
+ Returns: list"""
69
+ if kwargs is None:
70
+ kwargs = dict()
71
+ official_params_list = ['extract_valueless_metrics',
72
+ 'extract_automata_domain', 'sort_by', 'null_fields',
73
+ 'uuid_customer', 'customer_code', 'customer_status',
74
+ 'uuid_site', 'site_code', 'site_description', 'site_address',
75
+ 'site_zip_code', 'site_city', 'site_country',
76
+ 'site_state_province', 'site_status', 'uuid_group',
77
+ 'group_name', 'group_status', 'group_type', 'uuid_object',
78
+ 'object_name', 'object_status', 'object_profile',
79
+ 'uuid_metric_type', 'metric_type_name', 'metric_type_status',
80
+ 'uuid_metric', 'metric_name', 'metric_status', 'metric_profile',
81
+ 'topic', 'last_value_uuid_probe', 'last_value_timestamp_start',
82
+ 'last_value_timestamp_end', 'last_value_object_type',
83
+ 'last_value_name', 'last_value_value', 'last_value_unit',
84
+ 'last_value_description', 'last_value_status',
85
+ 'last_value_ranking', 'skip', 'limit', 'like', 'join', 'count']
86
+ params.get('extract_valueless_metrics'), params.get(
87
+ 'extract_automata_domain'), params.get('sort_by'), params.get(
88
+ 'null_fields'), params.get('uuid_customer'), params.get(
89
+ 'customer_code'), params.get('customer_status'), params.get(
90
+ 'uuid_site'), params.get('site_code'), params.get(
91
+ 'site_description'), params.get('site_address'), params.get(
92
+ 'site_zip_code'), params.get('site_city'), params.get(
93
+ 'site_country'), params.get('site_state_province'), params.get(
94
+ 'site_status'), params.get('uuid_group'), params.get('group_name'
95
+ ), params.get('group_status'), params.get('group_type'
96
+ ), params.get('uuid_object'), params.get('object_name'
97
+ ), params.get('object_status'), params.get('object_profile'
98
+ ), params.get('uuid_metric_type'), params.get('metric_type_name'
99
+ ), params.get('metric_type_status'), params.get('uuid_metric'
100
+ ), params.get('metric_name'), params.get('metric_status'
101
+ ), params.get('metric_profile'), params.get('topic'), params.get(
102
+ 'last_value_uuid_probe'), params.get('last_value_timestamp_start'
103
+ ), params.get('last_value_timestamp_end'), params.get(
104
+ 'last_value_object_type'), params.get('last_value_name'
105
+ ), params.get('last_value_value'), params.get('last_value_unit'
106
+ ), params.get('last_value_description'), params.get(
107
+ 'last_value_status'), params.get('last_value_ranking'), params.get(
108
+ 'skip'), params.get('limit'), params.get('like'), params.get('join'
109
+ ), params.get('count')
110
+ if not self._silence_warning:
111
+ warning_wrong_parameters(self.last_status_v2.__name__, params,
112
+ official_params_list)
113
+ response = self.execute('GET', path=f'/last_status_v2/',
114
+ single_page=single_page, page_size=page_size, warm_start=
115
+ warm_start, params=params, **kwargs)
116
+ return response
117
+
118
+ def last_status_bulk(self, payload: dict = False,
119
+ warm_start: bool = False, single_page: bool = False,
120
+ page_size: int = 5000, kwargs: dict = None, **params) -> list:
121
+ """Read Last Admin Status Lists
122
+
123
+ Args:
124
+ payload (dict, optional): additional parameters for the API.
125
+ 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.
126
+ single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
127
+ page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
128
+ kwargs (dict, optional): additional parameters for execute. Default to None.
129
+ **params: additional parameters for the API.
130
+
131
+ Keyword Args:
132
+ 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
133
+ null_fields (string optional): additional filter - parameter
134
+ skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
135
+ limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
136
+ 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
137
+ 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
138
+ 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
139
+
140
+ Examples:
141
+ payload =
142
+ {
143
+ "uuid_customer": "array", optional
144
+ "customer_code": "array", optional
145
+ "customer_status": "array", optional
146
+ "uuid_site": "array", optional
147
+ "site_code": "array", optional
148
+ "site_description": "array", optional
149
+ "site_address": "array", optional
150
+ "site_zip_code": "array", optional
151
+ "site_city": "array", optional
152
+ "site_country": "array", optional
153
+ "site_state_province": "array", optional
154
+ "site_status": "array", optional
155
+ "uuid_group": "array", optional
156
+ "group_name": "array", optional
157
+ "group_status": "array", optional
158
+ "group_type": "array", optional
159
+ "uuid_object": "array", optional
160
+ "object_name": "array", optional
161
+ "object_status": "array", optional
162
+ "object_profile": "array", optional
163
+ "uuid_metric_type": "array", optional
164
+ "metric_type_name": "array", optional
165
+ "metric_type_status": "array", optional
166
+ "uuid_metric": "array", optional
167
+ "metric_name": "array", optional
168
+ "metric_status": "array", optional
169
+ "metric_profile": "array", optional
170
+ "topic": "array", optional
171
+ "last_value_uuid_probe": "array", optional
172
+ "last_value_timestamp": "array", optional
173
+ "last_value_object_type": "array", optional
174
+ "last_value_name": "array", optional
175
+ "last_value_value": "array", optional
176
+ "last_value_unit": "array", optional
177
+ "last_value_description": "array", optional
178
+ "last_value_status": "array", optional
179
+ "last_value_ranking": "array", optional
180
+ }
181
+
182
+ Returns: list"""
183
+ if kwargs is None:
184
+ kwargs = dict()
185
+ official_params_list = ['sort_by', 'null_fields', 'skip', 'limit',
186
+ 'like', 'join', 'count']
187
+ params.get('sort_by'), params.get('null_fields'), params.get('skip'
188
+ ), params.get('limit'), params.get('like'), params.get('join'
189
+ ), params.get('count')
190
+ if not self._silence_warning:
191
+ warning_wrong_parameters(self.last_status_bulk.__name__, params,
192
+ official_params_list)
193
+ response = self.execute('POST', path=f'/last_status_v2/',
194
+ single_page=single_page, page_size=page_size, warm_start=
195
+ warm_start, params=params, payload=payload, **kwargs)
196
+ return response