xautomata-hive 3.19.1__py3-none-any.whl → 3.20.1__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 +7 -2
- hive/cookbook/calendars.py +86 -78
- hive/cookbook/cost_tree_nodes.py +12 -2
- hive/cookbook/cost_tree_resources.py +11 -6
- hive/cookbook/customers.py +51 -0
- hive/cookbook/features.py +14 -2
- hive/cookbook/files.py +87 -0
- hive/cookbook/groups.py +105 -6
- hive/cookbook/last_status_v2.py +196 -0
- hive/cookbook/metric_types.py +57 -4
- hive/cookbook/metrics.py +62 -7
- hive/cookbook/objects.py +63 -9
- hive/cookbook/probes.py +34 -4
- hive/cookbook/questions.py +135 -0
- hive/cookbook/services.py +9 -4
- hive/cookbook/sites.py +57 -0
- hive/cookbook/tree_hierarchy_v2.py +320 -0
- hive/cookbook/ts_cost_management.py +2 -2
- hive/cookbook/ts_cost_management_v2.py +653 -0
- hive/version.py +1 -1
- {xautomata_hive-3.19.1.dist-info → xautomata_hive-3.20.1.dist-info}/METADATA +1 -1
- {xautomata_hive-3.19.1.dist-info → xautomata_hive-3.20.1.dist-info}/RECORD +25 -20
- {xautomata_hive-3.19.1.dist-info → xautomata_hive-3.20.1.dist-info}/WHEEL +1 -1
- {xautomata_hive-3.19.1.dist-info → xautomata_hive-3.20.1.dist-info}/LICENSE +0 -0
- {xautomata_hive-3.19.1.dist-info → xautomata_hive-3.20.1.dist-info}/top_level.txt +0 -0
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',
|
342
|
-
'limit', 'like', 'join',
|
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(
|
346
|
-
|
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
|
hive/cookbook/metric_types.py
CHANGED
@@ -87,6 +87,55 @@ class MetricTypes(ApiManager):
|
|
87
87
|
payload, **kwargs)
|
88
88
|
return response
|
89
89
|
|
90
|
+
def metric_types_v2(self, warm_start: bool = False,
|
91
|
+
single_page: bool = False, page_size: int = 5000,
|
92
|
+
kwargs: dict = None, **params) -> list:
|
93
|
+
"""Read Metric Types V2
|
94
|
+
|
95
|
+
Args:
|
96
|
+
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.
|
97
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
98
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
99
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
100
|
+
**params: additional parameters for the API.
|
101
|
+
|
102
|
+
Keyword Args:
|
103
|
+
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
|
104
|
+
null_fields (string optional): additional filter - parameter
|
105
|
+
uuid_object (string optional): additional filter - parameter
|
106
|
+
name (string optional): additional filter - parameter
|
107
|
+
description (string optional): additional filter - parameter
|
108
|
+
feedback_for_operator (string optional): additional filter - parameter
|
109
|
+
profile (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_object',
|
122
|
+
'name', 'description', 'feedback_for_operator', 'profile',
|
123
|
+
'status', 'extract_severity', 'skip', 'limit', 'like', 'join',
|
124
|
+
'count']
|
125
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
126
|
+
'uuid_object'), params.get('name'), params.get('description'
|
127
|
+
), params.get('feedback_for_operator'), params.get('profile'
|
128
|
+
), params.get('status'), params.get('extract_severity'
|
129
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
130
|
+
), params.get('join'), params.get('count')
|
131
|
+
if not self._silence_warning:
|
132
|
+
warning_wrong_parameters(self.metric_types_v2.__name__, params,
|
133
|
+
official_params_list)
|
134
|
+
response = self.execute('GET', path=f'/metric_types/v2/',
|
135
|
+
single_page=single_page, page_size=page_size, warm_start=
|
136
|
+
warm_start, params=params, **kwargs)
|
137
|
+
return response
|
138
|
+
|
90
139
|
def metric_type(self, uuid: str, warm_start: bool = False,
|
91
140
|
kwargs: dict = None, **params) -> list:
|
92
141
|
"""Read Metric Type
|
@@ -221,6 +270,7 @@ class MetricTypes(ApiManager):
|
|
221
270
|
status (string optional): additional filter - parameter
|
222
271
|
active_at_timestamp (string optional): additional filter - parameter
|
223
272
|
active_after_timestamp (string optional): additional filter - parameter
|
273
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
224
274
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
225
275
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
226
276
|
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
|
@@ -231,12 +281,15 @@ class MetricTypes(ApiManager):
|
|
231
281
|
if kwargs is None:
|
232
282
|
kwargs = dict()
|
233
283
|
official_params_list = ['not_in', 'code', 'status',
|
234
|
-
'active_at_timestamp', 'active_after_timestamp',
|
235
|
-
'limit', 'like', 'join',
|
284
|
+
'active_at_timestamp', 'active_after_timestamp',
|
285
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
286
|
+
'count']
|
236
287
|
params.get('not_in'), params.get('code'), params.get('status'
|
237
288
|
), params.get('active_at_timestamp'), params.get(
|
238
|
-
'active_after_timestamp'), params.get(
|
239
|
-
|
289
|
+
'active_after_timestamp'), params.get(
|
290
|
+
'active_at_or_after_timestamp'), params.get('skip'), params.get(
|
291
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
292
|
+
'count')
|
240
293
|
if not self._silence_warning:
|
241
294
|
warning_wrong_parameters(self.metric_types_downtimes.__name__,
|
242
295
|
params, official_params_list)
|
hive/cookbook/metrics.py
CHANGED
@@ -86,6 +86,55 @@ class Metrics(ApiManager):
|
|
86
86
|
**kwargs)
|
87
87
|
return response
|
88
88
|
|
89
|
+
def metrics_v2(self, warm_start: bool = False,
|
90
|
+
single_page: bool = False, page_size: int = 5000,
|
91
|
+
kwargs: dict = None, **params) -> list:
|
92
|
+
"""Read Metrics 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_metric_type (string optional): additional filter - parameter
|
105
|
+
name (string optional): additional filter - parameter
|
106
|
+
description (string optional): additional filter - parameter
|
107
|
+
feedback_for_operator (string optional): additional filter - parameter
|
108
|
+
profile (string optional): additional filter - parameter
|
109
|
+
status (string optional): additional filter - parameter
|
110
|
+
extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
|
111
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
112
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
113
|
+
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
|
114
|
+
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
|
115
|
+
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
|
116
|
+
|
117
|
+
Returns: list"""
|
118
|
+
if kwargs is None:
|
119
|
+
kwargs = dict()
|
120
|
+
official_params_list = ['sort_by', 'null_fields',
|
121
|
+
'uuid_metric_type', 'name', 'description',
|
122
|
+
'feedback_for_operator', 'profile', 'status',
|
123
|
+
'extract_severity', 'skip', 'limit', 'like', 'join', 'count']
|
124
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
125
|
+
'uuid_metric_type'), params.get('name'), params.get('description'
|
126
|
+
), params.get('feedback_for_operator'), params.get('profile'
|
127
|
+
), params.get('status'), params.get('extract_severity'
|
128
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
129
|
+
), params.get('join'), params.get('count')
|
130
|
+
if not self._silence_warning:
|
131
|
+
warning_wrong_parameters(self.metrics_v2.__name__, params,
|
132
|
+
official_params_list)
|
133
|
+
response = self.execute('GET', path=f'/metrics/v2/', single_page=
|
134
|
+
single_page, page_size=page_size, warm_start=warm_start, params
|
135
|
+
=params, **kwargs)
|
136
|
+
return response
|
137
|
+
|
89
138
|
def metric(self, uuid: str, warm_start: bool = False,
|
90
139
|
kwargs: dict = None, **params) -> list:
|
91
140
|
"""Read Metric
|
@@ -269,6 +318,7 @@ class Metrics(ApiManager):
|
|
269
318
|
only_actives (boolean optional): additional filter - parameter
|
270
319
|
active_at_timestamp (string optional): additional filter - parameter
|
271
320
|
active_after_timestamp (string optional): additional filter - parameter
|
321
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
272
322
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
273
323
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
274
324
|
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
|
@@ -280,12 +330,14 @@ class Metrics(ApiManager):
|
|
280
330
|
kwargs = dict()
|
281
331
|
official_params_list = ['not_in', 'code', 'status', 'fetch_all',
|
282
332
|
'only_actives', 'active_at_timestamp', 'active_after_timestamp',
|
283
|
-
'skip', 'limit', 'like', 'join',
|
333
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
334
|
+
'count']
|
284
335
|
params.get('not_in'), params.get('code'), params.get('status'
|
285
336
|
), params.get('fetch_all'), params.get('only_actives'), params.get(
|
286
337
|
'active_at_timestamp'), params.get('active_after_timestamp'
|
287
|
-
), params.get('
|
288
|
-
), params.get('
|
338
|
+
), params.get('active_at_or_after_timestamp'), params.get('skip'
|
339
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
340
|
+
), params.get('count')
|
289
341
|
if not self._silence_warning:
|
290
342
|
warning_wrong_parameters(self.metrics_downtimes.__name__,
|
291
343
|
params, official_params_list)
|
@@ -493,6 +545,7 @@ class Metrics(ApiManager):
|
|
493
545
|
only_actives (boolean optional): additional filter - parameter
|
494
546
|
active_at_timestamp (string optional): additional filter - parameter
|
495
547
|
active_after_timestamp (string optional): additional filter - parameter
|
548
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
496
549
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
497
550
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
498
551
|
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
|
@@ -510,12 +563,14 @@ class Metrics(ApiManager):
|
|
510
563
|
kwargs = dict()
|
511
564
|
official_params_list = ['code', 'status', 'fetch_all',
|
512
565
|
'only_actives', 'active_at_timestamp', 'active_after_timestamp',
|
513
|
-
'skip', 'limit', 'like', 'join',
|
566
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
567
|
+
'count']
|
514
568
|
params.get('code'), params.get('status'), params.get('fetch_all'
|
515
569
|
), params.get('only_actives'), params.get('active_at_timestamp'
|
516
|
-
), params.get('active_after_timestamp'), params.get(
|
517
|
-
|
518
|
-
), params.get('
|
570
|
+
), params.get('active_after_timestamp'), params.get(
|
571
|
+
'active_at_or_after_timestamp'), params.get('skip'), params.get(
|
572
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
573
|
+
'count')
|
519
574
|
if not self._silence_warning:
|
520
575
|
warning_wrong_parameters(self.metrics_downtimes_bulk.__name__,
|
521
576
|
params, official_params_list)
|