LM Python SDK add_device_property()
Hello,
I'm running into an odd issue when using the LM SDK add_device_property() function. I have used this function many times but for some reason when I attempt to inject a custom property with an integer value for the custom property value I receive the following exception documented below. Even when I attempt to cast the value as a string before it's sent to the SDK somehow its not working and we still hit the same exception. If the value of the customproperty is an actual string with alpha characters then the custom property is created without issue using the add_device_property function. Am I doing something wrong or is there possibly a bug in the SDK? I will also add that when we ADD a new device using the SDK and provide a custom property with an integer value it works and adds the custom property without issue.
Examples of the custom prop payload:
{'name': 'autotask.accountnumber', 'value': 1234567} <-- this gives us the exception below
{'name': 'autotask.accountnumber', 'value': '1234567'} <-- this gives also gives us the exception below you can see the value is sent as a string
{'name': 'autotask.accountnumber', 'value': '_1234567'} <-- when we send the value as shown to the left it works without issue (but we dont want this value it needs to be a number)
Exception:
Traceback (most recent call last):
File "Python Workspace\Logicmonitor Add\lm_add_customprop.py", line 47, in <module>
api_response = api_instance.add_device_property(devid,custprop)
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api\lm_api.py", line 1966, in add_device_property
(data) = self.add_device_property_with_http_info(device_id, body, **kwargs) # noqa: E501
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api\lm_api.py", line 2046, in add_device_property_with_http_info
return self.api_client.call_api(
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api_client.py", line 331, in call_api
return self.__call_api(resource_path, method,
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api_client.py", line 122, in __call_api
path_params = self.sanitize_for_serialization(path_params)
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api_client.py", line 224, in sanitize_for_serialization
return {key: self.sanitize_for_serialization(val)
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api_client.py", line 224, in <dictcomp>
return {key: self.sanitize_for_serialization(val)
File "Python Workspace\Logicmonitor Add\env\lib\site-packages\logicmonitor_sdk\api_client.py", line 221, in sanitize_for_serialization
for attr, _ in six.iteritems(obj.swagger_types)
AttributeError: 'numpy.int64' object has no attribute 'swagger_types'