Skip to content

Commit 037293d

Browse files
Batch Interval supports integer values only and LMv1 token value fixed
1 parent f01d87d commit 037293d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

logicmonitor_data_sdk/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def check_authentication(self, authentication):
303303
'Authentication must provide the `id` and `key`'
304304
)
305305
self._authentication = authentication
306-
self._authentication['type'] = 'LMV1'
306+
self._authentication['type'] = 'LMv1'
307307

308308
def check_bearertoken(self,bearertoken):
309309
if not bearertoken:
@@ -341,7 +341,7 @@ def auth_settings(self):
341341
}
342342
else:
343343
return {
344-
'LMv1': {'type': 'api_key',
344+
'LMv1_empty': {'type': 'api_key',
345345
'in': 'header',
346346
'key': 'Authorization',
347347
'value': '',

logicmonitor_data_sdk/internal/internal_cache.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ def __init__(self, api_client, interval, batch, response_callback, request_cb,
6464
self._last_time_send = int(time.time())
6565
self.__init = True
6666
self._batch = batch
67-
self._interval = interval
67+
if interval:
68+
if isinstance(interval,int):
69+
self._interval = interval
70+
else:
71+
raise ValueError(" 'interval' accepts only integer values")
6872
# self._size = size
6973
self._size = None
7074
self._request_cb = request_cb
@@ -238,7 +242,7 @@ def make_request(self, path, method, **kwargs): # noqa: E501
238242
if auth_type_list[0]:
239243
auth_settings = ['bearertoken']
240244
else:
241-
auth_settings = ['LMV1'] # noqa: E501
245+
auth_settings = ['LMv1'] # noqa: E501
242246
# if the response type is a file, set _preload_content_value=false.
243247
# Because python 3.0+ 'utf-8' codec can't decode the binary string
244248
_response_type = 'PushMetricAPIResponse'

logicmonitor_data_sdk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
=======
99
"""
1010

11-
__version__ = "0.0.4.beta1"
11+
__version__ = "0.0.5.beta1"

0 commit comments

Comments
 (0)