Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I'm deploying a python script API that will communicate with another (external) API, made by another department.
Both my team and the other team use separate Test/Acceptance/Production environments.
The url of the other team's API will change depending on the environment it is deployed in.
I'd like to change the url to call from within my Dataiku API depending on the current environment/infra, so both the DS API and the external API can match up through the delivery environments.
Is it possible for a python script API to somehow know which infra it's currently deployed in (through the python public API)? That way I could set up a mapping to the external url to call.
Operating system used: Windows
The infra ID is not available from the API endpoint, but you can set you own env variables if these are static API nodes and retrieve via code:
# get the value of a specific environment variable
env_var_value = os.environ.get("ENV_VAR_NAME")