xautomata-hive 3.20.2__py3-none-any.whl → 3.22.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 +10 -5
- hive/cookbook/calendars.py +27 -0
- hive/cookbook/cost_tree_nodes.py +1 -34
- hive/cookbook/cost_tree_resources.py +17 -80
- hive/cookbook/customers.py +72 -53
- hive/cookbook/groups.py +2 -96
- hive/cookbook/last_object_status.py +1 -1
- hive/cookbook/last_status.py +1 -1
- hive/cookbook/metric_types.py +1 -50
- hive/cookbook/metrics.py +1 -50
- hive/cookbook/objects.py +1 -47
- hive/cookbook/probes.py +1 -29
- hive/cookbook/services.py +214 -6
- hive/cookbook/sites.py +1 -58
- hive/cookbook/webhooks.py +17 -3
- hive/decorators.py +32 -6
- hive/version.py +1 -1
- {xautomata_hive-3.20.2.dist-info → xautomata_hive-3.22.0.dist-info}/METADATA +9 -2
- {xautomata_hive-3.20.2.dist-info → xautomata_hive-3.22.0.dist-info}/RECORD +22 -22
- {xautomata_hive-3.20.2.dist-info → xautomata_hive-3.22.0.dist-info}/WHEEL +1 -1
- {xautomata_hive-3.20.2.dist-info → xautomata_hive-3.22.0.dist-info}/LICENSE +0 -0
- {xautomata_hive-3.20.2.dist-info → xautomata_hive-3.22.0.dist-info}/top_level.txt +0 -0
hive/api.py
CHANGED
@@ -52,6 +52,7 @@ class ApiManager:
|
|
52
52
|
_timeout_sleep_time = 120 # tempo di attesa tra un retry e quello successivo in caso di timeout
|
53
53
|
_silence_warning = False # da implementare
|
54
54
|
num_items = None # serve per quando si mette la count a True, di default vale 0
|
55
|
+
response = [] # variabile in cui mettere la risposta degli endpoing per poter accedere alla versione originale
|
55
56
|
|
56
57
|
def __init__(self, root, user, password, ssl_verify: bool = True):
|
57
58
|
|
@@ -155,6 +156,8 @@ class ApiManager:
|
|
155
156
|
|
156
157
|
url = f'{self.root}{path}'
|
157
158
|
|
159
|
+
self.response = [] # reset dell'attributo responce, cosi da non accodare risposte proveninenti da richieste diverse
|
160
|
+
|
158
161
|
@warmstart(active=warm_start, args_ex=[2], verbose=False)
|
159
162
|
@paginate(single_page=single_page, page_size=page_size, skip=_params_['skip'], limit=_params_['limit'], bulk=bulk)
|
160
163
|
@timeout_retry(max_tries=self._timeout_retry, sleep_time=self._timeout_sleep_time)
|
@@ -166,7 +169,8 @@ class ApiManager:
|
|
166
169
|
logger.debug(f'request params (skip and limit may differ from your setting due pagination): {_params}')
|
167
170
|
logger.debug(f'request payload: {_payload}')
|
168
171
|
|
169
|
-
response = get_session(self._timeout, self._timeout_get_session_retry, self._timeout_get_session_backoff_factor).request(_mode, url=_url, json=_payload, params=_params,
|
172
|
+
response = get_session(self._timeout, self._timeout_get_session_retry, self._timeout_get_session_backoff_factor).request(_mode, url=_url, json=_payload, params=_params,
|
173
|
+
headers=_headers, verify=self._SSL_verify, **_kwargs)
|
170
174
|
if response.status_code == 401: raise UnauthorizedException
|
171
175
|
if response.status_code != 200 and response.status_code != 504: # 504 non e' gestito dalle API per cui la responce non sarebbe json serializable
|
172
176
|
logger.error(response.json())
|
@@ -178,6 +182,8 @@ class ApiManager:
|
|
178
182
|
logger.debug(f'responce: {response.json()}')
|
179
183
|
logger.debug(f'header: {response.headers}')
|
180
184
|
|
185
|
+
self.response.append(response) # sotto forma di lista perche se la risposta viene paginata questa viene spezzata su piu risposte
|
186
|
+
|
181
187
|
return response.json()
|
182
188
|
|
183
189
|
return run_request(mode, url, _headers_, _payload_, _params_, **kwargs)
|
@@ -290,6 +296,7 @@ class ApiManager:
|
|
290
296
|
uuid (list[str]): lista di tutti gli uuid degli oggetti richiesti, ordinati come il vettore post_params
|
291
297
|
get_count (int): 1 se il metodo e' risultato in una get e 0 se e' risultato in una post
|
292
298
|
post_count (int): 1 se il metodo e' risutltato in una post e 0 se e' risultato in una get
|
299
|
+
put_count (int): 1 se il metodo e' risutlato in una put e 0 se e' risultato in una put
|
293
300
|
"""
|
294
301
|
|
295
302
|
# se viene dato il solo elemento dell'url, questo viene convertito nella sua versione bulk
|
@@ -497,6 +504,7 @@ from hive.cookbook.metric_ingest import MetricIngest
|
|
497
504
|
from hive.cookbook.microsoft import Microsoft
|
498
505
|
from hive.cookbook.google import Google
|
499
506
|
from hive.cookbook.login import Login
|
507
|
+
from hive.cookbook.qr_code import QrCode
|
500
508
|
from hive.cookbook.jobs import Jobs
|
501
509
|
from hive.cookbook.messages import Messages
|
502
510
|
from hive.cookbook.metrics import Metrics
|
@@ -517,14 +525,11 @@ from hive.cookbook.services import Services
|
|
517
525
|
from hive.cookbook.sites import Sites
|
518
526
|
from hive.cookbook.last_status import LastStatus
|
519
527
|
from hive.cookbook.last_object_status import LastObjectStatus
|
520
|
-
from hive.cookbook.last_status_v2 import LastStatusV2
|
521
528
|
from hive.cookbook.terms_and_conditions import TermsAndConditions
|
522
529
|
from hive.cookbook.tree_hierarchy import TreeHierarchy
|
523
|
-
from hive.cookbook.tree_hierarchy_v2 import TreeHierarchyV2
|
524
530
|
from hive.cookbook.ts_automata_state import TsAutomataState
|
525
531
|
from hive.cookbook.ts_cost_azure_raw import TsCostAzureRaw
|
526
532
|
from hive.cookbook.ts_cost_management import TsCostManagement
|
527
|
-
from hive.cookbook.ts_cost_management_v2 import TsCostManagementV2
|
528
533
|
from hive.cookbook.ts_metric_status import TsMetricStatus
|
529
534
|
from hive.cookbook.ts_metric_value import TsMetricValue
|
530
535
|
from hive.cookbook.ts_ntop_flows import TsNtopFlows
|
@@ -539,7 +544,7 @@ from hive.cookbook.widget_groups import WidgetGroups
|
|
539
544
|
# hive imports stop
|
540
545
|
|
541
546
|
|
542
|
-
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, LastObjectStatus,
|
547
|
+
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, QrCode, Jobs, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, Questions, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, LastObjectStatus, TermsAndConditions, TreeHierarchy, TsAutomataState, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
|
543
548
|
"""
|
544
549
|
Class with each specific API, based on the ApiManager Class created for a more general interaction with Xautomata API
|
545
550
|
"""
|
hive/cookbook/calendars.py
CHANGED
@@ -280,6 +280,33 @@ class Calendars(ApiManager):
|
|
280
280
|
response = self.execute('DELETE', path=f'/calendars/{uuid}', **kwargs)
|
281
281
|
return response
|
282
282
|
|
283
|
+
def calendars_is_local_holiday_create(self, kwargs: dict = None, **params
|
284
|
+
) -> list:
|
285
|
+
"""Is Local Holiday
|
286
|
+
|
287
|
+
Args:
|
288
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
289
|
+
**params: additional parameters for the API.
|
290
|
+
|
291
|
+
Keyword Args:
|
292
|
+
country (string required): additional filter - parameter
|
293
|
+
ts (string required): additional filter - parameter
|
294
|
+
timezone (string required): additional filter - parameter
|
295
|
+
state_province (string optional): additional filter - parameter
|
296
|
+
|
297
|
+
Returns: list"""
|
298
|
+
if kwargs is None:
|
299
|
+
kwargs = dict()
|
300
|
+
official_params_list = ['country', 'ts', 'timezone', 'state_province']
|
301
|
+
params.get('country'), params.get('ts'), params.get('timezone'
|
302
|
+
), params.get('state_province')
|
303
|
+
if not self._silence_warning:
|
304
|
+
warning_wrong_parameters(self.calendars_is_local_holiday_create
|
305
|
+
.__name__, params, official_params_list)
|
306
|
+
response = self.execute('POST', path=f'/calendars/is_local_holiday',
|
307
|
+
params=params, **kwargs)
|
308
|
+
return response
|
309
|
+
|
283
310
|
def calendars_bulk(self, payload: list, warm_start: bool = False,
|
284
311
|
single_page: bool = False, page_size: int = 50, kwargs: dict = None,
|
285
312
|
**params) -> list:
|
hive/cookbook/cost_tree_nodes.py
CHANGED
@@ -166,7 +166,7 @@ class CostTreeNodes(ApiManager):
|
|
166
166
|
|
167
167
|
def cost_tree_nodes_navigate_tree(self, uuid: str,
|
168
168
|
warm_start: bool = False, kwargs: dict = None, **params) -> list:
|
169
|
-
"""Get Tree From Node
|
169
|
+
"""Get Tree From Node V2
|
170
170
|
|
171
171
|
Args:
|
172
172
|
uuid (str, required): uuid
|
@@ -197,39 +197,6 @@ class CostTreeNodes(ApiManager):
|
|
197
197
|
params=params, **kwargs)
|
198
198
|
return response
|
199
199
|
|
200
|
-
def cost_tree_nodes_navigate_tree_v2(self, uuid: str,
|
201
|
-
warm_start: bool = False, kwargs: dict = None, **params) -> list:
|
202
|
-
"""Get Tree From Node V2
|
203
|
-
|
204
|
-
Args:
|
205
|
-
uuid (str, required): uuid
|
206
|
-
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.
|
207
|
-
kwargs (dict, optional): additional parameters for execute. Default to None.
|
208
|
-
**params: additional parameters for the API.
|
209
|
-
|
210
|
-
Keyword Args:
|
211
|
-
date_start (string required): additional filter - parameter
|
212
|
-
date_end (string required): additional filter - parameter
|
213
|
-
resource_id (string optional): additional filter - parameter
|
214
|
-
previous_period (boolean optional): additional filter - parameter
|
215
|
-
|
216
|
-
Returns: list"""
|
217
|
-
if kwargs is None:
|
218
|
-
kwargs = dict()
|
219
|
-
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
220
|
-
=params)
|
221
|
-
official_params_list = ['date_start', 'date_end', 'resource_id',
|
222
|
-
'previous_period']
|
223
|
-
params.get('date_start'), params.get('date_end'), params.get(
|
224
|
-
'resource_id'), params.get('previous_period')
|
225
|
-
if not self._silence_warning:
|
226
|
-
warning_wrong_parameters(self.cost_tree_nodes_navigate_tree_v2.
|
227
|
-
__name__, params, official_params_list)
|
228
|
-
response = self.execute('GET', path=
|
229
|
-
f'/cost_tree_nodes/navigate_tree/{uuid}/v2', warm_start=
|
230
|
-
warm_start, params=params, **kwargs)
|
231
|
-
return response
|
232
|
-
|
233
200
|
def cost_tree_nodes_get_node_resources(self, uuid: str,
|
234
201
|
warm_start: bool = False, single_page: bool = False,
|
235
202
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
@@ -80,7 +80,7 @@ class CostTreeResources(ApiManager):
|
|
80
80
|
def cost_tree_resources_all_resource_ids(self, warm_start: bool = False,
|
81
81
|
single_page: bool = False, page_size: int = 5000,
|
82
82
|
kwargs: dict = None, **params) -> list:
|
83
|
-
"""Get Resource Ids
|
83
|
+
"""Get Resource Ids V2
|
84
84
|
|
85
85
|
Args:
|
86
86
|
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.
|
@@ -119,52 +119,10 @@ class CostTreeResources(ApiManager):
|
|
119
119
|
=params, **kwargs)
|
120
120
|
return response
|
121
121
|
|
122
|
-
def cost_tree_resources_all_resource_ids_v2(self,
|
123
|
-
warm_start: bool = False, single_page: bool = False,
|
124
|
-
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
125
|
-
"""Get Resource Ids V2
|
126
|
-
|
127
|
-
Args:
|
128
|
-
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.
|
129
|
-
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
130
|
-
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
131
|
-
kwargs (dict, optional): additional parameters for execute. Default to None.
|
132
|
-
**params: additional parameters for the API.
|
133
|
-
|
134
|
-
Keyword Args:
|
135
|
-
date_start (string required): additional filter - parameter
|
136
|
-
date_end (string required): additional filter - parameter
|
137
|
-
uuid_customer (string optional): additional filter - parameter
|
138
|
-
uuid_view (string optional): additional filter - parameter
|
139
|
-
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
140
|
-
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
141
|
-
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
|
142
|
-
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
|
143
|
-
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
|
144
|
-
|
145
|
-
Returns: list"""
|
146
|
-
if kwargs is None:
|
147
|
-
kwargs = dict()
|
148
|
-
official_params_list = ['date_start', 'date_end', 'uuid_customer',
|
149
|
-
'uuid_view', 'skip', 'limit', 'like', 'join', 'count']
|
150
|
-
params.get('date_start'), params.get('date_end'), params.get(
|
151
|
-
'uuid_customer'), params.get('uuid_view'), params.get('skip'
|
152
|
-
), params.get('limit'), params.get('like'), params.get('join'
|
153
|
-
), params.get('count')
|
154
|
-
if not self._silence_warning:
|
155
|
-
warning_wrong_parameters(self.
|
156
|
-
cost_tree_resources_all_resource_ids_v2.__name__, params,
|
157
|
-
official_params_list)
|
158
|
-
response = self.execute('GET', path=
|
159
|
-
f'/cost_tree_resources/all_resource_ids/v2', single_page=
|
160
|
-
single_page, page_size=page_size, warm_start=warm_start, params
|
161
|
-
=params, **kwargs)
|
162
|
-
return response
|
163
|
-
|
164
122
|
def cost_tree_resources_unfully_assigned_resource_ids(self,
|
165
123
|
uuid_view: str, warm_start: bool = False, single_page: bool = False,
|
166
124
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
167
|
-
"""Get Unfully Assigned Resource Ids
|
125
|
+
"""Get Unfully Assigned Resource Ids V2
|
168
126
|
|
169
127
|
Args:
|
170
128
|
uuid_view (str, required): uuid_view
|
@@ -197,42 +155,6 @@ class CostTreeResources(ApiManager):
|
|
197
155
|
warm_start, params=params, **kwargs)
|
198
156
|
return response
|
199
157
|
|
200
|
-
def cost_tree_resources_unfully_assigned_resource_ids_v2(self,
|
201
|
-
uuid_view: str, warm_start: bool = False, single_page: bool = False,
|
202
|
-
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
203
|
-
"""Get Unfully Assigned Resource Ids V2
|
204
|
-
|
205
|
-
Args:
|
206
|
-
uuid_view (str, required): uuid_view
|
207
|
-
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.
|
208
|
-
single_page (bool, optional): se False la risposta viene ottenuta a step per non appesantire le API. Default to False.
|
209
|
-
page_size (int, optional): Numero di oggetti per pagina se single_page == False. Default to 5000.
|
210
|
-
kwargs (dict, optional): additional parameters for execute. Default to None.
|
211
|
-
**params: additional parameters for the API.
|
212
|
-
|
213
|
-
Keyword Args:
|
214
|
-
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
215
|
-
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
216
|
-
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
|
217
|
-
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
|
218
|
-
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
|
219
|
-
|
220
|
-
Returns: list"""
|
221
|
-
if kwargs is None:
|
222
|
-
kwargs = dict()
|
223
|
-
official_params_list = ['skip', 'limit', 'like', 'join', 'count']
|
224
|
-
params.get('skip'), params.get('limit'), params.get('like'
|
225
|
-
), params.get('join'), params.get('count')
|
226
|
-
if not self._silence_warning:
|
227
|
-
warning_wrong_parameters(self.
|
228
|
-
cost_tree_resources_unfully_assigned_resource_ids_v2.
|
229
|
-
__name__, params, official_params_list)
|
230
|
-
response = self.execute('GET', path=
|
231
|
-
f'/cost_tree_resources/{uuid_view}/unfully_assigned_resource_ids/v2'
|
232
|
-
, single_page=single_page, page_size=page_size, warm_start=
|
233
|
-
warm_start, params=params, **kwargs)
|
234
|
-
return response
|
235
|
-
|
236
158
|
def cost_tree_resources_unfully_assigned_resources(self, uuid_view: str,
|
237
159
|
warm_start: bool = False, single_page: bool = False,
|
238
160
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
@@ -301,3 +223,18 @@ class CostTreeResources(ApiManager):
|
|
301
223
|
f'/cost_tree_resources/bulk/delete/', single_page=single_page,
|
302
224
|
page_size=page_size, payload=payload, **kwargs)
|
303
225
|
return response
|
226
|
+
|
227
|
+
def cost_tree_resources_delete(self, uuid_tree_node: str,
|
228
|
+
kwargs: dict = None) -> list:
|
229
|
+
"""Delete For Uuid Tree Node
|
230
|
+
|
231
|
+
Args:
|
232
|
+
uuid_tree_node (str, required): uuid_tree_node
|
233
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
234
|
+
|
235
|
+
Returns: list"""
|
236
|
+
if kwargs is None:
|
237
|
+
kwargs = dict()
|
238
|
+
response = self.execute('DELETE', path=
|
239
|
+
f'/cost_tree_resources/delete/{uuid_tree_node}', **kwargs)
|
240
|
+
return response
|
hive/cookbook/customers.py
CHANGED
@@ -261,7 +261,7 @@ class Customers(ApiManager):
|
|
261
261
|
def customers_groups(self, uuid: str, warm_start: bool = False,
|
262
262
|
single_page: bool = False, page_size: int = 5000,
|
263
263
|
kwargs: dict = None, **params) -> list:
|
264
|
-
"""List Groups
|
264
|
+
"""List Groups V2
|
265
265
|
|
266
266
|
Args:
|
267
267
|
uuid (str, required): uuid
|
@@ -304,58 +304,7 @@ class Customers(ApiManager):
|
|
304
304
|
if not self._silence_warning:
|
305
305
|
warning_wrong_parameters(self.customers_groups.__name__, params,
|
306
306
|
official_params_list)
|
307
|
-
response = self.execute('GET', path=f'/customers/{uuid}/groups',
|
308
|
-
single_page=single_page, page_size=page_size, warm_start=
|
309
|
-
warm_start, params=params, **kwargs)
|
310
|
-
return response
|
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/',
|
307
|
+
response = self.execute('GET', path=f'/customers/{uuid}/groups/',
|
359
308
|
single_page=single_page, page_size=page_size, warm_start=
|
360
309
|
warm_start, params=params, **kwargs)
|
361
310
|
return response
|
@@ -1329,6 +1278,76 @@ class Customers(ApiManager):
|
|
1329
1278
|
)
|
1330
1279
|
return response
|
1331
1280
|
|
1281
|
+
def customers_gcp_v2_subscription_create(self, kwargs: dict = None, **
|
1282
|
+
payload) -> list:
|
1283
|
+
"""Create Gcp Customer Sub
|
1284
|
+
|
1285
|
+
Args:
|
1286
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
1287
|
+
**payload: additional parameters for the API.
|
1288
|
+
|
1289
|
+
Keyword Args:
|
1290
|
+
customer (None required): additional filter - payload
|
1291
|
+
gcp_customer (None required): additional filter - payload
|
1292
|
+
|
1293
|
+
Returns: list"""
|
1294
|
+
if kwargs is None:
|
1295
|
+
kwargs = dict()
|
1296
|
+
official_payload_list = ['customer', 'gcp_customer']
|
1297
|
+
payload.get('customer'), payload.get('gcp_customer')
|
1298
|
+
if not self._silence_warning:
|
1299
|
+
warning_wrong_parameters(self.
|
1300
|
+
customers_gcp_v2_subscription_create.__name__, payload,
|
1301
|
+
official_payload_list)
|
1302
|
+
response = self.execute('POST', path=
|
1303
|
+
f'/customers/gcp/v2/subscription/', payload=payload, **kwargs)
|
1304
|
+
return response
|
1305
|
+
|
1306
|
+
def customers_gcp_v2_subscription_create_uuid(self, uuid: str,
|
1307
|
+
kwargs: dict = None, **payload) -> list:
|
1308
|
+
"""Create Gcp Customer From V2 Sub
|
1309
|
+
|
1310
|
+
Args:
|
1311
|
+
uuid (str, required): uuid
|
1312
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
1313
|
+
**payload: additional parameters for the API.
|
1314
|
+
|
1315
|
+
Keyword Args:
|
1316
|
+
target_company (string required): additional filter - payload
|
1317
|
+
target_code (string required): additional filter - payload
|
1318
|
+
address (string optional): additional filter - payload
|
1319
|
+
zip_code (string optional): additional filter - payload
|
1320
|
+
city (string optional): additional filter - payload
|
1321
|
+
country (string optional): additional filter - payload
|
1322
|
+
state_province (string optional): additional filter - payload
|
1323
|
+
paying_customer (boolean optional): additional filter - payload
|
1324
|
+
uuid_virtual_domain (string optional): additional filter - payload
|
1325
|
+
uuid_probe_type (string optional): additional filter - payload
|
1326
|
+
uuid_object (string optional): additional filter - payload
|
1327
|
+
subscriptions (array required): additional filter - payload
|
1328
|
+
|
1329
|
+
Returns: list"""
|
1330
|
+
if kwargs is None:
|
1331
|
+
kwargs = dict()
|
1332
|
+
official_payload_list = ['target_company', 'target_code', 'address',
|
1333
|
+
'zip_code', 'city', 'country', 'state_province',
|
1334
|
+
'paying_customer', 'uuid_virtual_domain', 'uuid_probe_type',
|
1335
|
+
'uuid_object', 'subscriptions']
|
1336
|
+
payload.get('target_company'), payload.get('target_code'), payload.get(
|
1337
|
+
'address'), payload.get('zip_code'), payload.get('city'
|
1338
|
+
), payload.get('country'), payload.get('state_province'
|
1339
|
+
), payload.get('paying_customer'), payload.get(
|
1340
|
+
'uuid_virtual_domain'), payload.get('uuid_probe_type'
|
1341
|
+
), payload.get('uuid_object'), payload.get('subscriptions')
|
1342
|
+
if not self._silence_warning:
|
1343
|
+
warning_wrong_parameters(self.
|
1344
|
+
customers_gcp_v2_subscription_create.__name__, payload,
|
1345
|
+
official_payload_list)
|
1346
|
+
response = self.execute('POST', path=
|
1347
|
+
f'/customers/gcp/v2/subscription/{uuid}', payload=payload, **kwargs
|
1348
|
+
)
|
1349
|
+
return response
|
1350
|
+
|
1332
1351
|
def customers_networks(self, uuid_customer: str,
|
1333
1352
|
warm_start: bool = False, single_page: bool = False,
|
1334
1353
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
hive/cookbook/groups.py
CHANGED
@@ -6,7 +6,7 @@ class Groups(ApiManager):
|
|
6
6
|
|
7
7
|
def groups(self, warm_start: bool = False, single_page: bool = False,
|
8
8
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
9
|
-
"""Read Groups
|
9
|
+
"""Read Groups V2
|
10
10
|
|
11
11
|
Args:
|
12
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.
|
@@ -87,55 +87,6 @@ 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
|
-
|
139
90
|
def group(self, uuid: str, warm_start: bool = False,
|
140
91
|
kwargs: dict = None, **params) -> list:
|
141
92
|
"""Read Group
|
@@ -214,7 +165,7 @@ class Groups(ApiManager):
|
|
214
165
|
def groups_objects(self, uuid: str, warm_start: bool = False,
|
215
166
|
single_page: bool = False, page_size: int = 5000,
|
216
167
|
kwargs: dict = None, **params) -> list:
|
217
|
-
"""List Objects
|
168
|
+
"""List Objects V2
|
218
169
|
|
219
170
|
Args:
|
220
171
|
uuid (str, required): uuid
|
@@ -256,51 +207,6 @@ class Groups(ApiManager):
|
|
256
207
|
warm_start, params=params, **kwargs)
|
257
208
|
return response
|
258
209
|
|
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
|
-
|
304
210
|
def groups_objects_create(self, uuid: str, uuid_object: str,
|
305
211
|
kwargs: dict = None) -> list:
|
306
212
|
"""Add Object
|
@@ -52,7 +52,7 @@ class LastObjectStatus(ApiManager):
|
|
52
52
|
last_value_uuid_probe (string optional): additional filter - parameter
|
53
53
|
last_value_timestamp_start (string optional): additional filter - parameter
|
54
54
|
last_value_timestamp_end (string optional): additional filter - parameter
|
55
|
-
last_value_object_type (
|
55
|
+
last_value_object_type (None optional): additional filter - parameter
|
56
56
|
last_value_name (string optional): additional filter - parameter
|
57
57
|
last_value_value (string optional): additional filter - parameter
|
58
58
|
last_value_unit (string optional): additional filter - parameter
|
hive/cookbook/last_status.py
CHANGED
@@ -52,7 +52,7 @@ class LastStatus(ApiManager):
|
|
52
52
|
last_value_uuid_probe (string optional): additional filter - parameter
|
53
53
|
last_value_timestamp_start (string optional): additional filter - parameter
|
54
54
|
last_value_timestamp_end (string optional): additional filter - parameter
|
55
|
-
last_value_object_type (
|
55
|
+
last_value_object_type (None optional): additional filter - parameter
|
56
56
|
last_value_name (string optional): additional filter - parameter
|
57
57
|
last_value_value (string optional): additional filter - parameter
|
58
58
|
last_value_unit (string optional): additional filter - parameter
|
hive/cookbook/metric_types.py
CHANGED
@@ -7,7 +7,7 @@ class MetricTypes(ApiManager):
|
|
7
7
|
def metric_types(self, warm_start: bool = False,
|
8
8
|
single_page: bool = False, page_size: int = 5000,
|
9
9
|
kwargs: dict = None, **params) -> list:
|
10
|
-
"""Read Metric Types
|
10
|
+
"""Read Metric Types V2
|
11
11
|
|
12
12
|
Args:
|
13
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.
|
@@ -87,55 +87,6 @@ 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
|
-
|
139
90
|
def metric_type(self, uuid: str, warm_start: bool = False,
|
140
91
|
kwargs: dict = None, **params) -> list:
|
141
92
|
"""Read Metric Type
|