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/api.py
CHANGED
@@ -140,7 +140,7 @@ class ApiManager:
|
|
140
140
|
|
141
141
|
# il controllo qui impedisce di fare chiamate se in modalita POST DELETE PUT se in modalita test,
|
142
142
|
# con l'eccezione della presenza della parola read nel path che indica una bulk in lettura
|
143
|
-
if self._get_only and not(read and bulk) and not query:
|
143
|
+
if self._get_only and not (read and bulk) and not query:
|
144
144
|
raise ValueError('you are trying to access a not get_only API')
|
145
145
|
|
146
146
|
# tutto quello che non è bulk e query gli viene impedito di paginare
|
@@ -489,6 +489,7 @@ from hive.cookbook.dispatchers import Dispatchers
|
|
489
489
|
from hive.cookbook.downtimes import Downtimes
|
490
490
|
from hive.cookbook.external_tickets import ExternalTickets
|
491
491
|
from hive.cookbook.features import Features
|
492
|
+
from hive.cookbook.files import Files
|
492
493
|
from hive.cookbook.firmware_updates import FirmwareUpdates
|
493
494
|
from hive.cookbook.groups import Groups
|
494
495
|
from hive.cookbook.automata_ingest import AutomataIngest
|
@@ -508,17 +509,21 @@ from hive.cookbook.opening_reasons import OpeningReasons
|
|
508
509
|
from hive.cookbook.probes import Probes
|
509
510
|
from hive.cookbook.probe_types import ProbeTypes
|
510
511
|
from hive.cookbook.profile_topics import ProfileTopics
|
512
|
+
from hive.cookbook.questions import Questions
|
511
513
|
from hive.cookbook.reason_for_closure import ReasonForClosure
|
512
514
|
from hive.cookbook.retention_rules import RetentionRules
|
513
515
|
from hive.cookbook.schedules import Schedules
|
514
516
|
from hive.cookbook.services import Services
|
515
517
|
from hive.cookbook.sites import Sites
|
516
518
|
from hive.cookbook.last_status import LastStatus
|
519
|
+
from hive.cookbook.last_status_v2 import LastStatusV2
|
517
520
|
from hive.cookbook.terms_and_conditions import TermsAndConditions
|
518
521
|
from hive.cookbook.tree_hierarchy import TreeHierarchy
|
522
|
+
from hive.cookbook.tree_hierarchy_v2 import TreeHierarchyV2
|
519
523
|
from hive.cookbook.ts_automata_state import TsAutomataState
|
520
524
|
from hive.cookbook.ts_cost_azure_raw import TsCostAzureRaw
|
521
525
|
from hive.cookbook.ts_cost_management import TsCostManagement
|
526
|
+
from hive.cookbook.ts_cost_management_v2 import TsCostManagementV2
|
522
527
|
from hive.cookbook.ts_metric_status import TsMetricStatus
|
523
528
|
from hive.cookbook.ts_metric_value import TsMetricValue
|
524
529
|
from hive.cookbook.ts_ntop_flows import TsNtopFlows
|
@@ -533,7 +538,7 @@ from hive.cookbook.widget_groups import WidgetGroups
|
|
533
538
|
# hive imports stop
|
534
539
|
|
535
540
|
|
536
|
-
class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, CostTreeNodes, CostTreeResources, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, FirmwareUpdates, Groups, AutomataIngest, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, TermsAndConditions, TreeHierarchy, TsAutomataState, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
|
541
|
+
class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, CostTagging, CostTags, CostViews, CostTreeNodes, CostTreeResources, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, Features, Files, FirmwareUpdates, Groups, AutomataIngest, MetricIngest, Microsoft, Google, Login, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, Questions, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, LastStatusV2, TermsAndConditions, TreeHierarchy, TreeHierarchyV2, TsAutomataState, TsCostAzureRaw, TsCostManagement, TsCostManagementV2, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
|
537
542
|
"""
|
538
543
|
Class with each specific API, based on the ApiManager Class created for a more general interaction with Xautomata API
|
539
544
|
"""
|
hive/cookbook/calendars.py
CHANGED
@@ -20,6 +20,7 @@ class Calendars(ApiManager):
|
|
20
20
|
null_fields (string optional): additional filter - parameter
|
21
21
|
name (string optional): additional filter - parameter
|
22
22
|
local_public_holidays (boolean optional): additional filter - parameter
|
23
|
+
timezone (string optional): additional filter - parameter
|
23
24
|
mon_int1_start (string optional): additional filter - parameter
|
24
25
|
mon_int1_end (string optional): additional filter - parameter
|
25
26
|
mon_int2_start (string optional): additional filter - parameter
|
@@ -58,35 +59,35 @@ class Calendars(ApiManager):
|
|
58
59
|
if kwargs is None:
|
59
60
|
kwargs = dict()
|
60
61
|
official_params_list = ['sort_by', 'null_fields', 'name',
|
61
|
-
'local_public_holidays', '
|
62
|
-
'
|
63
|
-
'
|
64
|
-
'
|
65
|
-
'
|
66
|
-
'
|
67
|
-
'
|
68
|
-
'
|
69
|
-
'
|
70
|
-
'
|
71
|
-
'join', 'count']
|
62
|
+
'local_public_holidays', 'timezone', 'mon_int1_start',
|
63
|
+
'mon_int1_end', 'mon_int2_start', 'mon_int2_end',
|
64
|
+
'tue_int1_start', 'tue_int1_end', 'tue_int2_start',
|
65
|
+
'tue_int2_end', 'wed_int1_start', 'wed_int1_end',
|
66
|
+
'wed_int2_start', 'wed_int2_end', 'thu_int1_start',
|
67
|
+
'thu_int1_end', 'thu_int2_start', 'thu_int2_end',
|
68
|
+
'fri_int1_start', 'fri_int1_end', 'fri_int2_start',
|
69
|
+
'fri_int2_end', 'sat_int1_start', 'sat_int1_end',
|
70
|
+
'sat_int2_start', 'sat_int2_end', 'sun_int1_start',
|
71
|
+
'sun_int1_end', 'sun_int2_start', 'sun_int2_end', 'skip',
|
72
|
+
'limit', 'like', 'join', 'count']
|
72
73
|
params.get('sort_by'), params.get('null_fields'), params.get('name'
|
73
|
-
), params.get('local_public_holidays'), params.get('
|
74
|
-
), params.get('
|
75
|
-
), params.get('
|
76
|
-
), params.get('
|
77
|
-
), params.get('
|
78
|
-
), params.get('
|
79
|
-
), params.get('
|
80
|
-
), params.get('
|
81
|
-
), params.get('
|
82
|
-
), params.get('
|
83
|
-
), params.get('
|
84
|
-
), params.get('
|
85
|
-
), params.get('
|
86
|
-
), params.get('
|
87
|
-
), params.get('
|
88
|
-
|
89
|
-
'count')
|
74
|
+
), params.get('local_public_holidays'), params.get('timezone'
|
75
|
+
), params.get('mon_int1_start'), params.get('mon_int1_end'
|
76
|
+
), params.get('mon_int2_start'), params.get('mon_int2_end'
|
77
|
+
), params.get('tue_int1_start'), params.get('tue_int1_end'
|
78
|
+
), params.get('tue_int2_start'), params.get('tue_int2_end'
|
79
|
+
), params.get('wed_int1_start'), params.get('wed_int1_end'
|
80
|
+
), params.get('wed_int2_start'), params.get('wed_int2_end'
|
81
|
+
), params.get('thu_int1_start'), params.get('thu_int1_end'
|
82
|
+
), params.get('thu_int2_start'), params.get('thu_int2_end'
|
83
|
+
), params.get('fri_int1_start'), params.get('fri_int1_end'
|
84
|
+
), params.get('fri_int2_start'), params.get('fri_int2_end'
|
85
|
+
), params.get('sat_int1_start'), params.get('sat_int1_end'
|
86
|
+
), params.get('sat_int2_start'), params.get('sat_int2_end'
|
87
|
+
), params.get('sun_int1_start'), params.get('sun_int1_end'
|
88
|
+
), params.get('sun_int2_start'), params.get('sun_int2_end'
|
89
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
90
|
+
), params.get('join'), params.get('count')
|
90
91
|
if not self._silence_warning:
|
91
92
|
warning_wrong_parameters(self.calendars.__name__, params,
|
92
93
|
official_params_list)
|
@@ -104,6 +105,7 @@ class Calendars(ApiManager):
|
|
104
105
|
|
105
106
|
Keyword Args:
|
106
107
|
name (string required): additional filter - payload
|
108
|
+
timezone (string required): additional filter - payload
|
107
109
|
local_public_holidays (boolean required): additional filter - payload
|
108
110
|
mon_int1_start (string optional): additional filter - payload
|
109
111
|
mon_int1_end (string optional): additional filter - payload
|
@@ -137,31 +139,33 @@ class Calendars(ApiManager):
|
|
137
139
|
Returns: list"""
|
138
140
|
if kwargs is None:
|
139
141
|
kwargs = dict()
|
140
|
-
official_payload_list = ['name', '
|
141
|
-
'
|
142
|
-
'
|
143
|
-
'
|
144
|
-
'
|
145
|
-
'
|
146
|
-
'
|
147
|
-
'
|
148
|
-
'
|
149
|
-
'
|
150
|
-
|
151
|
-
|
152
|
-
'
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
'
|
142
|
+
official_payload_list = ['name', 'timezone',
|
143
|
+
'local_public_holidays', 'mon_int1_start', 'mon_int1_end',
|
144
|
+
'mon_int2_start', 'mon_int2_end', 'tue_int1_start',
|
145
|
+
'tue_int1_end', 'tue_int2_start', 'tue_int2_end',
|
146
|
+
'wed_int1_start', 'wed_int1_end', 'wed_int2_start',
|
147
|
+
'wed_int2_end', 'thu_int1_start', 'thu_int1_end',
|
148
|
+
'thu_int2_start', 'thu_int2_end', 'fri_int1_start',
|
149
|
+
'fri_int1_end', 'fri_int2_start', 'fri_int2_end',
|
150
|
+
'sat_int1_start', 'sat_int1_end', 'sat_int2_start',
|
151
|
+
'sat_int2_end', 'sun_int1_start', 'sun_int1_end',
|
152
|
+
'sun_int2_start', 'sun_int2_end']
|
153
|
+
payload.get('name'), payload.get('timezone'), payload.get(
|
154
|
+
'local_public_holidays'), payload.get('mon_int1_start'
|
155
|
+
), payload.get('mon_int1_end'), payload.get('mon_int2_start'
|
156
|
+
), payload.get('mon_int2_end'), payload.get('tue_int1_start'
|
157
|
+
), payload.get('tue_int1_end'), payload.get('tue_int2_start'
|
158
|
+
), payload.get('tue_int2_end'), payload.get('wed_int1_start'
|
159
|
+
), payload.get('wed_int1_end'), payload.get('wed_int2_start'
|
160
|
+
), payload.get('wed_int2_end'), payload.get('thu_int1_start'
|
161
|
+
), payload.get('thu_int1_end'), payload.get('thu_int2_start'
|
162
|
+
), payload.get('thu_int2_end'), payload.get('fri_int1_start'
|
163
|
+
), payload.get('fri_int1_end'), payload.get('fri_int2_start'
|
164
|
+
), payload.get('fri_int2_end'), payload.get('sat_int1_start'
|
165
|
+
), payload.get('sat_int1_end'), payload.get('sat_int2_start'
|
166
|
+
), payload.get('sat_int2_end'), payload.get('sun_int1_start'
|
167
|
+
), payload.get('sun_int1_end'), payload.get('sun_int2_start'
|
168
|
+
), payload.get('sun_int2_end')
|
165
169
|
if not self._silence_warning:
|
166
170
|
warning_wrong_parameters(self.calendars_create.__name__,
|
167
171
|
payload, official_payload_list)
|
@@ -195,6 +199,7 @@ class Calendars(ApiManager):
|
|
195
199
|
|
196
200
|
Keyword Args:
|
197
201
|
name (string optional): additional filter - payload
|
202
|
+
timezone (string optional): additional filter - payload
|
198
203
|
local_public_holidays (boolean optional): additional filter - payload
|
199
204
|
mon_int1_start (string optional): additional filter - payload
|
200
205
|
mon_int1_end (string optional): additional filter - payload
|
@@ -228,31 +233,33 @@ class Calendars(ApiManager):
|
|
228
233
|
Returns: list"""
|
229
234
|
if kwargs is None:
|
230
235
|
kwargs = dict()
|
231
|
-
official_payload_list = ['name', '
|
232
|
-
'
|
233
|
-
'
|
234
|
-
'
|
235
|
-
'
|
236
|
-
'
|
237
|
-
'
|
238
|
-
'
|
239
|
-
'
|
240
|
-
'
|
241
|
-
|
242
|
-
|
243
|
-
'
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
'
|
236
|
+
official_payload_list = ['name', 'timezone',
|
237
|
+
'local_public_holidays', 'mon_int1_start', 'mon_int1_end',
|
238
|
+
'mon_int2_start', 'mon_int2_end', 'tue_int1_start',
|
239
|
+
'tue_int1_end', 'tue_int2_start', 'tue_int2_end',
|
240
|
+
'wed_int1_start', 'wed_int1_end', 'wed_int2_start',
|
241
|
+
'wed_int2_end', 'thu_int1_start', 'thu_int1_end',
|
242
|
+
'thu_int2_start', 'thu_int2_end', 'fri_int1_start',
|
243
|
+
'fri_int1_end', 'fri_int2_start', 'fri_int2_end',
|
244
|
+
'sat_int1_start', 'sat_int1_end', 'sat_int2_start',
|
245
|
+
'sat_int2_end', 'sun_int1_start', 'sun_int1_end',
|
246
|
+
'sun_int2_start', 'sun_int2_end']
|
247
|
+
payload.get('name'), payload.get('timezone'), payload.get(
|
248
|
+
'local_public_holidays'), payload.get('mon_int1_start'
|
249
|
+
), payload.get('mon_int1_end'), payload.get('mon_int2_start'
|
250
|
+
), payload.get('mon_int2_end'), payload.get('tue_int1_start'
|
251
|
+
), payload.get('tue_int1_end'), payload.get('tue_int2_start'
|
252
|
+
), payload.get('tue_int2_end'), payload.get('wed_int1_start'
|
253
|
+
), payload.get('wed_int1_end'), payload.get('wed_int2_start'
|
254
|
+
), payload.get('wed_int2_end'), payload.get('thu_int1_start'
|
255
|
+
), payload.get('thu_int1_end'), payload.get('thu_int2_start'
|
256
|
+
), payload.get('thu_int2_end'), payload.get('fri_int1_start'
|
257
|
+
), payload.get('fri_int1_end'), payload.get('fri_int2_start'
|
258
|
+
), payload.get('fri_int2_end'), payload.get('sat_int1_start'
|
259
|
+
), payload.get('sat_int1_end'), payload.get('sat_int2_start'
|
260
|
+
), payload.get('sat_int2_end'), payload.get('sun_int1_start'
|
261
|
+
), payload.get('sun_int1_end'), payload.get('sun_int2_start'
|
262
|
+
), payload.get('sun_int2_end')
|
256
263
|
if not self._silence_warning:
|
257
264
|
warning_wrong_parameters(self.calendars_put.__name__, payload,
|
258
265
|
official_payload_list)
|
@@ -328,6 +335,7 @@ class Calendars(ApiManager):
|
|
328
335
|
[
|
329
336
|
{
|
330
337
|
"name": "string", required
|
338
|
+
"timezone": "string", required
|
331
339
|
"local_public_holidays": "boolean", required
|
332
340
|
"mon_int1_start": "string", optional
|
333
341
|
"mon_int1_end": "string", optional
|
hive/cookbook/cost_tree_nodes.py
CHANGED
@@ -140,18 +140,28 @@ class CostTreeNodes(ApiManager):
|
|
140
140
|
payload=payload, **kwargs)
|
141
141
|
return response
|
142
142
|
|
143
|
-
def cost_tree_nodes_delete(self, uuid: str, kwargs: dict = None
|
143
|
+
def cost_tree_nodes_delete(self, uuid: str, kwargs: dict = None, **params
|
144
|
+
) -> list:
|
144
145
|
"""Delete Cost Tree Node
|
145
146
|
|
146
147
|
Args:
|
147
148
|
uuid (str, required): uuid
|
148
149
|
kwargs (dict, optional): additional parameters for execute. Default to None.
|
150
|
+
**params: additional parameters for the API.
|
151
|
+
|
152
|
+
Keyword Args:
|
153
|
+
delete_resources (boolean optional): additional filter - parameter
|
149
154
|
|
150
155
|
Returns: list"""
|
151
156
|
if kwargs is None:
|
152
157
|
kwargs = dict()
|
158
|
+
official_params_list = ['delete_resources']
|
159
|
+
params.get('delete_resources')
|
160
|
+
if not self._silence_warning:
|
161
|
+
warning_wrong_parameters(self.cost_tree_nodes_delete.__name__,
|
162
|
+
params, official_params_list)
|
153
163
|
response = self.execute('DELETE', path=f'/cost_tree_nodes/{uuid}',
|
154
|
-
**kwargs)
|
164
|
+
params=params, **kwargs)
|
155
165
|
return response
|
156
166
|
|
157
167
|
def cost_tree_nodes_navigate_tree(self, uuid: str,
|
@@ -156,12 +156,15 @@ class CostTreeResources(ApiManager):
|
|
156
156
|
return response
|
157
157
|
|
158
158
|
def cost_tree_resources_unfully_assigned_resources(self, uuid_view: str,
|
159
|
-
warm_start: bool = False,
|
159
|
+
warm_start: bool = False, single_page: bool = False,
|
160
|
+
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
160
161
|
"""Get Unfully Assigned Resources
|
161
162
|
|
162
163
|
Args:
|
163
164
|
uuid_view (str, required): uuid_view
|
164
165
|
warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
|
166
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
167
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
165
168
|
kwargs (dict, optional): additional parameters for execute. Default to None.
|
166
169
|
**params: additional parameters for the API.
|
167
170
|
|
@@ -169,25 +172,27 @@ class CostTreeResources(ApiManager):
|
|
169
172
|
date_start (string required): additional filter - parameter
|
170
173
|
date_end (string required): additional filter - parameter
|
171
174
|
resource_id (string optional): additional filter - parameter
|
175
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
172
176
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
177
|
+
count (boolean optional): Se True nel header della risposta e' presente la dimensione massima a db della chiamata fatta, sconsigliabile perche raddoppia il tempo per chiamata. Default to False. - parameter
|
173
178
|
sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
|
174
179
|
|
175
180
|
Returns: list"""
|
176
181
|
if kwargs is None:
|
177
182
|
kwargs = dict()
|
178
|
-
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
179
|
-
=params)
|
180
183
|
official_params_list = ['date_start', 'date_end', 'resource_id',
|
181
|
-
'limit', 'sort_by']
|
184
|
+
'skip', 'limit', 'count', 'sort_by']
|
182
185
|
params.get('date_start'), params.get('date_end'), params.get(
|
183
|
-
'resource_id'), params.get('
|
186
|
+
'resource_id'), params.get('skip'), params.get('limit'
|
187
|
+
), params.get('count'), params.get('sort_by')
|
184
188
|
if not self._silence_warning:
|
185
189
|
warning_wrong_parameters(self.
|
186
190
|
cost_tree_resources_unfully_assigned_resources.__name__,
|
187
191
|
params, official_params_list)
|
188
192
|
response = self.execute('GET', path=
|
189
193
|
f'/cost_tree_resources/{uuid_view}/unfully_assigned_resources/',
|
190
|
-
|
194
|
+
single_page=single_page, page_size=page_size, warm_start=
|
195
|
+
warm_start, params=params, **kwargs)
|
191
196
|
return response
|
192
197
|
|
193
198
|
def cost_tree_resources_delete_bulk(self, payload: list,
|
hive/cookbook/customers.py
CHANGED
@@ -309,6 +309,57 @@ class Customers(ApiManager):
|
|
309
309
|
warm_start, params=params, **kwargs)
|
310
310
|
return response
|
311
311
|
|
312
|
+
def customers_groups_v2(self, uuid: str, warm_start: bool = False,
|
313
|
+
single_page: bool = False, page_size: int = 5000,
|
314
|
+
kwargs: dict = None, **params) -> list:
|
315
|
+
"""List Groups V2
|
316
|
+
|
317
|
+
Args:
|
318
|
+
uuid (str, required): uuid
|
319
|
+
warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
|
320
|
+
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
321
|
+
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
322
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
323
|
+
**params: additional parameters for the API.
|
324
|
+
|
325
|
+
Keyword Args:
|
326
|
+
sort_by (string optional): Stringa separata da virgole di campi su cui ordinare. Si indica uno o piu campi della risposta e si puo chiedere di ottenere i valori di quei campi in ordine ascendente o discendente. Esempio "Customer:Desc". Default to "". - parameter
|
327
|
+
null_fields (string optional): additional filter - parameter
|
328
|
+
uuid_parent (string optional): additional filter - parameter
|
329
|
+
uuid_site (string optional): additional filter - parameter
|
330
|
+
uuid_virtual_domain (string optional): additional filter - parameter
|
331
|
+
object_profile (string optional): additional filter - parameter
|
332
|
+
type (string optional): additional filter - parameter
|
333
|
+
name (string optional): additional filter - parameter
|
334
|
+
description (string optional): additional filter - parameter
|
335
|
+
status (string optional): additional filter - parameter
|
336
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
337
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
338
|
+
like (boolean optional): Se True, eventuali filtri richiesti dalla API vengono presi come porzioni di testo, se False il matching sul campo dei filtri deve essere esatto. Default to True. - parameter
|
339
|
+
join (boolean optional): Se join = true, ogni riga restituita conterra' chiavi aggiuntive che fanno riferimento ad altre entita', con cui la riga ha relazioni 1:1. Default to False - parameter
|
340
|
+
count (boolean optional): Se True nel header della risposta e' presente la dimensione massima a db della chiamata fatta, sconsigliabile perche raddoppia il tempo per chiamata. Default to False. - parameter
|
341
|
+
|
342
|
+
Returns: list"""
|
343
|
+
if kwargs is None:
|
344
|
+
kwargs = dict()
|
345
|
+
official_params_list = ['sort_by', 'null_fields', 'uuid_parent',
|
346
|
+
'uuid_site', 'uuid_virtual_domain', 'object_profile', 'type',
|
347
|
+
'name', 'description', 'status', 'skip', 'limit', 'like',
|
348
|
+
'join', 'count']
|
349
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
350
|
+
'uuid_parent'), params.get('uuid_site'), params.get(
|
351
|
+
'uuid_virtual_domain'), params.get('object_profile'), params.get(
|
352
|
+
'type'), params.get('name'), params.get('description'), params.get(
|
353
|
+
'status'), params.get('skip'), params.get('limit'), params.get(
|
354
|
+
'like'), params.get('join'), params.get('count')
|
355
|
+
if not self._silence_warning:
|
356
|
+
warning_wrong_parameters(self.customers_groups_v2.__name__,
|
357
|
+
params, official_params_list)
|
358
|
+
response = self.execute('GET', path=f'/customers/{uuid}/groups/v2/',
|
359
|
+
single_page=single_page, page_size=page_size, warm_start=
|
360
|
+
warm_start, params=params, **kwargs)
|
361
|
+
return response
|
362
|
+
|
312
363
|
def customers_image(self, uuid: str, warm_start: bool = False,
|
313
364
|
kwargs: dict = None) -> list:
|
314
365
|
"""Get Customer Image
|
hive/cookbook/features.py
CHANGED
@@ -4,16 +4,28 @@ from hive.api import ApiManager, handling_single_page_methods, warning_wrong_par
|
|
4
4
|
class Features(ApiManager):
|
5
5
|
"""Class that handles all the XAutomata features APIs"""
|
6
6
|
|
7
|
-
def features(self, warm_start: bool = False, kwargs: dict = None
|
7
|
+
def features(self, warm_start: bool = False, kwargs: dict = None, **params
|
8
|
+
) -> list:
|
8
9
|
"""Get Api Features Settings
|
9
10
|
|
10
11
|
Args:
|
11
12
|
warm_start (bool, optional): salva la risposta in un file e se viene richiamata la stessa funzione con gli stessi argomenti restituisce il contenuto del file. Default to False.
|
12
13
|
kwargs (dict, optional): additional parameters for execute. Default to None.
|
14
|
+
**params: additional parameters for the API.
|
15
|
+
|
16
|
+
Keyword Args:
|
17
|
+
user-agent (string optional): additional filter - parameter
|
13
18
|
|
14
19
|
Returns: list"""
|
15
20
|
if kwargs is None:
|
16
21
|
kwargs = dict()
|
22
|
+
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
23
|
+
=params)
|
24
|
+
official_params_list = ['user-agent']
|
25
|
+
params.get('user-agent')
|
26
|
+
if not self._silence_warning:
|
27
|
+
warning_wrong_parameters(self.features.__name__, params,
|
28
|
+
official_params_list)
|
17
29
|
response = self.execute('GET', path=f'/features/', warm_start=
|
18
|
-
warm_start, **kwargs)
|
30
|
+
warm_start, params=params, **kwargs)
|
19
31
|
return response
|
hive/cookbook/files.py
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
|
+
|
3
|
+
|
4
|
+
class Files(ApiManager):
|
5
|
+
"""Class that handles all the XAutomata files APIs"""
|
6
|
+
|
7
|
+
def files(self, warm_start: bool = False, single_page: bool = False,
|
8
|
+
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
9
|
+
"""List User Files
|
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
|
+
name (string optional): additional filter - parameter
|
20
|
+
username (string optional): additional filter - parameter
|
21
|
+
uuid_service (string optional): additional filter - parameter
|
22
|
+
type (string optional): additional filter - parameter
|
23
|
+
start_ts (string optional): additional filter - parameter
|
24
|
+
end_ts (string optional): additional filter - parameter
|
25
|
+
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
26
|
+
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
27
|
+
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
|
28
|
+
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
|
29
|
+
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
|
30
|
+
|
31
|
+
Returns: list"""
|
32
|
+
if kwargs is None:
|
33
|
+
kwargs = dict()
|
34
|
+
official_params_list = ['name', 'username', 'uuid_service', 'type',
|
35
|
+
'start_ts', 'end_ts', 'skip', 'limit', 'like', 'join', 'count']
|
36
|
+
params.get('name'), params.get('username'), params.get('uuid_service'
|
37
|
+
), params.get('type'), params.get('start_ts'), params.get('end_ts'
|
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.files.__name__, params,
|
42
|
+
official_params_list)
|
43
|
+
response = self.execute('GET', path=f'/files/', single_page=
|
44
|
+
single_page, page_size=page_size, warm_start=warm_start, params
|
45
|
+
=params, **kwargs)
|
46
|
+
return response
|
47
|
+
|
48
|
+
def files_create(self, params: dict = False, kwargs: dict = None, **payload
|
49
|
+
) -> list:
|
50
|
+
"""Post User File
|
51
|
+
|
52
|
+
Args:
|
53
|
+
params (dict, optional): additional parameters for the API.
|
54
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
55
|
+
**payload: additional parameters for the API.
|
56
|
+
|
57
|
+
Keyword Args:
|
58
|
+
uuid_service (string optional): additional filter - parameter
|
59
|
+
file (string required): additional filter - payload
|
60
|
+
|
61
|
+
Returns: list"""
|
62
|
+
if kwargs is None:
|
63
|
+
kwargs = dict()
|
64
|
+
official_payload_list = ['file']
|
65
|
+
payload.get('file')
|
66
|
+
if not self._silence_warning:
|
67
|
+
warning_wrong_parameters(self.files_create.__name__, payload,
|
68
|
+
official_payload_list)
|
69
|
+
response = self.execute('POST', path=f'/files/', params=params,
|
70
|
+
payload=payload, **kwargs)
|
71
|
+
return response
|
72
|
+
|
73
|
+
def files_download(self, uuid: str, warm_start: bool = False,
|
74
|
+
kwargs: dict = None) -> list:
|
75
|
+
"""Download User File
|
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'/files/{uuid}/download',
|
86
|
+
warm_start=warm_start, **kwargs)
|
87
|
+
return response
|