The product_instance.py
module#
Summary#
|
Start the requested service locally using the |
|
Return an available port to be used. |
Default Geometry Service’s folder name into the unified installer. |
|
Default Discovery’s folder name into the unified installer. |
|
Default SpaceClaim’s folder name into the unified installer. |
|
Default global Addins’s folder name into the unified installer. |
|
Default backend’s folder name into the |
|
Default backend’s add-in filename. |
|
The Windows Geometry Service’s filename. |
|
The Ansys Discovery’s filename. |
|
The Ansys SpaceClaim’s filename. |
|
The backend’s log level environment variable for local start. |
|
The backend’s enable trace environment variable for local start. |
|
The backend’s ip address environment variable for local start. |
|
The backend’s port number environment variable for local start. |
|
The backend’s logs folder path to be used. |
|
The backend’s api version environment variable for local start. |
|
The additional argument for local Ansys Discovery start. |
|
The argument to specify the backend’s add-in manifest file’s path. |
|
The argument to hide SpaceClaim’s UI on the backend. |
|
SpaceClaim hidden backend’s environment variable key. |
|
SpaceClaim hidden backend’s environment variable value. |
|
The argument to hide Discovery’s UI on the backend. |
|
The argument to specify the backend’s add-in manifest file’s path. |
Description#
Module containing the ProductInstance
class.
Module detail#
- product_instance.prepare_and_start_backend(backend_type: ansys.geometry.core.connection.backend.BackendType, product_version: int = None, host: str = 'localhost', port: int = None, enable_trace: bool = False, api_version: ansys.geometry.core.connection.backend.ApiVersions = ApiVersions.LATEST, timeout: int = 150, manifest_path: str = None, hidden: bool = False, server_log_level: int = 2, client_log_level: int = logging.INFO, server_logs_folder: str = None, client_log_file: str = None, log_level: int = None, logs_folder: str = None) ansys.geometry.core.modeler.Modeler #
Start the requested service locally using the
ProductInstance
class.When calling this method, a standalone service or product session is started. By default, if an endpoint is specified (by defining host and port parameters) but the endpoint is not available, the startup will fail. Otherwise, it will try to launch its own service.
- Parameters:
- product_version: ``int``, optional
The product version to be started. Goes from v23.2.1 to the latest. Default is
None
. If a specific product version is requested but not installed locally, a SystemError will be raised.- host: str, optional
IP address at which the Geometry service will be deployed. By default, its value will be
localhost
.- port
int
,optional
Port at which the Geometry service will be deployed. By default, its value will be
None
.- enable_tracebool,
optional
Boolean enabling the logs trace on the Geometry service console window. By default its value is
False
.- api_version: ``ApiVersions``, optional
The backend’s API version to be used at runtime. Goes from API v21 to the latest. Default is
ApiVersions.LATEST
.- timeout
int
,optional
Timeout for starting the backend startup process. The default is 150.
- manifest_path
str
,optional
Used to specify a manifest file path for the ApiServerAddin. This way, it is possible to run an ApiServerAddin from a version an older product version. Only applicable for Ansys Discovery and Ansys SpaceClaim.
- hidden
starts
the
product
hiding
its
UI.Default
is
False
. - server_log_level
int
,optional
- Backend’s log level from 0 to 3:
0: Chatterbox 1: Debug 2: Warning 3: Error
The default is
2
(Warning).- client_log_level
int
,optional
Logging level to apply to the client. By default, INFO level is used. Use the logging module’s levels: DEBUG, INFO, WARNING, ERROR, CRITICAL.
- server_logs_folder
str
,optional
Sets the backend’s logs folder path. If nothing is defined, the backend will use its default path.
- client_log_file
str
,optional
Sets the client’s log file path. If nothing is defined, the client will log to the console.
- log_level
int
,optional
DEPRECATED. Use
server_log_level
instead.- logs_folder
str
,optional
DEPRECATED. Use
server_logs_folder
instead.
- Returns:
Modeler
Instance of the Geometry service.
- Raises:
ConnectionError
If the specified endpoint is already in use, a connection error will be raised.
SystemError
If there is not an Ansys product 23.2 version or later installed or if a specific product’s version is requested but not installed locally then a SystemError will be raised.
- product_instance.get_available_port() int #
Return an available port to be used.
- Returns:
int
The available port.
- product_instance.WINDOWS_GEOMETRY_SERVICE_FOLDER = 'GeometryService'#
Default Geometry Service’s folder name into the unified installer.
- product_instance.DISCOVERY_FOLDER = 'Discovery'#
Default Discovery’s folder name into the unified installer.
- product_instance.SPACECLAIM_FOLDER = 'scdm'#
Default SpaceClaim’s folder name into the unified installer.
- product_instance.ADDINS_SUBFOLDER = 'Addins'#
Default global Addins’s folder name into the unified installer.
- product_instance.BACKEND_SUBFOLDER = 'ApiServer'#
Default backend’s folder name into the
ADDINS_SUBFOLDER
folder.
- product_instance.MANIFEST_FILENAME = 'Presentation.ApiServerAddIn.Manifest.xml'#
Default backend’s add-in filename.
To be used only for local start of Ansys Discovery or Ansys SpaceClaim.
- product_instance.GEOMETRY_SERVICE_EXE = 'Presentation.ApiServerDMS.exe'#
The Windows Geometry Service’s filename.
- product_instance.DISCOVERY_EXE = 'Discovery.exe'#
The Ansys Discovery’s filename.
- product_instance.SPACECLAIM_EXE = 'SpaceClaim.exe'#
The Ansys SpaceClaim’s filename.
- product_instance.BACKEND_LOG_LEVEL_VARIABLE = 'LOG_LEVEL'#
The backend’s log level environment variable for local start.
- product_instance.BACKEND_TRACE_VARIABLE = 'ENABLE_TRACE'#
The backend’s enable trace environment variable for local start.
- product_instance.BACKEND_HOST_VARIABLE = 'API_ADDRESS'#
The backend’s ip address environment variable for local start.
- product_instance.BACKEND_PORT_VARIABLE = 'API_PORT'#
The backend’s port number environment variable for local start.
- product_instance.BACKEND_LOGS_FOLDER_VARIABLE = 'ANS_DSCO_REMOTE_LOGS_FOLDER'#
The backend’s logs folder path to be used.
- product_instance.BACKEND_API_VERSION_VARIABLE = 'API_VERSION'#
The backend’s api version environment variable for local start.
To be used only with Ansys Discovery and Ansys SpaceClaim.
- product_instance.BACKEND_SPACECLAIM_OPTIONS = '--spaceclaim-options'#
The additional argument for local Ansys Discovery start.
To be used only with Ansys Discovery.
- product_instance.BACKEND_ADDIN_MANIFEST_ARGUMENT = '/ADDINMANIFESTFILE='#
The argument to specify the backend’s add-in manifest file’s path.
To be used only with Ansys Discovery and Ansys SpaceClaim.
- product_instance.BACKEND_SPACECLAIM_HIDDEN = '/Headless=True'#
The argument to hide SpaceClaim’s UI on the backend.
To be used only with Ansys SpaceClaim.
- product_instance.BACKEND_SPACECLAIM_HIDDEN_ENVVAR_KEY = 'SPACECLAIM_MODE'#
SpaceClaim hidden backend’s environment variable key.
To be used only with Ansys SpaceClaim.
- product_instance.BACKEND_SPACECLAIM_HIDDEN_ENVVAR_VALUE = '2'#
SpaceClaim hidden backend’s environment variable value.
To be used only with Ansys SpaceClaim.
- product_instance.BACKEND_DISCOVERY_HIDDEN = '--hidden'#
The argument to hide Discovery’s UI on the backend.
To be used only with Ansys Discovery.
- product_instance.BACKEND_SPLASH_OFF = '/Splash=False'#
The argument to specify the backend’s add-in manifest file’s path.
To be used only with Ansys Discovery and Ansys SpaceClaim.