from_environment#
- static Configuration.from_environment()#
Create a PyPIM configuration based on the environment configuration.
Before calling this method,
is_configured()should be called to check if the environment is configured to use PyPIM.The environment configuration consists in setting the environment variable
ANSYS_PLATFORM_INSTANCEMANAGEMENT_CONFIGto the path of the PyPIM configuration file. The configuration file is a simple JSON file containing the URI of the PIM API and the headers required to pass information.The configuration file format is:
{ "version": 1, "pim": { "uri": "dns:pim.svc.com:80", "headers": { "metadata-info": "value" }, "tls": false } }
A version 2 file replaces
tlswith asecurityblock to select any supported transport (insecure,tls,uds,mtls, orwnua). See Security for the version 2 schema.- Returns:
ConfigurationPyPIM configuration settings.
- Raises:
NotConfiguredErrorThe environment is not configured to use PyPIM.
InvalidConfigurationErrorThe configuration is invalid.