How to handle rate limiting in the LogicMonitor SDK v3?
In order to prevent running into 429 errors, I would like to check the 'x-rate-limit-remaining' in the response headers when I have made a call. But it appears these headers are only returned when an exception already has taken place. Is it possible to check these values or are these simply not returned unless there is an error? In the latter case, please consider this a feature request. :) Screenshot for reference: Thanks!126Views1like8CommentsHow to use a bearer token for authentication using Python SDK
I am trying to use a bearer token for authentication using Python SDK. On the documentation I found several examples using the LMv1 access_id and access_key values, like this: # Configure API key authorization: LMv1 configuration = logicmonitor_sdk.Configuration() configuration.company = 'YOUR_COMPANY' configuration.access_id = 'YOUR_ACCESS_ID' configuration.access_key = 'YOUR_ACCESS_KEY' # create an instance of the API class api_instance = logicmonitor_sdk.LMApi(logicmonitor_sdk.ApiClient(configuration)) but couldn’t find any example on using bearer token for authentication. After some search I found something about defining “api_token” and “api_token_prefix” but couldn’t get it to work. Anybody have any example I could follow to use this?437Views17likes21CommentsSDK install deprecated
Got this on a recent reinstall of logicmonitor_sdk using pip. DEPRECATION: logicmonitor_sdk is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 The part that worries me is that pip 23.1 will enforce the pyproject.toml and given the rate that LM publishes updates the SDK, pip installs will break at some point. For me that point is pretty soon because 23.1 is the current version of pip. Luckily, I haven’t upgraded my pip from 22.3.1 to 23.1 like it’s prompting me to. Anybody else tried pip installing it while already on 23.1? Guess I’ll mock it up in docker.Solved99Views3likes4Comments