xautomata-hive 3.0.3__py3-none-any.whl → 3.2.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 +124 -43
- hive/cookbook/acl_docs.py +1 -1
- hive/cookbook/acl_overrides.py +22 -1
- hive/cookbook/analytics.py +11 -1
- hive/cookbook/anomalies.py +30 -1
- hive/cookbook/calendars.py +95 -1
- hive/cookbook/contacts.py +114 -1
- hive/cookbook/customers.py +293 -7
- hive/cookbook/dashboards.py +82 -1
- hive/cookbook/dispatchers.py +117 -1
- hive/cookbook/downtimes.py +100 -1
- hive/cookbook/external_tickets.py +117 -1
- hive/cookbook/firmware_updates.py +20 -1
- hive/cookbook/groups.py +88 -1
- hive/cookbook/last_status.py +48 -2
- hive/cookbook/login.py +163 -1
- hive/cookbook/messages.py +35 -1
- hive/cookbook/metric_ingest.py +1 -1
- hive/cookbook/metric_types.py +71 -1
- hive/cookbook/metrics.py +77 -1
- hive/cookbook/notification_provider_types.py +32 -1
- hive/cookbook/notification_providers.py +28 -1
- hive/cookbook/objects.py +95 -1
- hive/cookbook/opening_reasons.py +33 -1
- hive/cookbook/probe_types.py +31 -1
- hive/cookbook/probes.py +70 -1
- hive/cookbook/probes_log_ingest.py +5 -1
- hive/cookbook/profile_topics.py +24 -1
- hive/cookbook/reason_for_closure.py +36 -6
- hive/cookbook/retention_rules.py +30 -1
- hive/cookbook/schedules.py +20 -1
- hive/cookbook/services.py +114 -2
- hive/cookbook/sites.py +93 -1
- hive/cookbook/tree_hierarchy.py +89 -1
- hive/cookbook/ts_cost_azure_raw.py +154 -1
- hive/cookbook/ts_cost_management.py +136 -114
- hive/cookbook/ts_metric_status.py +20 -1
- hive/cookbook/ts_metric_value.py +19 -1
- hive/cookbook/ts_ntop_flows.py +25 -1
- hive/cookbook/ts_service_status.py +48 -2
- hive/cookbook/ts_service_value.py +43 -1
- hive/cookbook/users.py +174 -3
- hive/cookbook/users_notifications.py +109 -0
- hive/cookbook/virtual_domains.py +47 -1
- hive/cookbook/webhooks.py +21 -1
- hive/cookbook/widget_groups.py +39 -1
- hive/cookbook/widgets.py +60 -1
- hive/version.py +1 -1
- {xautomata_hive-3.0.3.dist-info → xautomata_hive-3.2.0.dist-info}/METADATA +1 -1
- xautomata_hive-3.2.0.dist-info/RECORD +58 -0
- {xautomata_hive-3.0.3.dist-info → xautomata_hive-3.2.0.dist-info}/WHEEL +1 -1
- xautomata_hive-3.0.3.dist-info/RECORD +0 -57
- {xautomata_hive-3.0.3.dist-info → xautomata_hive-3.2.0.dist-info}/LICENSE +0 -0
- {xautomata_hive-3.0.3.dist-info → xautomata_hive-3.2.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
from hive.api import ApiManager, handling_single_page_methods
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
2
|
|
3
3
|
|
4
4
|
class TsServiceValue(ApiManager):
|
@@ -32,6 +32,18 @@ class TsServiceValue(ApiManager):
|
|
32
32
|
Returns: list"""
|
33
33
|
if kwargs is None:
|
34
34
|
kwargs = dict()
|
35
|
+
official_params_list = ['sort_by', 'null_fields', 'uuid_service',
|
36
|
+
'timestamp_start', 'timestamp_end', 'database_timestamp_start',
|
37
|
+
'database_timestamp_end', 'unit', 'value', 'skip', 'limit',
|
38
|
+
'like', 'join', 'count']
|
39
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
40
|
+
'uuid_service'), params.get('timestamp_start'), params.get(
|
41
|
+
'timestamp_end'), params.get('database_timestamp_start'
|
42
|
+
), params.get('database_timestamp_end'), params.get('unit'
|
43
|
+
), params.get('value'), params.get('skip'), params.get('limit'
|
44
|
+
), params.get('like'), params.get('join'), params.get('count')
|
45
|
+
warning_wrong_parameters(self.ts_service_value.__name__, params,
|
46
|
+
official_params_list)
|
35
47
|
response = self.execute('GET', path=f'/ts_service_value/',
|
36
48
|
single_page=single_page, page_size=page_size, warm_start=
|
37
49
|
warm_start, params=params, **kwargs)
|
@@ -50,6 +62,11 @@ class TsServiceValue(ApiManager):
|
|
50
62
|
Returns: list"""
|
51
63
|
if kwargs is None:
|
52
64
|
kwargs = dict()
|
65
|
+
official_payload_list = ['uuid_service', 'timestamp', 'unit', 'value']
|
66
|
+
payload.get('uuid_service'), payload.get('timestamp'), payload.get(
|
67
|
+
'unit'), payload.get('value')
|
68
|
+
warning_wrong_parameters(self.ts_service_value_create.__name__,
|
69
|
+
payload, official_payload_list)
|
53
70
|
response = self.execute('POST', path=f'/ts_service_value/', payload
|
54
71
|
=payload, **kwargs)
|
55
72
|
return response
|
@@ -67,6 +84,10 @@ class TsServiceValue(ApiManager):
|
|
67
84
|
Returns: list"""
|
68
85
|
if kwargs is None:
|
69
86
|
kwargs = dict()
|
87
|
+
official_params_list = ['ts_start', 'ts_end']
|
88
|
+
params.get('ts_start'), params.get('ts_end')
|
89
|
+
warning_wrong_parameters(self.ts_service_value_delete.__name__,
|
90
|
+
params, official_params_list)
|
70
91
|
response = self.execute('DELETE', path=
|
71
92
|
f'/ts_service_value/{uuid_service}/', params=params, **kwargs)
|
72
93
|
return response
|
@@ -102,6 +123,19 @@ class TsServiceValue(ApiManager):
|
|
102
123
|
Returns: list"""
|
103
124
|
if kwargs is None:
|
104
125
|
kwargs = dict()
|
126
|
+
official_params_list = ['sort_by', 'null_fields', 'uuid_parent',
|
127
|
+
'uuid_customer', 'profile', 'name', 'description', 'status',
|
128
|
+
'ts_timestamp_start', 'ts_timestamp_end', 'ts_unit', 'ts_value',
|
129
|
+
'skip', 'limit', 'like', 'join', 'count']
|
130
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
131
|
+
'uuid_parent'), params.get('uuid_customer'), params.get('profile'
|
132
|
+
), params.get('name'), params.get('description'), params.get(
|
133
|
+
'status'), params.get('ts_timestamp_start'), params.get(
|
134
|
+
'ts_timestamp_end'), params.get('ts_unit'), params.get('ts_value'
|
135
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
136
|
+
), params.get('join'), params.get('count')
|
137
|
+
warning_wrong_parameters(self.ts_service_value_query.__name__,
|
138
|
+
params, official_params_list)
|
105
139
|
response = self.execute('GET', path=f'/ts_service_value/query/',
|
106
140
|
single_page=single_page, page_size=page_size, warm_start=
|
107
141
|
warm_start, params=params, **kwargs)
|
@@ -132,6 +166,10 @@ class TsServiceValue(ApiManager):
|
|
132
166
|
Returns: list"""
|
133
167
|
if kwargs is None:
|
134
168
|
kwargs = dict()
|
169
|
+
official_params_list = ['ts_start', 'ts_end']
|
170
|
+
params.get('ts_start'), params.get('ts_end')
|
171
|
+
warning_wrong_parameters(self.ts_service_value_bulk.__name__,
|
172
|
+
params, official_params_list)
|
135
173
|
response = self.execute('POST', path=
|
136
174
|
f'/ts_service_value/bulk/read/', single_page=single_page,
|
137
175
|
page_size=page_size, warm_start=warm_start, params=params,
|
@@ -190,6 +228,10 @@ class TsServiceValue(ApiManager):
|
|
190
228
|
Returns: list"""
|
191
229
|
if kwargs is None:
|
192
230
|
kwargs = dict()
|
231
|
+
official_params_list = ['ts_start', 'ts_end']
|
232
|
+
params.get('ts_start'), params.get('ts_end')
|
233
|
+
warning_wrong_parameters(self.ts_service_value_delete_bulk.__name__,
|
234
|
+
params, official_params_list)
|
193
235
|
response = self.execute('DELETE', path=
|
194
236
|
f'/ts_service_value/bulk/delete/', single_page=single_page,
|
195
237
|
page_size=page_size, params=params, payload=payload, **kwargs)
|
hive/cookbook/users.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from hive.api import ApiManager, handling_single_page_methods
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
2
|
|
3
3
|
|
4
4
|
class Users(ApiManager):
|
@@ -16,14 +16,85 @@ class Users(ApiManager):
|
|
16
16
|
name (string required): additional filter - payload
|
17
17
|
email (string required): additional filter - payload
|
18
18
|
password (string required): additional filter - payload
|
19
|
-
phone (string
|
19
|
+
phone (string optional): additional filter - payload
|
20
20
|
Returns: list"""
|
21
21
|
if kwargs is None:
|
22
22
|
kwargs = dict()
|
23
|
-
|
23
|
+
official_payload_list = ['name', 'email', 'password', 'phone']
|
24
|
+
payload.get('name'), payload.get('email'), payload.get('password'
|
25
|
+
), payload.get('phone')
|
26
|
+
warning_wrong_parameters(self.users_register_create.__name__,
|
27
|
+
payload, official_payload_list)
|
28
|
+
response = self.execute('POST', path=f'/users/register', params=
|
24
29
|
params, payload=payload, **kwargs)
|
25
30
|
return response
|
26
31
|
|
32
|
+
def users_verify_email(self, warm_start: bool = False,
|
33
|
+
kwargs: dict = None, **params) -> list:
|
34
|
+
"""Verify Me
|
35
|
+
Args:
|
36
|
+
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.
|
37
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
38
|
+
**params: additional parameters for the API.
|
39
|
+
Keyword Args:
|
40
|
+
verification_code (string required): additional filter - parameter
|
41
|
+
Returns: list"""
|
42
|
+
if kwargs is None:
|
43
|
+
kwargs = dict()
|
44
|
+
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
45
|
+
=params)
|
46
|
+
official_params_list = ['verification_code']
|
47
|
+
params.get('verification_code')
|
48
|
+
warning_wrong_parameters(self.users_verify_email.__name__, params,
|
49
|
+
official_params_list)
|
50
|
+
response = self.execute('GET', path=f'/users/verify_email',
|
51
|
+
warm_start=warm_start, params=params, **kwargs)
|
52
|
+
return response
|
53
|
+
|
54
|
+
def users_password_reset_put(self, params: dict = False,
|
55
|
+
kwargs: dict = None, **payload) -> list:
|
56
|
+
"""Reset Password
|
57
|
+
Args:
|
58
|
+
params (dict, optional): additional parameters for the API.
|
59
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
60
|
+
**payload: additional parameters for the API.
|
61
|
+
Keyword Args:
|
62
|
+
app_id (string optional): additional filter - parameter
|
63
|
+
verification_code (string required): additional filter - payload
|
64
|
+
new_password (string required): additional filter - payload
|
65
|
+
Returns: list"""
|
66
|
+
if kwargs is None:
|
67
|
+
kwargs = dict()
|
68
|
+
official_payload_list = ['verification_code', 'new_password']
|
69
|
+
payload.get('verification_code'), payload.get('new_password')
|
70
|
+
warning_wrong_parameters(self.users_password_reset_put.__name__,
|
71
|
+
payload, official_payload_list)
|
72
|
+
response = self.execute('PUT', path=f'/users/password_reset',
|
73
|
+
params=params, payload=payload, **kwargs)
|
74
|
+
return response
|
75
|
+
|
76
|
+
def users_password_reset_create(self, params: dict = False,
|
77
|
+
kwargs: dict = None, **payload) -> list:
|
78
|
+
"""Send Mail Password Reset
|
79
|
+
Args:
|
80
|
+
params (dict, optional): additional parameters for the API.
|
81
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
82
|
+
**payload: additional parameters for the API.
|
83
|
+
Keyword Args:
|
84
|
+
app_id (string optional): additional filter - parameter
|
85
|
+
username (string optional): additional filter - payload
|
86
|
+
email (string optional): additional filter - payload
|
87
|
+
Returns: list"""
|
88
|
+
if kwargs is None:
|
89
|
+
kwargs = dict()
|
90
|
+
official_payload_list = ['username', 'email']
|
91
|
+
payload.get('username'), payload.get('email')
|
92
|
+
warning_wrong_parameters(self.users_password_reset_create.__name__,
|
93
|
+
payload, official_payload_list)
|
94
|
+
response = self.execute('POST', path=f'/users/password_reset',
|
95
|
+
params=params, payload=payload, **kwargs)
|
96
|
+
return response
|
97
|
+
|
27
98
|
def users(self, warm_start: bool = False, single_page: bool = False,
|
28
99
|
page_size: int = 5000, kwargs: dict = None, **params) -> list:
|
29
100
|
"""Read Users
|
@@ -40,6 +111,7 @@ class Users(ApiManager):
|
|
40
111
|
active (boolean optional): additional filter - parameter
|
41
112
|
email (string optional): additional filter - parameter
|
42
113
|
phone (string optional): additional filter - parameter
|
114
|
+
profile (string optional): additional filter - parameter
|
43
115
|
uuid_acl_override (string optional): additional filter - parameter
|
44
116
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
45
117
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
@@ -49,6 +121,16 @@ class Users(ApiManager):
|
|
49
121
|
Returns: list"""
|
50
122
|
if kwargs is None:
|
51
123
|
kwargs = dict()
|
124
|
+
official_params_list = ['sort_by', 'null_fields', 'name', 'active',
|
125
|
+
'email', 'phone', 'profile', 'uuid_acl_override', 'skip',
|
126
|
+
'limit', 'like', 'join', 'count']
|
127
|
+
params.get('sort_by'), params.get('null_fields'), params.get('name'
|
128
|
+
), params.get('active'), params.get('email'), params.get('phone'
|
129
|
+
), params.get('profile'), params.get('uuid_acl_override'
|
130
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
131
|
+
), params.get('join'), params.get('count')
|
132
|
+
warning_wrong_parameters(self.users.__name__, params,
|
133
|
+
official_params_list)
|
52
134
|
response = self.execute('GET', path=f'/users/', single_page=
|
53
135
|
single_page, page_size=page_size, warm_start=warm_start, params
|
54
136
|
=params, **kwargs)
|
@@ -61,6 +143,8 @@ class Users(ApiManager):
|
|
61
143
|
**payload: additional parameters for the API.
|
62
144
|
Keyword Args:
|
63
145
|
phone (string optional): additional filter - payload
|
146
|
+
verified_email (boolean optional): additional filter - payload
|
147
|
+
profile (string optional): additional filter - payload
|
64
148
|
name (string required): additional filter - payload
|
65
149
|
password (string required): additional filter - payload
|
66
150
|
email (string required): additional filter - payload
|
@@ -70,6 +154,14 @@ class Users(ApiManager):
|
|
70
154
|
Returns: list"""
|
71
155
|
if kwargs is None:
|
72
156
|
kwargs = dict()
|
157
|
+
official_payload_list = ['phone', 'verified_email', 'profile',
|
158
|
+
'name', 'password', 'email', 'active', 'acl', 'uuid_acl_override']
|
159
|
+
payload.get('phone'), payload.get('verified_email'), payload.get(
|
160
|
+
'profile'), payload.get('name'), payload.get('password'
|
161
|
+
), payload.get('email'), payload.get('active'), payload.get('acl'
|
162
|
+
), payload.get('uuid_acl_override')
|
163
|
+
warning_wrong_parameters(self.users_create.__name__, payload,
|
164
|
+
official_payload_list)
|
73
165
|
response = self.execute('POST', path=f'/users/', payload=payload,
|
74
166
|
**kwargs)
|
75
167
|
return response
|
@@ -83,6 +175,8 @@ class Users(ApiManager):
|
|
83
175
|
**payload: additional parameters for the API.
|
84
176
|
Keyword Args:
|
85
177
|
phone (string optional): additional filter - payload
|
178
|
+
verified_email (boolean optional): additional filter - payload
|
179
|
+
profile (string optional): additional filter - payload
|
86
180
|
name (string required): additional filter - payload
|
87
181
|
password (string required): additional filter - payload
|
88
182
|
email (string required): additional filter - payload
|
@@ -92,6 +186,14 @@ class Users(ApiManager):
|
|
92
186
|
Returns: list"""
|
93
187
|
if kwargs is None:
|
94
188
|
kwargs = dict()
|
189
|
+
official_payload_list = ['phone', 'verified_email', 'profile',
|
190
|
+
'name', 'password', 'email', 'active', 'acl', 'uuid_acl_override']
|
191
|
+
payload.get('phone'), payload.get('verified_email'), payload.get(
|
192
|
+
'profile'), payload.get('name'), payload.get('password'
|
193
|
+
), payload.get('email'), payload.get('active'), payload.get('acl'
|
194
|
+
), payload.get('uuid_acl_override')
|
195
|
+
warning_wrong_parameters(self.users_create.__name__, payload,
|
196
|
+
official_payload_list)
|
95
197
|
response = self.execute('POST', path=f'/users/{uuid_customer}',
|
96
198
|
payload=payload, **kwargs)
|
97
199
|
return response
|
@@ -118,14 +220,25 @@ class Users(ApiManager):
|
|
118
220
|
**payload: additional parameters for the API.
|
119
221
|
Keyword Args:
|
120
222
|
phone (string optional): additional filter - payload
|
223
|
+
verified_email (boolean optional): additional filter - payload
|
224
|
+
profile (string optional): additional filter - payload
|
121
225
|
password (string optional): additional filter - payload
|
122
226
|
email (string optional): additional filter - payload
|
227
|
+
stage (string optional): additional filter - payload
|
123
228
|
active (boolean optional): additional filter - payload
|
124
229
|
acl (object optional): additional filter - payload
|
125
230
|
uuid_acl_override (string optional): additional filter - payload
|
126
231
|
Returns: list"""
|
127
232
|
if kwargs is None:
|
128
233
|
kwargs = dict()
|
234
|
+
official_payload_list = ['phone', 'verified_email', 'profile',
|
235
|
+
'password', 'email', 'stage', 'active', 'acl', 'uuid_acl_override']
|
236
|
+
payload.get('phone'), payload.get('verified_email'), payload.get(
|
237
|
+
'profile'), payload.get('password'), payload.get('email'
|
238
|
+
), payload.get('stage'), payload.get('active'), payload.get('acl'
|
239
|
+
), payload.get('uuid_acl_override')
|
240
|
+
warning_wrong_parameters(self.users_put.__name__, payload,
|
241
|
+
official_payload_list)
|
129
242
|
response = self.execute('PUT', path=f'/users/{name}', payload=
|
130
243
|
payload, **kwargs)
|
131
244
|
return response
|
@@ -154,6 +267,7 @@ class Users(ApiManager):
|
|
154
267
|
**params: additional parameters for the API.
|
155
268
|
Keyword Args:
|
156
269
|
not_in (boolean optional): additional filter - parameter
|
270
|
+
dashboard_name (string optional): additional filter - parameter
|
157
271
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
158
272
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
159
273
|
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
|
@@ -162,6 +276,13 @@ class Users(ApiManager):
|
|
162
276
|
Returns: list"""
|
163
277
|
if kwargs is None:
|
164
278
|
kwargs = dict()
|
279
|
+
official_params_list = ['not_in', 'dashboard_name', 'skip', 'limit',
|
280
|
+
'like', 'join', 'count']
|
281
|
+
params.get('not_in'), params.get('dashboard_name'), params.get('skip'
|
282
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
283
|
+
), params.get('count')
|
284
|
+
warning_wrong_parameters(self.users_dashboards.__name__, params,
|
285
|
+
official_params_list)
|
165
286
|
response = self.execute('GET', path=f'/users/{name}/dashboards',
|
166
287
|
single_page=single_page, page_size=page_size, warm_start=
|
167
288
|
warm_start, params=params, **kwargs)
|
@@ -208,6 +329,7 @@ class Users(ApiManager):
|
|
208
329
|
**params: additional parameters for the API.
|
209
330
|
Keyword Args:
|
210
331
|
not_in (boolean optional): additional filter - parameter
|
332
|
+
group_name (string optional): additional filter - parameter
|
211
333
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
212
334
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
213
335
|
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
|
@@ -216,6 +338,13 @@ class Users(ApiManager):
|
|
216
338
|
Returns: list"""
|
217
339
|
if kwargs is None:
|
218
340
|
kwargs = dict()
|
341
|
+
official_params_list = ['not_in', 'group_name', 'skip', 'limit',
|
342
|
+
'like', 'join', 'count']
|
343
|
+
params.get('not_in'), params.get('group_name'), params.get('skip'
|
344
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
345
|
+
), params.get('count')
|
346
|
+
warning_wrong_parameters(self.users_groups.__name__, params,
|
347
|
+
official_params_list)
|
219
348
|
response = self.execute('GET', path=f'/users/{name}/groups',
|
220
349
|
single_page=single_page, page_size=page_size, warm_start=
|
221
350
|
warm_start, params=params, **kwargs)
|
@@ -262,6 +391,7 @@ class Users(ApiManager):
|
|
262
391
|
**params: additional parameters for the API.
|
263
392
|
Keyword Args:
|
264
393
|
not_in (boolean optional): additional filter - parameter
|
394
|
+
domain_code (string optional): additional filter - parameter
|
265
395
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
266
396
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
267
397
|
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
|
@@ -270,6 +400,13 @@ class Users(ApiManager):
|
|
270
400
|
Returns: list"""
|
271
401
|
if kwargs is None:
|
272
402
|
kwargs = dict()
|
403
|
+
official_params_list = ['not_in', 'domain_code', 'skip', 'limit',
|
404
|
+
'like', 'join', 'count']
|
405
|
+
params.get('not_in'), params.get('domain_code'), params.get('skip'
|
406
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
407
|
+
), params.get('count')
|
408
|
+
warning_wrong_parameters(self.users_virtual_domains.__name__,
|
409
|
+
params, official_params_list)
|
273
410
|
response = self.execute('GET', path=
|
274
411
|
f'/users/{name}/virtual_domains', single_page=single_page,
|
275
412
|
page_size=page_size, warm_start=warm_start, params=params, **kwargs
|
@@ -317,6 +454,7 @@ class Users(ApiManager):
|
|
317
454
|
**params: additional parameters for the API.
|
318
455
|
Keyword Args:
|
319
456
|
not_in (boolean optional): additional filter - parameter
|
457
|
+
company_name (string optional): additional filter - parameter
|
320
458
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
321
459
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
322
460
|
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
|
@@ -325,6 +463,13 @@ class Users(ApiManager):
|
|
325
463
|
Returns: list"""
|
326
464
|
if kwargs is None:
|
327
465
|
kwargs = dict()
|
466
|
+
official_params_list = ['not_in', 'company_name', 'skip', 'limit',
|
467
|
+
'like', 'join', 'count']
|
468
|
+
params.get('not_in'), params.get('company_name'), params.get('skip'
|
469
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
470
|
+
), params.get('count')
|
471
|
+
warning_wrong_parameters(self.users_customers.__name__, params,
|
472
|
+
official_params_list)
|
328
473
|
response = self.execute('GET', path=f'/users/{name}/customers',
|
329
474
|
single_page=single_page, page_size=page_size, warm_start=
|
330
475
|
warm_start, params=params, **kwargs)
|
@@ -379,6 +524,12 @@ class Users(ApiManager):
|
|
379
524
|
Returns: list"""
|
380
525
|
if kwargs is None:
|
381
526
|
kwargs = dict()
|
527
|
+
official_params_list = ['not_in', 'skip', 'limit', 'like', 'join',
|
528
|
+
'count']
|
529
|
+
params.get('not_in'), params.get('skip'), params.get('limit'
|
530
|
+
), params.get('like'), params.get('join'), params.get('count')
|
531
|
+
warning_wrong_parameters(self.users_starred_customers.__name__,
|
532
|
+
params, official_params_list)
|
382
533
|
response = self.execute('GET', path=
|
383
534
|
f'/users/{name}/starred_customers', single_page=single_page,
|
384
535
|
page_size=page_size, warm_start=warm_start, params=params, **kwargs
|
@@ -426,6 +577,7 @@ class Users(ApiManager):
|
|
426
577
|
**params: additional parameters for the API.
|
427
578
|
Keyword Args:
|
428
579
|
not_in (boolean optional): additional filter - parameter
|
580
|
+
group_name (string optional): additional filter - parameter
|
429
581
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
430
582
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
431
583
|
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
|
@@ -434,6 +586,13 @@ class Users(ApiManager):
|
|
434
586
|
Returns: list"""
|
435
587
|
if kwargs is None:
|
436
588
|
kwargs = dict()
|
589
|
+
official_params_list = ['not_in', 'group_name', 'skip', 'limit',
|
590
|
+
'like', 'join', 'count']
|
591
|
+
params.get('not_in'), params.get('group_name'), params.get('skip'
|
592
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
593
|
+
), params.get('count')
|
594
|
+
warning_wrong_parameters(self.users_widget_groups.__name__, params,
|
595
|
+
official_params_list)
|
437
596
|
response = self.execute('GET', path=f'/users/{name}/widget_groups',
|
438
597
|
single_page=single_page, page_size=page_size, warm_start=
|
439
598
|
warm_start, params=params, **kwargs)
|
@@ -492,6 +651,10 @@ class Users(ApiManager):
|
|
492
651
|
Returns: list"""
|
493
652
|
if kwargs is None:
|
494
653
|
kwargs = dict()
|
654
|
+
official_params_list = ['best_effort']
|
655
|
+
params.get('best_effort')
|
656
|
+
warning_wrong_parameters(self.users_customers_create_bulk.__name__,
|
657
|
+
params, official_params_list)
|
495
658
|
response = self.execute('POST', path=
|
496
659
|
f'/users/bulk/create/customers', single_page=single_page,
|
497
660
|
page_size=page_size, params=params, payload=payload, **kwargs)
|
@@ -549,6 +712,10 @@ class Users(ApiManager):
|
|
549
712
|
Returns: list"""
|
550
713
|
if kwargs is None:
|
551
714
|
kwargs = dict()
|
715
|
+
official_params_list = ['best_effort']
|
716
|
+
params.get('best_effort')
|
717
|
+
warning_wrong_parameters(self.users_groups_create_bulk.__name__,
|
718
|
+
params, official_params_list)
|
552
719
|
response = self.execute('POST', path=f'/users/bulk/create/groups',
|
553
720
|
single_page=single_page, page_size=page_size, params=params,
|
554
721
|
payload=payload, **kwargs)
|
@@ -606,6 +773,10 @@ class Users(ApiManager):
|
|
606
773
|
Returns: list"""
|
607
774
|
if kwargs is None:
|
608
775
|
kwargs = dict()
|
776
|
+
official_params_list = ['best_effort']
|
777
|
+
params.get('best_effort')
|
778
|
+
warning_wrong_parameters(self.users_virtual_domains_create_bulk.
|
779
|
+
__name__, params, official_params_list)
|
609
780
|
response = self.execute('POST', path=
|
610
781
|
f'/users/bulk/create/virtual_domains', single_page=single_page,
|
611
782
|
page_size=page_size, params=params, payload=payload, **kwargs)
|
@@ -0,0 +1,109 @@
|
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
|
+
|
3
|
+
|
4
|
+
class UsersNotifications(ApiManager):
|
5
|
+
"""Class that handles all the XAutomata users_notifications APIs"""
|
6
|
+
|
7
|
+
def users_notifications(self, warm_start: bool = False,
|
8
|
+
single_page: bool = False, page_size: int = 5000,
|
9
|
+
kwargs: dict = None, **params) -> list:
|
10
|
+
"""Read Notifications
|
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
|
+
Keyword Args:
|
18
|
+
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
|
19
|
+
null_fields (string optional): additional filter - parameter
|
20
|
+
username (string optional): additional filter - parameter
|
21
|
+
title (string optional): additional filter - parameter
|
22
|
+
body (string optional): additional filter - parameter
|
23
|
+
read (boolean optional): additional filter - parameter
|
24
|
+
sent (boolean 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
|
+
Returns: list"""
|
31
|
+
if kwargs is None:
|
32
|
+
kwargs = dict()
|
33
|
+
official_params_list = ['sort_by', 'null_fields', 'username',
|
34
|
+
'title', 'body', 'read', 'sent', 'skip', 'limit', 'like',
|
35
|
+
'join', 'count']
|
36
|
+
params.get('sort_by'), params.get('null_fields'), params.get('username'
|
37
|
+
), params.get('title'), params.get('body'), params.get('read'
|
38
|
+
), params.get('sent'), params.get('skip'), params.get('limit'
|
39
|
+
), params.get('like'), params.get('join'), params.get('count')
|
40
|
+
warning_wrong_parameters(self.users_notifications.__name__, params,
|
41
|
+
official_params_list)
|
42
|
+
response = self.execute('GET', path=f'/users_notifications/',
|
43
|
+
single_page=single_page, page_size=page_size, warm_start=
|
44
|
+
warm_start, params=params, **kwargs)
|
45
|
+
return response
|
46
|
+
|
47
|
+
def users_notifications_create(self, kwargs: dict = None, **payload
|
48
|
+
) -> list:
|
49
|
+
"""Create Notification
|
50
|
+
Args:
|
51
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
52
|
+
**payload: additional parameters for the API.
|
53
|
+
Keyword Args:
|
54
|
+
username (string required): additional filter - payload
|
55
|
+
title (string required): additional filter - payload
|
56
|
+
body (array object optional): additional filter - payload
|
57
|
+
read (boolean optional): additional filter - payload
|
58
|
+
sent (boolean optional): additional filter - payload
|
59
|
+
timestamp (string optional): additional filter - payload
|
60
|
+
Returns: list"""
|
61
|
+
if kwargs is None:
|
62
|
+
kwargs = dict()
|
63
|
+
official_payload_list = ['username', 'title', 'body', 'read',
|
64
|
+
'sent', 'timestamp']
|
65
|
+
payload.get('username'), payload.get('title'), payload.get('body'
|
66
|
+
), payload.get('read'), payload.get('sent'), payload.get(
|
67
|
+
'timestamp')
|
68
|
+
warning_wrong_parameters(self.users_notifications_create.__name__,
|
69
|
+
payload, official_payload_list)
|
70
|
+
response = self.execute('POST', path=f'/users_notifications/',
|
71
|
+
payload=payload, **kwargs)
|
72
|
+
return response
|
73
|
+
|
74
|
+
def users_notifications_put(self, uuid: str, kwargs: dict = None, **payload
|
75
|
+
) -> list:
|
76
|
+
"""Update Notification
|
77
|
+
Args:
|
78
|
+
uuid (str, required): uuid
|
79
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
80
|
+
**payload: additional parameters for the API.
|
81
|
+
Keyword Args:
|
82
|
+
title (string optional): additional filter - payload
|
83
|
+
body (array object optional): additional filter - payload
|
84
|
+
read (boolean optional): additional filter - payload
|
85
|
+
sent (boolean optional): additional filter - payload
|
86
|
+
Returns: list"""
|
87
|
+
if kwargs is None:
|
88
|
+
kwargs = dict()
|
89
|
+
official_payload_list = ['title', 'body', 'read', 'sent']
|
90
|
+
payload.get('title'), payload.get('body'), payload.get('read'
|
91
|
+
), payload.get('sent')
|
92
|
+
warning_wrong_parameters(self.users_notifications_put.__name__,
|
93
|
+
payload, official_payload_list)
|
94
|
+
response = self.execute('PUT', path=f'/users_notifications/{uuid}',
|
95
|
+
payload=payload, **kwargs)
|
96
|
+
return response
|
97
|
+
|
98
|
+
def users_notifications_delete(self, uuid: str, kwargs: dict = None
|
99
|
+
) -> list:
|
100
|
+
"""Delete Notifcation
|
101
|
+
Args:
|
102
|
+
uuid (str, required): uuid
|
103
|
+
kwargs (dict, optional): additional parameters for execute. Default to None.
|
104
|
+
Returns: list"""
|
105
|
+
if kwargs is None:
|
106
|
+
kwargs = dict()
|
107
|
+
response = self.execute('DELETE', path=
|
108
|
+
f'/users_notifications/{uuid}', **kwargs)
|
109
|
+
return response
|
hive/cookbook/virtual_domains.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from hive.api import ApiManager, handling_single_page_methods
|
1
|
+
from hive.api import ApiManager, handling_single_page_methods, warning_wrong_parameters
|
2
2
|
|
3
3
|
|
4
4
|
class VirtualDomains(ApiManager):
|
@@ -27,6 +27,14 @@ class VirtualDomains(ApiManager):
|
|
27
27
|
Returns: list"""
|
28
28
|
if kwargs is None:
|
29
29
|
kwargs = dict()
|
30
|
+
official_params_list = ['sort_by', 'null_fields', 'code',
|
31
|
+
'description', 'skip', 'limit', 'like', 'join', 'count']
|
32
|
+
params.get('sort_by'), params.get('null_fields'), params.get('code'
|
33
|
+
), params.get('description'), params.get('skip'), params.get(
|
34
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
35
|
+
'count')
|
36
|
+
warning_wrong_parameters(self.virtual_domains.__name__, params,
|
37
|
+
official_params_list)
|
30
38
|
response = self.execute('GET', path=f'/virtual_domains/',
|
31
39
|
single_page=single_page, page_size=page_size, warm_start=
|
32
40
|
warm_start, params=params, **kwargs)
|
@@ -43,6 +51,10 @@ class VirtualDomains(ApiManager):
|
|
43
51
|
Returns: list"""
|
44
52
|
if kwargs is None:
|
45
53
|
kwargs = dict()
|
54
|
+
official_payload_list = ['code', 'description']
|
55
|
+
payload.get('code'), payload.get('description')
|
56
|
+
warning_wrong_parameters(self.virtual_domains_create.__name__,
|
57
|
+
payload, official_payload_list)
|
46
58
|
response = self.execute('POST', path=f'/virtual_domains/', payload=
|
47
59
|
payload, **kwargs)
|
48
60
|
return response
|
@@ -74,6 +86,10 @@ class VirtualDomains(ApiManager):
|
|
74
86
|
Returns: list"""
|
75
87
|
if kwargs is None:
|
76
88
|
kwargs = dict()
|
89
|
+
official_payload_list = ['code', 'description']
|
90
|
+
payload.get('code'), payload.get('description')
|
91
|
+
warning_wrong_parameters(self.virtual_domains_put.__name__, payload,
|
92
|
+
official_payload_list)
|
77
93
|
response = self.execute('PUT', path=f'/virtual_domains/{uuid}',
|
78
94
|
payload=payload, **kwargs)
|
79
95
|
return response
|
@@ -110,6 +126,11 @@ class VirtualDomains(ApiManager):
|
|
110
126
|
Returns: list"""
|
111
127
|
if kwargs is None:
|
112
128
|
kwargs = dict()
|
129
|
+
official_params_list = ['skip', 'limit', 'like', 'join', 'count']
|
130
|
+
params.get('skip'), params.get('limit'), params.get('like'
|
131
|
+
), params.get('join'), params.get('count')
|
132
|
+
warning_wrong_parameters(self.virtual_domains_groups.__name__,
|
133
|
+
params, official_params_list)
|
113
134
|
response = self.execute('GET', path=
|
114
135
|
f'/virtual_domains/{uuid}/groups', single_page=single_page,
|
115
136
|
page_size=page_size, warm_start=warm_start, params=params, **kwargs
|
@@ -136,6 +157,11 @@ class VirtualDomains(ApiManager):
|
|
136
157
|
Returns: list"""
|
137
158
|
if kwargs is None:
|
138
159
|
kwargs = dict()
|
160
|
+
official_params_list = ['skip', 'limit', 'like', 'join', 'count']
|
161
|
+
params.get('skip'), params.get('limit'), params.get('like'
|
162
|
+
), params.get('join'), params.get('count')
|
163
|
+
warning_wrong_parameters(self.virtual_domains_probes.__name__,
|
164
|
+
params, official_params_list)
|
139
165
|
response = self.execute('GET', path=
|
140
166
|
f'/virtual_domains/{uuid}/probes', single_page=single_page,
|
141
167
|
page_size=page_size, warm_start=warm_start, params=params, **kwargs
|
@@ -155,6 +181,7 @@ class VirtualDomains(ApiManager):
|
|
155
181
|
**params: additional parameters for the API.
|
156
182
|
Keyword Args:
|
157
183
|
not_in (boolean optional): additional filter - parameter
|
184
|
+
name (string optional): additional filter - parameter
|
158
185
|
skip (integer optional): numero di oggetti che si vogliono saltare nella risposta. Default to 0. - parameter
|
159
186
|
limit (integer optional): numero di oggetti massimi che si vogliono ottenere. Default to 1_000_000. - parameter
|
160
187
|
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
|
@@ -163,6 +190,13 @@ class VirtualDomains(ApiManager):
|
|
163
190
|
Returns: list"""
|
164
191
|
if kwargs is None:
|
165
192
|
kwargs = dict()
|
193
|
+
official_params_list = ['not_in', 'name', 'skip', 'limit', 'like',
|
194
|
+
'join', 'count']
|
195
|
+
params.get('not_in'), params.get('name'), params.get('skip'
|
196
|
+
), params.get('limit'), params.get('like'), params.get('join'
|
197
|
+
), params.get('count')
|
198
|
+
warning_wrong_parameters(self.virtual_domains_users.__name__,
|
199
|
+
params, official_params_list)
|
166
200
|
response = self.execute('GET', path=
|
167
201
|
f'/virtual_domains/{uuid}/users', single_page=single_page,
|
168
202
|
page_size=page_size, warm_start=warm_start, params=params, **kwargs
|
@@ -221,6 +255,10 @@ class VirtualDomains(ApiManager):
|
|
221
255
|
Returns: list"""
|
222
256
|
if kwargs is None:
|
223
257
|
kwargs = dict()
|
258
|
+
official_params_list = ['join']
|
259
|
+
params.get('join')
|
260
|
+
warning_wrong_parameters(self.virtual_domains_bulk.__name__, params,
|
261
|
+
official_params_list)
|
224
262
|
response = self.execute('POST', path=f'/virtual_domains/bulk/read/',
|
225
263
|
single_page=single_page, page_size=page_size, warm_start=
|
226
264
|
warm_start, params=params, payload=payload, **kwargs)
|
@@ -278,6 +316,10 @@ class VirtualDomains(ApiManager):
|
|
278
316
|
Returns: list"""
|
279
317
|
if kwargs is None:
|
280
318
|
kwargs = dict()
|
319
|
+
official_params_list = ['best_effort']
|
320
|
+
params.get('best_effort')
|
321
|
+
warning_wrong_parameters(self.virtual_domains_create_bulk.__name__,
|
322
|
+
params, official_params_list)
|
281
323
|
response = self.execute('POST', path=
|
282
324
|
f'/virtual_domains/bulk/create/', single_page=single_page,
|
283
325
|
page_size=page_size, params=params, payload=payload, **kwargs)
|
@@ -332,6 +374,10 @@ class VirtualDomains(ApiManager):
|
|
332
374
|
Returns: list"""
|
333
375
|
if kwargs is None:
|
334
376
|
kwargs = dict()
|
377
|
+
official_params_list = ['best_effort']
|
378
|
+
params.get('best_effort')
|
379
|
+
warning_wrong_parameters(self.virtual_domains_users_create_bulk.
|
380
|
+
__name__, params, official_params_list)
|
335
381
|
response = self.execute('POST', path=
|
336
382
|
f'/virtual_domains/bulk/create/users', single_page=single_page,
|
337
383
|
page_size=page_size, params=params, payload=payload, **kwargs)
|