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 +9 -6
- 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/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 +15 -18
- hive/cookbook/probes.py +6 -4
- hive/cookbook/questions.py +135 -0
- hive/cookbook/services.py +9 -4
- 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.0.dist-info → xautomata_hive-3.20.0.dist-info}/METADATA +2 -2
- {xautomata_hive-3.19.0.dist-info → xautomata_hive-3.20.0.dist-info}/RECORD +22 -18
- {xautomata_hive-3.19.0.dist-info → xautomata_hive-3.20.0.dist-info}/WHEEL +1 -1
- {xautomata_hive-3.19.0.dist-info → xautomata_hive-3.20.0.dist-info}/LICENSE +0 -0
- {xautomata_hive-3.19.0.dist-info → xautomata_hive-3.20.0.dist-info}/top_level.txt +0 -0
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)
|
hive/cookbook/objects.py
CHANGED
@@ -386,6 +386,7 @@ class Objects(ApiManager):
|
|
386
386
|
status (boolean optional): additional filter - parameter
|
387
387
|
active_at_timestamp (string optional): additional filter - parameter
|
388
388
|
active_after_timestamp (string optional): additional filter - parameter
|
389
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
389
390
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
390
391
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
391
392
|
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 +397,15 @@ class Objects(ApiManager):
|
|
396
397
|
if kwargs is None:
|
397
398
|
kwargs = dict()
|
398
399
|
official_params_list = ['not_in', 'code', 'status',
|
399
|
-
'active_at_timestamp', 'active_after_timestamp',
|
400
|
-
'limit', 'like', 'join',
|
400
|
+
'active_at_timestamp', 'active_after_timestamp',
|
401
|
+
'active_at_or_after_timestamp', 'skip', 'limit', 'like', 'join',
|
402
|
+
'count']
|
401
403
|
params.get('not_in'), params.get('code'), params.get('status'
|
402
404
|
), params.get('active_at_timestamp'), params.get(
|
403
|
-
'active_after_timestamp'), params.get(
|
404
|
-
|
405
|
+
'active_after_timestamp'), params.get(
|
406
|
+
'active_at_or_after_timestamp'), params.get('skip'), params.get(
|
407
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
408
|
+
'count')
|
405
409
|
if not self._silence_warning:
|
406
410
|
warning_wrong_parameters(self.objects_downtimes.__name__,
|
407
411
|
params, official_params_list)
|
@@ -710,7 +714,7 @@ class Objects(ApiManager):
|
|
710
714
|
def objects_downtimes_bulk(self, payload: list,
|
711
715
|
warm_start: bool = False, single_page: bool = False,
|
712
716
|
page_size: int = 50, kwargs: dict = None, **params) -> list:
|
713
|
-
"""Bulk Read Downtimes
|
717
|
+
"""Bulk Read Objects Downtimes
|
714
718
|
|
715
719
|
Args:
|
716
720
|
payload (list[dict], optional): List dict to create.
|
@@ -721,15 +725,10 @@ class Objects(ApiManager):
|
|
721
725
|
**params: additional parameters for the API.
|
722
726
|
|
723
727
|
Keyword Args:
|
724
|
-
code (string optional): additional filter - parameter
|
725
|
-
status (string optional): additional filter - parameter
|
726
728
|
active_at_timestamp (string optional): additional filter - parameter
|
727
729
|
active_after_timestamp (string optional): additional filter - parameter
|
728
|
-
|
729
|
-
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
730
|
-
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
|
730
|
+
active_at_or_after_timestamp (string optional): additional filter - parameter
|
731
731
|
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
|
732
|
-
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
|
733
732
|
|
734
733
|
Examples:
|
735
734
|
payload =
|
@@ -740,17 +739,15 @@ class Objects(ApiManager):
|
|
740
739
|
Returns: list"""
|
741
740
|
if kwargs is None:
|
742
741
|
kwargs = dict()
|
743
|
-
official_params_list = ['
|
744
|
-
'active_after_timestamp', '
|
745
|
-
params.get('
|
746
|
-
'
|
747
|
-
), params.get('skip'), params.get('limit'), params.get('like'
|
748
|
-
), params.get('join'), params.get('count')
|
742
|
+
official_params_list = ['active_at_timestamp',
|
743
|
+
'active_after_timestamp', 'active_at_or_after_timestamp', 'join']
|
744
|
+
params.get('active_at_timestamp'), params.get('active_after_timestamp'
|
745
|
+
), params.get('active_at_or_after_timestamp'), params.get('join')
|
749
746
|
if not self._silence_warning:
|
750
747
|
warning_wrong_parameters(self.objects_downtimes_bulk.__name__,
|
751
748
|
params, official_params_list)
|
752
749
|
response = self.execute('POST', path=
|
753
|
-
f'/objects/bulk/read/downtimes
|
750
|
+
f'/objects/bulk/read/downtimes', single_page=single_page,
|
754
751
|
page_size=page_size, warm_start=warm_start, params=params,
|
755
752
|
payload=payload, **kwargs)
|
756
753
|
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)
|
@@ -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)
|