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/objects.py
CHANGED
@@ -83,6 +83,52 @@ class Objects(ApiManager):
|
|
83
83
|
**kwargs)
|
84
84
|
return response
|
85
85
|
|
86
|
+
def objects_v2(self, warm_start: bool = False,
|
87
|
+
single_page: bool = False, page_size: int = 5000,
|
88
|
+
kwargs: dict = None, **params) -> list:
|
89
|
+
"""Read Objects V2
|
90
|
+
|
91
|
+
Args:
|
92
|
+
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.
|
93
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
94
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
95
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
96
|
+
**params: additional parameters for the API.
|
97
|
+
|
98
|
+
Keyword Args:
|
99
|
+
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
|
100
|
+
null_fields (string optional): additional filter - parameter
|
101
|
+
name (string optional): additional filter - parameter
|
102
|
+
description (string optional): additional filter - parameter
|
103
|
+
feedback_for_operator (string optional): additional filter - parameter
|
104
|
+
profile (string optional): additional filter - parameter
|
105
|
+
status (string optional): additional filter - parameter
|
106
|
+
extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
|
107
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
108
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
109
|
+
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
|
110
|
+
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
|
111
|
+
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
|
112
|
+
|
113
|
+
Returns: list"""
|
114
|
+
if kwargs is None:
|
115
|
+
kwargs = dict()
|
116
|
+
official_params_list = ['sort_by', 'null_fields', 'name',
|
117
|
+
'description', 'feedback_for_operator', 'profile', 'status',
|
118
|
+
'extract_severity', 'skip', 'limit', 'like', 'join', 'count']
|
119
|
+
params.get('sort_by'), params.get('null_fields'), params.get('name'
|
120
|
+
), params.get('description'), params.get('feedback_for_operator'
|
121
|
+
), params.get('profile'), params.get('status'), params.get(
|
122
|
+
'extract_severity'), params.get('skip'), params.get('limit'
|
123
|
+
), params.get('like'), params.get('join'), params.get('count')
|
124
|
+
if not self._silence_warning:
|
125
|
+
warning_wrong_parameters(self.objects_v2.__name__, params,
|
126
|
+
official_params_list)
|
127
|
+
response = self.execute('GET', path=f'/objects/v2/', single_page=
|
128
|
+
single_page, page_size=page_size, warm_start=warm_start, params
|
129
|
+
=params, **kwargs)
|
130
|
+
return response
|
131
|
+
|
86
132
|
def object(self, uuid: str, warm_start: bool = False, kwargs: dict = None
|
87
133
|
) -> list:
|
88
134
|
"""Read Object
|
@@ -386,6 +432,7 @@ class Objects(ApiManager):
|
|
386
432
|
status (boolean optional): additional filter - parameter
|
387
433
|
active_at_timestamp (string optional): additional filter - parameter
|
388
434
|
active_after_timestamp (string optional): additional filter - parameter
|
435
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
389
436
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
390
437
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
391
438
|
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
|
@@ -396,12 +443,15 @@ class Objects(ApiManager):
|
|
396
443
|
if kwargs is None:
|
397
444
|
kwargs = dict()
|
398
445
|
official_params_list = ['not_in', 'code', 'status',
|
399
|
-
'active_at_timestamp', 'active_after_timestamp',
|
400
|
-
'limit', 'like', 'join',
|
446
|
+
'active_at_timestamp', 'active_after_timestamp',
|
447
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
448
|
+
'count']
|
401
449
|
params.get('not_in'), params.get('code'), params.get('status'
|
402
450
|
), params.get('active_at_timestamp'), params.get(
|
403
|
-
'active_after_timestamp'), params.get(
|
404
|
-
|
451
|
+
'active_after_timestamp'), params.get(
|
452
|
+
'active_at_or_after_timestamp'), params.get('skip'), params.get(
|
453
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
454
|
+
'count')
|
405
455
|
if not self._silence_warning:
|
406
456
|
warning_wrong_parameters(self.objects_downtimes.__name__,
|
407
457
|
params, official_params_list)
|
@@ -578,7 +628,7 @@ class Objects(ApiManager):
|
|
578
628
|
|
579
629
|
def objects_create_bulk(self, payload: list, single_page: bool = False,
|
580
630
|
page_size: int = 50, kwargs: dict = None, **params) -> list:
|
581
|
-
"""Bulk Create Objects
|
631
|
+
"""Bulk Create Objects With Relationship
|
582
632
|
|
583
633
|
Args:
|
584
634
|
payload (list[dict], optional): List dict to create.
|
@@ -602,6 +652,7 @@ class Objects(ApiManager):
|
|
602
652
|
"data_profile": "array object", optional
|
603
653
|
"automata_domain": "array object", optional
|
604
654
|
"status": "string", required
|
655
|
+
"uuid_groups": "array", optional
|
605
656
|
}
|
606
657
|
]
|
607
658
|
|
@@ -725,6 +776,7 @@ class Objects(ApiManager):
|
|
725
776
|
status (string optional): additional filter - parameter
|
726
777
|
active_at_timestamp (string optional): additional filter - parameter
|
727
778
|
active_after_timestamp (string optional): additional filter - parameter
|
779
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
728
780
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
729
781
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
730
782
|
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
|
@@ -741,16 +793,18 @@ class Objects(ApiManager):
|
|
741
793
|
if kwargs is None:
|
742
794
|
kwargs = dict()
|
743
795
|
official_params_list = ['code', 'status', 'active_at_timestamp',
|
744
|
-
'active_after_timestamp', '
|
796
|
+
'active_after_timestamp', 'active_at_or_after_timestamp',
|
797
|
+
'skip', 'limit', 'like', 'join', 'count']
|
745
798
|
params.get('code'), params.get('status'), params.get(
|
746
799
|
'active_at_timestamp'), params.get('active_after_timestamp'
|
747
|
-
), params.get('
|
748
|
-
), params.get('
|
800
|
+
), params.get('active_at_or_after_timestamp'), params.get('skip'
|
801
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
802
|
+
), params.get('count')
|
749
803
|
if not self._silence_warning:
|
750
804
|
warning_wrong_parameters(self.objects_downtimes_bulk.__name__,
|
751
805
|
params, official_params_list)
|
752
806
|
response = self.execute('POST', path=
|
753
|
-
f'/objects/bulk/read/downtimes
|
807
|
+
f'/objects/bulk/read/downtimes', single_page=single_page,
|
754
808
|
page_size=page_size, warm_start=warm_start, params=params,
|
755
809
|
payload=payload, **kwargs)
|
756
810
|
return response
|
hive/cookbook/probes.py
CHANGED
@@ -26,6 +26,7 @@ class Probes(ApiManager):
|
|
26
26
|
notes (string optional): additional filter - parameter
|
27
27
|
status (string optional): additional filter - parameter
|
28
28
|
extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
|
29
|
+
severity (None optional): additional filter - parameter
|
29
30
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
30
31
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
31
32
|
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
|
@@ -37,14 +38,15 @@ class Probes(ApiManager):
|
|
37
38
|
kwargs = dict()
|
38
39
|
official_params_list = ['sort_by', 'null_fields',
|
39
40
|
'uuid_virtual_domain', 'uuid_probe_type', 'uuid_host', 'name',
|
40
|
-
'description', 'notes', 'status', 'extract_severity',
|
41
|
-
'limit', 'like', 'join', 'count']
|
41
|
+
'description', 'notes', 'status', 'extract_severity',
|
42
|
+
'severity', 'skip', 'limit', 'like', 'join', 'count']
|
42
43
|
params.get('sort_by'), params.get('null_fields'), params.get(
|
43
44
|
'uuid_virtual_domain'), params.get('uuid_probe_type'), params.get(
|
44
45
|
'uuid_host'), params.get('name'), params.get('description'
|
45
46
|
), params.get('notes'), params.get('status'), params.get(
|
46
|
-
'extract_severity'), params.get('
|
47
|
-
), params.get('
|
47
|
+
'extract_severity'), params.get('severity'), params.get('skip'
|
48
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
49
|
+
), params.get('count')
|
48
50
|
if not self._silence_warning:
|
49
51
|
warning_wrong_parameters(self.probes.__name__, params,
|
50
52
|
official_params_list)
|
@@ -166,6 +168,34 @@ class Probes(ApiManager):
|
|
166
168
|
response = self.execute('DELETE', path=f'/probes/{uuid}', **kwargs)
|
167
169
|
return response
|
168
170
|
|
171
|
+
def probes_v2(self, uuid: str, warm_start: bool = False,
|
172
|
+
kwargs: dict = None, **params) -> list:
|
173
|
+
"""Read Probe V2
|
174
|
+
|
175
|
+
Args:
|
176
|
+
uuid (str, required): uuid
|
177
|
+
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.
|
178
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
179
|
+
**params: additional parameters for the API.
|
180
|
+
|
181
|
+
Keyword Args:
|
182
|
+
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
|
183
|
+
extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
|
184
|
+
|
185
|
+
Returns: list"""
|
186
|
+
if kwargs is None:
|
187
|
+
kwargs = dict()
|
188
|
+
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
189
|
+
=params)
|
190
|
+
official_params_list = ['join', 'extract_severity']
|
191
|
+
params.get('join'), params.get('extract_severity')
|
192
|
+
if not self._silence_warning:
|
193
|
+
warning_wrong_parameters(self.probes_v2.__name__, params,
|
194
|
+
official_params_list)
|
195
|
+
response = self.execute('GET', path=f'/probes/{uuid}/v2/',
|
196
|
+
warm_start=warm_start, params=params, **kwargs)
|
197
|
+
return response
|
198
|
+
|
169
199
|
def probes_agent_put(self, uuid: str, kwargs: dict = None, **payload
|
170
200
|
) -> list:
|
171
201
|
"""Agent Update Probe
|
@@ -0,0 +1,135 @@
|
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
|
+
|
3
|
+
|
4
|
+
class Questions(ApiManager):
|
5
|
+
"""Class that handles all the XAutomata questions APIs"""
|
6
|
+
|
7
|
+
def questions(self, warm_start: bool = False, single_page: bool = False,
|
8
|
+
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
9
|
+
"""Read Tracking Questions
|
10
|
+
|
11
|
+
Args:
|
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.
|
13
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
14
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
15
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
16
|
+
**params: additional parameters for the API.
|
17
|
+
|
18
|
+
Keyword Args:
|
19
|
+
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
|
20
|
+
null_fields (string optional): additional filter - parameter
|
21
|
+
type (string optional): additional filter - parameter
|
22
|
+
ts_response_start (string optional): additional filter - parameter
|
23
|
+
ts_response_end (string optional): additional filter - parameter
|
24
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
25
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
26
|
+
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
|
27
|
+
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
|
28
|
+
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
|
29
|
+
|
30
|
+
Returns: list"""
|
31
|
+
if kwargs is None:
|
32
|
+
kwargs = dict()
|
33
|
+
official_params_list = ['sort_by', 'null_fields', 'type',
|
34
|
+
'ts_response_start', 'ts_response_end', 'skip', 'limit', 'like',
|
35
|
+
'join', 'count']
|
36
|
+
params.get('sort_by'), params.get('null_fields'), params.get('type'
|
37
|
+
), params.get('ts_response_start'), params.get('ts_response_end'
|
38
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
39
|
+
), params.get('join'), params.get('count')
|
40
|
+
if not self._silence_warning:
|
41
|
+
warning_wrong_parameters(self.questions.__name__, params,
|
42
|
+
official_params_list)
|
43
|
+
response = self.execute('GET', path=f'/questions/', single_page=
|
44
|
+
single_page, page_size=page_size, warm_start=warm_start, params
|
45
|
+
=params, **kwargs)
|
46
|
+
return response
|
47
|
+
|
48
|
+
def questions_create(self, kwargs: dict = None, **payload) -> list:
|
49
|
+
"""Create Tracking Question
|
50
|
+
|
51
|
+
Args:
|
52
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
53
|
+
**payload: additional parameters for the API.
|
54
|
+
|
55
|
+
Keyword Args:
|
56
|
+
type (string required): additional filter - payload
|
57
|
+
expires_at (string required): additional filter - payload
|
58
|
+
data_profile (array object required): additional filter - payload
|
59
|
+
|
60
|
+
Returns: list"""
|
61
|
+
if kwargs is None:
|
62
|
+
kwargs = dict()
|
63
|
+
official_payload_list = ['type', 'expires_at', 'data_profile']
|
64
|
+
payload.get('type'), payload.get('expires_at'), payload.get(
|
65
|
+
'data_profile')
|
66
|
+
if not self._silence_warning:
|
67
|
+
warning_wrong_parameters(self.questions_create.__name__,
|
68
|
+
payload, official_payload_list)
|
69
|
+
response = self.execute('POST', path=f'/questions/', payload=
|
70
|
+
payload, **kwargs)
|
71
|
+
return response
|
72
|
+
|
73
|
+
def question(self, uuid: str, warm_start: bool = False, kwargs: dict = None
|
74
|
+
) -> list:
|
75
|
+
"""Read Tracking Question
|
76
|
+
|
77
|
+
Args:
|
78
|
+
uuid (str, required): uuid
|
79
|
+
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.
|
80
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
81
|
+
|
82
|
+
Returns: list"""
|
83
|
+
if kwargs is None:
|
84
|
+
kwargs = dict()
|
85
|
+
response = self.execute('GET', path=f'/questions/{uuid}',
|
86
|
+
warm_start=warm_start, **kwargs)
|
87
|
+
return response
|
88
|
+
|
89
|
+
def questions_put(self, uuid: str, kwargs: dict = None, **payload) -> list:
|
90
|
+
"""Update Tracking Question
|
91
|
+
|
92
|
+
Args:
|
93
|
+
uuid (str, required): uuid
|
94
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
95
|
+
**payload: additional parameters for the API.
|
96
|
+
|
97
|
+
Keyword Args:
|
98
|
+
token (string required): additional filter - payload
|
99
|
+
response (array object required): additional filter - payload
|
100
|
+
|
101
|
+
Returns: list"""
|
102
|
+
if kwargs is None:
|
103
|
+
kwargs = dict()
|
104
|
+
official_payload_list = ['token', 'response']
|
105
|
+
payload.get('token'), payload.get('response')
|
106
|
+
if not self._silence_warning:
|
107
|
+
warning_wrong_parameters(self.questions_put.__name__, payload,
|
108
|
+
official_payload_list)
|
109
|
+
response = self.execute('PUT', path=f'/questions/{uuid}', payload=
|
110
|
+
payload, **kwargs)
|
111
|
+
return response
|
112
|
+
|
113
|
+
def questions_reset_put(self, uuid: str, kwargs: dict = None, **payload
|
114
|
+
) -> list:
|
115
|
+
"""Reset Tracking Question
|
116
|
+
|
117
|
+
Args:
|
118
|
+
uuid (str, required): uuid
|
119
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
120
|
+
**payload: additional parameters for the API.
|
121
|
+
|
122
|
+
Keyword Args:
|
123
|
+
expires_at (string required): additional filter - payload
|
124
|
+
|
125
|
+
Returns: list"""
|
126
|
+
if kwargs is None:
|
127
|
+
kwargs = dict()
|
128
|
+
official_payload_list = ['expires_at']
|
129
|
+
payload.get('expires_at')
|
130
|
+
if not self._silence_warning:
|
131
|
+
warning_wrong_parameters(self.questions_reset_put.__name__,
|
132
|
+
payload, official_payload_list)
|
133
|
+
response = self.execute('PUT', path=f'/questions/{uuid}/reset',
|
134
|
+
payload=payload, **kwargs)
|
135
|
+
return response
|
hive/cookbook/services.py
CHANGED
@@ -246,6 +246,8 @@ class Services(ApiManager):
|
|
246
246
|
fetch_all (boolean optional): additional filter - parameter
|
247
247
|
only_actives (boolean optional): additional filter - parameter
|
248
248
|
active_at_timestamp (string optional): additional filter - parameter
|
249
|
+
active_after_timestamp (string optional): additional filter - parameter
|
250
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
249
251
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
250
252
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
251
253
|
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
|
@@ -256,12 +258,15 @@ class Services(ApiManager):
|
|
256
258
|
if kwargs is None:
|
257
259
|
kwargs = dict()
|
258
260
|
official_params_list = ['not_in', 'code', 'fetch_all',
|
259
|
-
'only_actives', 'active_at_timestamp', '
|
260
|
-
'
|
261
|
+
'only_actives', 'active_at_timestamp', 'active_after_timestamp',
|
262
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
263
|
+
'count']
|
261
264
|
params.get('not_in'), params.get('code'), params.get('fetch_all'
|
262
265
|
), params.get('only_actives'), params.get('active_at_timestamp'
|
263
|
-
), params.get('
|
264
|
-
), params.get('
|
266
|
+
), params.get('active_after_timestamp'), params.get(
|
267
|
+
'active_at_or_after_timestamp'), params.get('skip'), params.get(
|
268
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
269
|
+
'count')
|
265
270
|
if not self._silence_warning:
|
266
271
|
warning_wrong_parameters(self.services_downtimes.__name__,
|
267
272
|
params, official_params_list)
|
hive/cookbook/sites.py
CHANGED
@@ -102,6 +102,63 @@ class Sites(ApiManager):
|
|
102
102
|
payload=payload, **kwargs)
|
103
103
|
return response
|
104
104
|
|
105
|
+
def sites_v2(self, warm_start: bool = False, single_page: bool = False,
|
106
|
+
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
107
|
+
"""Read Sites V2
|
108
|
+
|
109
|
+
Args:
|
110
|
+
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.
|
111
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
112
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
113
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
114
|
+
**params: additional parameters for the API.
|
115
|
+
|
116
|
+
Keyword Args:
|
117
|
+
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
|
118
|
+
null_fields (string optional): additional filter - parameter
|
119
|
+
uuid_customer (string optional): additional filter - parameter
|
120
|
+
type (string optional): additional filter - parameter
|
121
|
+
code (string optional): additional filter - parameter
|
122
|
+
description (string optional): additional filter - parameter
|
123
|
+
address (string optional): additional filter - parameter
|
124
|
+
zip_code (string optional): additional filter - parameter
|
125
|
+
city (string optional): additional filter - parameter
|
126
|
+
country (string optional): additional filter - parameter
|
127
|
+
notes (string optional): additional filter - parameter
|
128
|
+
state_province (string optional): additional filter - parameter
|
129
|
+
status (string optional): additional filter - parameter
|
130
|
+
filter_group_types (string optional): additional filter - parameter
|
131
|
+
extract_severity (boolean optional): Se True nella risposta e' anche presente la severita, Default to False. - parameter
|
132
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
133
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
134
|
+
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
|
135
|
+
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
|
136
|
+
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
|
137
|
+
|
138
|
+
Returns: list"""
|
139
|
+
if kwargs is None:
|
140
|
+
kwargs = dict()
|
141
|
+
official_params_list = ['sort_by', 'null_fields', 'uuid_customer',
|
142
|
+
'type', 'code', 'description', 'address', 'zip_code', 'city',
|
143
|
+
'country', 'notes', 'state_province', 'status',
|
144
|
+
'filter_group_types', 'extract_severity', 'skip', 'limit',
|
145
|
+
'like', 'join', 'count']
|
146
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
147
|
+
'uuid_customer'), params.get('type'), params.get('code'
|
148
|
+
), params.get('description'), params.get('address'), params.get(
|
149
|
+
'zip_code'), params.get('city'), params.get('country'), params.get(
|
150
|
+
'notes'), params.get('state_province'), params.get('status'
|
151
|
+
), params.get('filter_group_types'), params.get('extract_severity'
|
152
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
153
|
+
), params.get('join'), params.get('count')
|
154
|
+
if not self._silence_warning:
|
155
|
+
warning_wrong_parameters(self.sites_v2.__name__, params,
|
156
|
+
official_params_list)
|
157
|
+
response = self.execute('GET', path=f'/sites/v2/', single_page=
|
158
|
+
single_page, page_size=page_size, warm_start=warm_start, params
|
159
|
+
=params, **kwargs)
|
160
|
+
return response
|
161
|
+
|
105
162
|
def site(self, uuid: str, warm_start: bool = False, kwargs: dict = None,
|
106
163
|
**params) -> list:
|
107
164
|
"""Read Site
|