This Python application retrieves the account names and numbers within a given New Relic organization. The account numbers returned will vary depending on the New Relic User API Key used within the application.
- Clone the repository to your local machine:
git clone https://github.com/brett-larson/nr-get-accounts.git
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows
venv\Scripts\activate
- Mac
source venv/bin/activate
- Install the required packages:
pip install -r requirements.txt
- Ensure you have set up the necessary Environment Variables.
- Run the script in your IDE (PyCharm recommended).
- Review the output for the account names and numbers.
- Python 3.x
- The following Python libraries:
- requests
- os
- logging
- dotenv
You can install these packages using the requirements.txt file.
The program uses the dotenv
library to load environment variables. Create a .env
file in the root directory and set the required variables:
NEW_RELIC_USER_KEY=YOUR_NEW_RELIC_USER_API_KEY
The application uses Python's logging library for logging purposes. Logs will be written to a file named app.log
in the root directory. You can check this log file for detailed information about the program's execution.