Easily Switching Between Multiple Axonius API Interfaces
In environments with multiple instances of Axonius, it can be cumbersome switching between the different APIs due to the need to update your environment variables with the correct URL, API key and API secret.
One way to make this easier is to create separate files containing the environment variables for each and then use the AX_ENV variable when calling your script or command.
For example, with the following text file already created as example.txt:
#Example Environment Variables
We could then use our simple API device count call, while telling it to use those environment variables using AX_ENV:
AX_ENV=example.txt axonshell devices count
Now anytime you need to switch Axonius API instances, you can just change AX_ENV to the file with the correct credentials.