I'm an engineer who doesn't care for a lot of fluff for fluff's sake.
Thursday, December 19, 2024
Premises vs. Premise
Thursday, December 12, 2024
Using Python Virtual Environments
tl;dr:
Setup:
mkdir my-new-project
cd my-new-project
python -m venv env
Linux Usage:
source env/bin/activate
Powershell Usage:
./env/Scripts/Activate.ps1
Either usage
pip install requests # and anything else you need
Exit
deactivate
Friday, December 6, 2024
Accessing LM with a bearer token through Postman
I'm a day late on this one, but at least it's good info:
Original content is here for now.
Original content is here for now.
- Download and install Postman, or use http://postman.com
- Launch Postman and create a new collection that will be used for all LogicMonitor API requests:
- In Postman, click Import and paste https://www.logicmonitor.com/swagger-ui-master/api-v3/dist/swagger.json. This should start the import process.
- Before clicking the import button, click the gear to view import settings.
- Make sure "Always inherit authentication" is checked on.
- Configure Authentication:
- Go to the collection root and select the auth tab.
- Change the auth type to "Bearer Token" and put {{bearer}} as the token.
- Go to the scripts tab and add this to the pre-request script:
pm.request.headers.add({key: 'X-Version', value: '3'}) - Save the collection.
- Create a new environment with the following variables. You just need one for the bearer token. You should set the type to 'secret' for sensitive credentials.
- url – https://<portalname>.logicmonitor.com/santaba/rest
- If you want to work with the LM Ingestion API, duplicate this environment and change the url to 'https://<portalname>.logicmonitor.com/rest' (without "santaba")
- bearer – secret – For the current value, be sure to prepend the token with "bearer " (with space)
And that should do it. You should be able to open any request already defined in the collection you imported and run it.
Subscribe to:
Posts (Atom)