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
hive/api.py
CHANGED
@@ -289,6 +289,8 @@ class ApiManager:
|
|
289
289
|
url_put = '/' + url_put.lstrip('/').rstrip('/') + '/'
|
290
290
|
|
291
291
|
method = url_get.split('/')[1]
|
292
|
+
if method not in ['customers', 'virtual_domains', 'sites', 'groups', 'objects', 'metric_types', 'metrics', 'services']:
|
293
|
+
raise NotImplementedError(f'the {method} has not been implemented')
|
292
294
|
|
293
295
|
get_count, post_count, put_count = 0, 0, 0
|
294
296
|
|
@@ -439,6 +441,13 @@ def handling_single_page_methods(kwargs, params):
|
|
439
441
|
return kwargs, params
|
440
442
|
|
441
443
|
|
444
|
+
def warning_wrong_parameters(func_name: str, params_from_user: dict, ufficial_params_list: list = None):
|
445
|
+
if ufficial_params_list is None: ufficial_params_list = []
|
446
|
+
for par in params_from_user:
|
447
|
+
if par not in ufficial_params_list:
|
448
|
+
print(f'WARNING: from {func_name}, {par} is not in the official list of params.')
|
449
|
+
|
450
|
+
|
442
451
|
# gli import vengono messi qui per evitare una parziale import di api.py
|
443
452
|
# hive imports start
|
444
453
|
from hive.cookbook.acl_docs import AclDocs
|
@@ -455,8 +464,6 @@ from hive.cookbook.external_tickets import ExternalTickets
|
|
455
464
|
from hive.cookbook.firmware_updates import FirmwareUpdates
|
456
465
|
from hive.cookbook.groups import Groups
|
457
466
|
from hive.cookbook.metric_ingest import MetricIngest
|
458
|
-
from hive.cookbook.last_status import LastStatus
|
459
|
-
from hive.cookbook.tree_hierarchy import TreeHierarchy
|
460
467
|
from hive.cookbook.login import Login
|
461
468
|
from hive.cookbook.messages import Messages
|
462
469
|
from hive.cookbook.metrics import Metrics
|
@@ -474,6 +481,8 @@ from hive.cookbook.retention_rules import RetentionRules
|
|
474
481
|
from hive.cookbook.schedules import Schedules
|
475
482
|
from hive.cookbook.services import Services
|
476
483
|
from hive.cookbook.sites import Sites
|
484
|
+
from hive.cookbook.last_status import LastStatus
|
485
|
+
from hive.cookbook.tree_hierarchy import TreeHierarchy
|
477
486
|
from hive.cookbook.ts_cost_azure_raw import TsCostAzureRaw
|
478
487
|
from hive.cookbook.ts_cost_management import TsCostManagement
|
479
488
|
from hive.cookbook.ts_metric_status import TsMetricStatus
|
@@ -482,6 +491,7 @@ from hive.cookbook.ts_ntop_flows import TsNtopFlows
|
|
482
491
|
from hive.cookbook.ts_service_status import TsServiceStatus
|
483
492
|
from hive.cookbook.ts_service_value import TsServiceValue
|
484
493
|
from hive.cookbook.users import Users
|
494
|
+
from hive.cookbook.users_notifications import UsersNotifications
|
485
495
|
from hive.cookbook.virtual_domains import VirtualDomains
|
486
496
|
from hive.cookbook.widgets import Widgets
|
487
497
|
from hive.cookbook.webhooks import Webhooks
|
@@ -489,7 +499,7 @@ from hive.cookbook.widget_groups import WidgetGroups
|
|
489
499
|
# hive imports stop
|
490
500
|
|
491
501
|
|
492
|
-
class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, FirmwareUpdates, Groups, MetricIngest,
|
502
|
+
class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, Contacts, Customers, Dashboards, Dispatchers, Downtimes, ExternalTickets, FirmwareUpdates, Groups, MetricIngest, Login, Messages, Metrics, ProbesLogIngest, MetricTypes, NotificationProviders, NotificationProviderTypes, Objects, OpeningReasons, Probes, ProbeTypes, ProfileTopics, ReasonForClosure, RetentionRules, Schedules, Services, Sites, LastStatus, TreeHierarchy, TsCostAzureRaw, TsCostManagement, TsMetricStatus, TsMetricValue, TsNtopFlows, TsServiceStatus, TsServiceValue, Users, UsersNotifications, VirtualDomains, Widgets, Webhooks, WidgetGroups):
|
493
503
|
"""
|
494
504
|
Class with each specific API, based on the ApiManager Class created for a more general interaction with Xautomata API
|
495
505
|
"""
|
@@ -577,59 +587,130 @@ class XautomataApi(AclDocs, AclOverrides, Analytics, Anomalies, Calendars, Conta
|
|
577
587
|
|
578
588
|
return response
|
579
589
|
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
590
|
+
def dispatecher(self, uuids: list, types: Literal['services', 'metrics', 'metric_types', 'objects', 'groups'], notification_provider_types: dict,
|
591
|
+
notification_providers: dict, messages: dict, calendar: dict, dispatcher: dict):
|
592
|
+
"""
|
593
|
+
create a dispatcher with the entire chain of elements to be used on a specific metric
|
594
|
+
|
595
|
+
Args:
|
596
|
+
uuids (list): list of uuid for the element to be linked with a dispatcher
|
597
|
+
types (Literal['services', 'metrics', 'metric_types', 'objects', 'groups']): type of uuids in the uuid list
|
598
|
+
notification_provider_types (dict): set of parameters to get or create a notification_provider_types
|
599
|
+
notification_providers (dict): set of parameters to get or create a notification_providers
|
600
|
+
messages (dict): set of parameters to get or create a messages
|
601
|
+
calendar (dict): set of parameters to get or create a calendar
|
602
|
+
dispatcher (dict): set of parameters to get or create a dispatcher
|
603
|
+
|
604
|
+
Examples:
|
605
|
+
notification_provider_types = {
|
606
|
+
"code": code,
|
607
|
+
"json_schema": {}
|
608
|
+
}
|
609
|
+
|
610
|
+
notification_providers = {
|
611
|
+
"uuid_notification_provider_type": uuid_npt,
|
612
|
+
"app_name": app_name,
|
613
|
+
"endpoint": {}
|
614
|
+
}
|
615
|
+
|
616
|
+
messages = {
|
617
|
+
"code": "string",
|
618
|
+
"description": "string",
|
619
|
+
"mask": "string",
|
620
|
+
"mask_mime_type": "string",
|
621
|
+
"additional_mask": "string",
|
622
|
+
"additional_mask_mime_type": "string"
|
623
|
+
}
|
624
|
+
|
625
|
+
calendar = {
|
626
|
+
"name": name_caledar,
|
627
|
+
"local_public_holidays": True,
|
628
|
+
"mon_int1_start": "string",
|
629
|
+
"mon_int1_end": "string",
|
630
|
+
"mon_int2_start": "string",
|
631
|
+
"mon_int2_end": "string",
|
632
|
+
"tue_int1_start": "string",
|
633
|
+
"tue_int1_end": "string",
|
634
|
+
"tue_int2_start": "string",
|
635
|
+
"tue_int2_end": "string",
|
636
|
+
"wed_int1_start": "string",
|
637
|
+
"wed_int1_end": "string",
|
638
|
+
"wed_int2_start": "string",
|
639
|
+
"wed_int2_end": "string",
|
640
|
+
"thu_int1_start": "string",
|
641
|
+
"thu_int1_end": "string",
|
642
|
+
"thu_int2_start": "string",
|
643
|
+
"thu_int2_end": "string",
|
644
|
+
"fri_int1_start": "string",
|
645
|
+
"fri_int1_end": "string",
|
646
|
+
"fri_int2_start": "string",
|
647
|
+
"fri_int2_end": "string",
|
648
|
+
"sat_int1_start": "string",
|
649
|
+
"sat_int1_end": "string",
|
650
|
+
"sat_int2_start": "string",
|
651
|
+
"sat_int2_end": "string",
|
652
|
+
"sun_int1_start": "string",
|
653
|
+
"sun_int1_end": "string",
|
654
|
+
"sun_int2_start": "string",
|
655
|
+
"sun_int2_end": "string",
|
656
|
+
}
|
657
|
+
|
658
|
+
dispatcher = {
|
659
|
+
"uuid_notification_provider": uuid_np,
|
660
|
+
"uuid_calendar": uuid_calendar,
|
661
|
+
"uuid_message": uuid_m,
|
662
|
+
"uuid_opening_reason": "string",
|
663
|
+
"uuid_reason_for_closure": "string",
|
664
|
+
"code": "string",
|
665
|
+
"description": "string",
|
666
|
+
"delay": 0,
|
667
|
+
"status": "s",
|
668
|
+
"country": "st",
|
669
|
+
"state_province": "string",
|
670
|
+
"data_profile": [
|
671
|
+
"string"
|
672
|
+
],
|
673
|
+
"remember_it": True
|
674
|
+
}
|
675
|
+
"""
|
676
|
+
|
677
|
+
def select_get_params(_params: dict, get_keys: tuple):
|
678
|
+
return dict((k, _params[k]) for k in get_keys)
|
585
679
|
|
586
680
|
# notification provider types
|
587
|
-
|
588
|
-
|
681
|
+
uuid_npt, _, _, _ = self.get_post(url_get='/notification_provider_types/',
|
682
|
+
get_params=select_get_params(notification_provider_types, ('code',)),
|
683
|
+
post_params=notification_provider_types)
|
684
|
+
print(f'notification provider type has been set ({uuid_npt})')
|
589
685
|
|
590
686
|
# notification providers
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
}
|
596
|
-
uuid_np, _, _, _ = self.get_post(url_get='/notification_providers/', get_params=params, post_params=params)
|
687
|
+
uuid_np, _, _, _ = self.get_post(url_get='/notification_providers/',
|
688
|
+
get_params=select_get_params(notification_providers, ('uuid_notification_provider_type', 'app_name')),
|
689
|
+
post_params=notification_providers)
|
690
|
+
print(f'notification provider has been set ({uuid_np})')
|
597
691
|
|
598
692
|
# messages
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
"mask_mime_type": "string"
|
604
|
-
}
|
605
|
-
uuid_m, _, _, _ = self.get_post(url_get='/messages/', get_params=params, post_params=params)
|
693
|
+
uuid_m, _, _, _ = self.get_post(url_get='/messages/',
|
694
|
+
get_params=select_get_params(messages, ('code', 'description', 'mask')),
|
695
|
+
post_params=messages)
|
696
|
+
print(f'message has been set ({uuid_m})')
|
606
697
|
|
607
698
|
# calendar
|
608
699
|
# chiedi un calendar per nome
|
609
700
|
# se passi un json post_put del calender in json
|
610
|
-
uuid_calendar = self.
|
701
|
+
uuid_calendar, _, _, _ = self.get_post(url_get='/calendar/',
|
702
|
+
get_params=select_get_params(calendar, ('name', 'local_public_holidays')),
|
703
|
+
post_params=calendar)
|
704
|
+
print(f'calendar has been set ({uuid_calendar})')
|
611
705
|
|
612
706
|
# dispatcher
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
"code": "string",
|
618
|
-
"description": "string",
|
619
|
-
"delay": 0,
|
620
|
-
"status": "s",
|
621
|
-
"country": "st",
|
622
|
-
"state_province": "string",
|
623
|
-
"data_profile": [
|
624
|
-
"string"
|
625
|
-
]
|
626
|
-
}
|
627
|
-
uuid_d, _, _, _ = self.get_post(url_get='/dispatcehrs/', get_params=params, post_params=params)
|
707
|
+
uuid_d, _, _, _ = self.get_post(url_get='/dispatcher/',
|
708
|
+
get_params=select_get_params(dispatcher, ('tuple_required', 'uuid_message', 'code', 'status',)),
|
709
|
+
post_params=dispatcher)
|
710
|
+
print(f'dispatcher has been set ({uuid_d})')
|
628
711
|
|
629
712
|
# COLLEGAMENTO
|
630
713
|
# lista degli uuid degli oggetti da legare a questo dispacter
|
631
714
|
for uuid in uuids:
|
632
|
-
|
633
|
-
|
634
|
-
else:
|
635
|
-
raise NotImplementedError
|
715
|
+
self.execute(mode='POST', path=f'/dispatcher/{uuid_d}/{types}/{uuid}')
|
716
|
+
print(f'all the {types} have been linked with the selected dispatcher')
|
hive/cookbook/acl_docs.py
CHANGED
hive/cookbook/acl_overrides.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 AclOverrides(ApiManager):
|
@@ -27,6 +27,14 @@ class AclOverrides(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
|
+
'json_schema', 'skip', 'limit', 'like', 'join', 'count']
|
32
|
+
params.get('sort_by'), params.get('null_fields'), params.get('code'
|
33
|
+
), params.get('json_schema'), params.get('skip'), params.get(
|
34
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
35
|
+
'count')
|
36
|
+
warning_wrong_parameters(self.acl_overrides.__name__, params,
|
37
|
+
official_params_list)
|
30
38
|
response = self.execute('GET', path=f'/acl_overrides/', single_page
|
31
39
|
=single_page, page_size=page_size, warm_start=warm_start,
|
32
40
|
params=params, **kwargs)
|
@@ -43,6 +51,10 @@ class AclOverrides(ApiManager):
|
|
43
51
|
Returns: list"""
|
44
52
|
if kwargs is None:
|
45
53
|
kwargs = dict()
|
54
|
+
official_payload_list = ['code', 'acl_override']
|
55
|
+
payload.get('code'), payload.get('acl_override')
|
56
|
+
warning_wrong_parameters(self.acl_overrides_create.__name__,
|
57
|
+
payload, official_payload_list)
|
46
58
|
response = self.execute('POST', path=f'/acl_overrides/', payload=
|
47
59
|
payload, **kwargs)
|
48
60
|
return response
|
@@ -74,6 +86,10 @@ class AclOverrides(ApiManager):
|
|
74
86
|
Returns: list"""
|
75
87
|
if kwargs is None:
|
76
88
|
kwargs = dict()
|
89
|
+
official_payload_list = ['code', 'acl_override']
|
90
|
+
payload.get('code'), payload.get('acl_override')
|
91
|
+
warning_wrong_parameters(self.acl_overrides_put.__name__, payload,
|
92
|
+
official_payload_list)
|
77
93
|
response = self.execute('PUT', path=f'/acl_overrides/{uuid}',
|
78
94
|
payload=payload, **kwargs)
|
79
95
|
return response
|
@@ -110,6 +126,11 @@ class AclOverrides(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.acl_overrides_users.__name__, params,
|
133
|
+
official_params_list)
|
113
134
|
response = self.execute('GET', path=f'/acl_overrides/{uuid}/users',
|
114
135
|
single_page=single_page, page_size=page_size, warm_start=
|
115
136
|
warm_start, params=params, **kwargs)
|
hive/cookbook/analytics.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 Analytics(ApiManager):
|
@@ -30,6 +30,16 @@ class Analytics(ApiManager):
|
|
30
30
|
Returns: list"""
|
31
31
|
if kwargs is None:
|
32
32
|
kwargs = dict()
|
33
|
+
official_params_list = ['sort_by', 'null_fields', 'date_start',
|
34
|
+
'date_end', 'metric_profile', 'metric_name', 'skip', 'limit',
|
35
|
+
'like', 'join', 'count']
|
36
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
37
|
+
'date_start'), params.get('date_end'), params.get('metric_profile'
|
38
|
+
), params.get('metric_name'), params.get('skip'), params.get(
|
39
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
40
|
+
'count')
|
41
|
+
warning_wrong_parameters(self.analytic.__name__, params,
|
42
|
+
official_params_list)
|
33
43
|
response = self.execute('GET', path=f'/analytics/{uuid_customer}',
|
34
44
|
single_page=single_page, page_size=page_size, warm_start=
|
35
45
|
warm_start, params=params, **kwargs)
|
hive/cookbook/anomalies.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 Anomalies(ApiManager):
|
@@ -30,6 +30,16 @@ class Anomalies(ApiManager):
|
|
30
30
|
Returns: list"""
|
31
31
|
if kwargs is None:
|
32
32
|
kwargs = dict()
|
33
|
+
official_params_list = ['sort_by', 'null_fields', 'date_start',
|
34
|
+
'date_end', 'uuid_customer', 'type', 'value', 'sampling',
|
35
|
+
'skip', 'limit', 'like', 'join', 'count']
|
36
|
+
params.get('sort_by'), params.get('null_fields'), params.get(
|
37
|
+
'date_start'), params.get('date_end'), params.get('uuid_customer'
|
38
|
+
), params.get('type'), params.get('value'), params.get('sampling'
|
39
|
+
), params.get('skip'), params.get('limit'), params.get('like'
|
40
|
+
), params.get('join'), params.get('count')
|
41
|
+
warning_wrong_parameters(self.anomalies.__name__, params,
|
42
|
+
official_params_list)
|
33
43
|
response = self.execute('GET', path=f'/anomalies/', single_page=
|
34
44
|
single_page, page_size=page_size, warm_start=warm_start, params
|
35
45
|
=params, **kwargs)
|
@@ -51,6 +61,13 @@ class Anomalies(ApiManager):
|
|
51
61
|
Returns: list"""
|
52
62
|
if kwargs is None:
|
53
63
|
kwargs = dict()
|
64
|
+
official_payload_list = ['date_anomaly_start', 'date_anomaly',
|
65
|
+
'uuid_customer', 'type', 'value', 'sampling', 'parameters']
|
66
|
+
payload.get('date_anomaly_start'), payload.get('date_anomaly'
|
67
|
+
), payload.get('uuid_customer'), payload.get('type'), payload.get(
|
68
|
+
'value'), payload.get('sampling'), payload.get('parameters')
|
69
|
+
warning_wrong_parameters(self.anomalies_create.__name__, payload,
|
70
|
+
official_payload_list)
|
54
71
|
response = self.execute('POST', path=f'/anomalies/', payload=
|
55
72
|
payload, **kwargs)
|
56
73
|
return response
|
@@ -70,6 +87,10 @@ class Anomalies(ApiManager):
|
|
70
87
|
kwargs = dict()
|
71
88
|
kwargs, params = handling_single_page_methods(kwargs=kwargs, params
|
72
89
|
=params)
|
90
|
+
official_params_list = ['join']
|
91
|
+
params.get('join')
|
92
|
+
warning_wrong_parameters(self.anomalie.__name__, params,
|
93
|
+
official_params_list)
|
73
94
|
response = self.execute('GET', path=f'/anomalies/{uuid}',
|
74
95
|
warm_start=warm_start, params=params, **kwargs)
|
75
96
|
return response
|
@@ -109,6 +130,10 @@ class Anomalies(ApiManager):
|
|
109
130
|
Returns: list"""
|
110
131
|
if kwargs is None:
|
111
132
|
kwargs = dict()
|
133
|
+
official_params_list = ['join']
|
134
|
+
params.get('join')
|
135
|
+
warning_wrong_parameters(self.anomalies_bulk.__name__, params,
|
136
|
+
official_params_list)
|
112
137
|
response = self.execute('POST', path=f'/anomalies/bulk/read/',
|
113
138
|
single_page=single_page, page_size=page_size, warm_start=
|
114
139
|
warm_start, params=params, payload=payload, **kwargs)
|
@@ -144,6 +169,10 @@ class Anomalies(ApiManager):
|
|
144
169
|
Returns: list"""
|
145
170
|
if kwargs is None:
|
146
171
|
kwargs = dict()
|
172
|
+
official_params_list = ['best_effort']
|
173
|
+
params.get('best_effort')
|
174
|
+
warning_wrong_parameters(self.anomalies_create_bulk.__name__,
|
175
|
+
params, official_params_list)
|
147
176
|
response = self.execute('POST', path=f'/anomalies/bulk/create/',
|
148
177
|
single_page=single_page, page_size=page_size, params=params,
|
149
178
|
payload=payload, **kwargs)
|
hive/cookbook/calendars.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 Calendars(ApiManager):
|
@@ -54,6 +54,38 @@ class Calendars(ApiManager):
|
|
54
54
|
Returns: list"""
|
55
55
|
if kwargs is None:
|
56
56
|
kwargs = dict()
|
57
|
+
official_params_list = ['sort_by', 'null_fields', 'name',
|
58
|
+
'local_public_holidays', 'mon_int1_start', 'mon_int1_end',
|
59
|
+
'mon_int2_start', 'mon_int2_end', 'tue_int1_start',
|
60
|
+
'tue_int1_end', 'tue_int2_start', 'tue_int2_end',
|
61
|
+
'wed_int1_start', 'wed_int1_end', 'wed_int2_start',
|
62
|
+
'wed_int2_end', 'thu_int1_start', 'thu_int1_end',
|
63
|
+
'thu_int2_start', 'thu_int2_end', 'fri_int1_start',
|
64
|
+
'fri_int1_end', 'fri_int2_start', 'fri_int2_end',
|
65
|
+
'sat_int1_start', 'sat_int1_end', 'sat_int2_start',
|
66
|
+
'sat_int2_end', 'sun_int1_start', 'sun_int1_end',
|
67
|
+
'sun_int2_start', 'sun_int2_end', 'skip', 'limit', 'like',
|
68
|
+
'join', 'count']
|
69
|
+
params.get('sort_by'), params.get('null_fields'), params.get('name'
|
70
|
+
), params.get('local_public_holidays'), params.get('mon_int1_start'
|
71
|
+
), params.get('mon_int1_end'), params.get('mon_int2_start'
|
72
|
+
), params.get('mon_int2_end'), params.get('tue_int1_start'
|
73
|
+
), params.get('tue_int1_end'), params.get('tue_int2_start'
|
74
|
+
), params.get('tue_int2_end'), params.get('wed_int1_start'
|
75
|
+
), params.get('wed_int1_end'), params.get('wed_int2_start'
|
76
|
+
), params.get('wed_int2_end'), params.get('thu_int1_start'
|
77
|
+
), params.get('thu_int1_end'), params.get('thu_int2_start'
|
78
|
+
), params.get('thu_int2_end'), params.get('fri_int1_start'
|
79
|
+
), params.get('fri_int1_end'), params.get('fri_int2_start'
|
80
|
+
), params.get('fri_int2_end'), params.get('sat_int1_start'
|
81
|
+
), params.get('sat_int1_end'), params.get('sat_int2_start'
|
82
|
+
), params.get('sat_int2_end'), params.get('sun_int1_start'
|
83
|
+
), params.get('sun_int1_end'), params.get('sun_int2_start'
|
84
|
+
), params.get('sun_int2_end'), params.get('skip'), params.get(
|
85
|
+
'limit'), params.get('like'), params.get('join'), params.get(
|
86
|
+
'count')
|
87
|
+
warning_wrong_parameters(self.calendars.__name__, params,
|
88
|
+
official_params_list)
|
57
89
|
response = self.execute('GET', path=f'/calendars/', single_page=
|
58
90
|
single_page, page_size=page_size, warm_start=warm_start, params
|
59
91
|
=params, **kwargs)
|
@@ -98,6 +130,33 @@ class Calendars(ApiManager):
|
|
98
130
|
Returns: list"""
|
99
131
|
if kwargs is None:
|
100
132
|
kwargs = dict()
|
133
|
+
official_payload_list = ['name', 'local_public_holidays',
|
134
|
+
'mon_int1_start', 'mon_int1_end', 'mon_int2_start',
|
135
|
+
'mon_int2_end', 'tue_int1_start', 'tue_int1_end',
|
136
|
+
'tue_int2_start', 'tue_int2_end', 'wed_int1_start',
|
137
|
+
'wed_int1_end', 'wed_int2_start', 'wed_int2_end',
|
138
|
+
'thu_int1_start', 'thu_int1_end', 'thu_int2_start',
|
139
|
+
'thu_int2_end', 'fri_int1_start', 'fri_int1_end',
|
140
|
+
'fri_int2_start', 'fri_int2_end', 'sat_int1_start',
|
141
|
+
'sat_int1_end', 'sat_int2_start', 'sat_int2_end',
|
142
|
+
'sun_int1_start', 'sun_int1_end', 'sun_int2_start', 'sun_int2_end']
|
143
|
+
payload.get('name'), payload.get('local_public_holidays'), payload.get(
|
144
|
+
'mon_int1_start'), payload.get('mon_int1_end'), payload.get(
|
145
|
+
'mon_int2_start'), payload.get('mon_int2_end'), payload.get(
|
146
|
+
'tue_int1_start'), payload.get('tue_int1_end'), payload.get(
|
147
|
+
'tue_int2_start'), payload.get('tue_int2_end'), payload.get(
|
148
|
+
'wed_int1_start'), payload.get('wed_int1_end'), payload.get(
|
149
|
+
'wed_int2_start'), payload.get('wed_int2_end'), payload.get(
|
150
|
+
'thu_int1_start'), payload.get('thu_int1_end'), payload.get(
|
151
|
+
'thu_int2_start'), payload.get('thu_int2_end'), payload.get(
|
152
|
+
'fri_int1_start'), payload.get('fri_int1_end'), payload.get(
|
153
|
+
'fri_int2_start'), payload.get('fri_int2_end'), payload.get(
|
154
|
+
'sat_int1_start'), payload.get('sat_int1_end'), payload.get(
|
155
|
+
'sat_int2_start'), payload.get('sat_int2_end'), payload.get(
|
156
|
+
'sun_int1_start'), payload.get('sun_int1_end'), payload.get(
|
157
|
+
'sun_int2_start'), payload.get('sun_int2_end')
|
158
|
+
warning_wrong_parameters(self.calendars_create.__name__, payload,
|
159
|
+
official_payload_list)
|
101
160
|
response = self.execute('POST', path=f'/calendars/', payload=
|
102
161
|
payload, **kwargs)
|
103
162
|
return response
|
@@ -156,6 +215,33 @@ class Calendars(ApiManager):
|
|
156
215
|
Returns: list"""
|
157
216
|
if kwargs is None:
|
158
217
|
kwargs = dict()
|
218
|
+
official_payload_list = ['name', 'local_public_holidays',
|
219
|
+
'mon_int1_start', 'mon_int1_end', 'mon_int2_start',
|
220
|
+
'mon_int2_end', 'tue_int1_start', 'tue_int1_end',
|
221
|
+
'tue_int2_start', 'tue_int2_end', 'wed_int1_start',
|
222
|
+
'wed_int1_end', 'wed_int2_start', 'wed_int2_end',
|
223
|
+
'thu_int1_start', 'thu_int1_end', 'thu_int2_start',
|
224
|
+
'thu_int2_end', 'fri_int1_start', 'fri_int1_end',
|
225
|
+
'fri_int2_start', 'fri_int2_end', 'sat_int1_start',
|
226
|
+
'sat_int1_end', 'sat_int2_start', 'sat_int2_end',
|
227
|
+
'sun_int1_start', 'sun_int1_end', 'sun_int2_start', 'sun_int2_end']
|
228
|
+
payload.get('name'), payload.get('local_public_holidays'), payload.get(
|
229
|
+
'mon_int1_start'), payload.get('mon_int1_end'), payload.get(
|
230
|
+
'mon_int2_start'), payload.get('mon_int2_end'), payload.get(
|
231
|
+
'tue_int1_start'), payload.get('tue_int1_end'), payload.get(
|
232
|
+
'tue_int2_start'), payload.get('tue_int2_end'), payload.get(
|
233
|
+
'wed_int1_start'), payload.get('wed_int1_end'), payload.get(
|
234
|
+
'wed_int2_start'), payload.get('wed_int2_end'), payload.get(
|
235
|
+
'thu_int1_start'), payload.get('thu_int1_end'), payload.get(
|
236
|
+
'thu_int2_start'), payload.get('thu_int2_end'), payload.get(
|
237
|
+
'fri_int1_start'), payload.get('fri_int1_end'), payload.get(
|
238
|
+
'fri_int2_start'), payload.get('fri_int2_end'), payload.get(
|
239
|
+
'sat_int1_start'), payload.get('sat_int1_end'), payload.get(
|
240
|
+
'sat_int2_start'), payload.get('sat_int2_end'), payload.get(
|
241
|
+
'sun_int1_start'), payload.get('sun_int1_end'), payload.get(
|
242
|
+
'sun_int2_start'), payload.get('sun_int2_end')
|
243
|
+
warning_wrong_parameters(self.calendars_put.__name__, payload,
|
244
|
+
official_payload_list)
|
159
245
|
response = self.execute('PUT', path=f'/calendars/{uuid}', payload=
|
160
246
|
payload, **kwargs)
|
161
247
|
return response
|
@@ -195,6 +281,10 @@ class Calendars(ApiManager):
|
|
195
281
|
Returns: list"""
|
196
282
|
if kwargs is None:
|
197
283
|
kwargs = dict()
|
284
|
+
official_params_list = ['join']
|
285
|
+
params.get('join')
|
286
|
+
warning_wrong_parameters(self.calendars_bulk.__name__, params,
|
287
|
+
official_params_list)
|
198
288
|
response = self.execute('POST', path=f'/calendars/bulk/read/',
|
199
289
|
single_page=single_page, page_size=page_size, warm_start=
|
200
290
|
warm_start, params=params, payload=payload, **kwargs)
|
@@ -253,6 +343,10 @@ class Calendars(ApiManager):
|
|
253
343
|
Returns: list"""
|
254
344
|
if kwargs is None:
|
255
345
|
kwargs = dict()
|
346
|
+
official_params_list = ['best_effort']
|
347
|
+
params.get('best_effort')
|
348
|
+
warning_wrong_parameters(self.calendars_create_bulk.__name__,
|
349
|
+
params, official_params_list)
|
256
350
|
response = self.execute('POST', path=f'/calendars/bulk/create/',
|
257
351
|
single_page=single_page, page_size=page_size, params=params,
|
258
352
|
payload=payload, **kwargs)
|