launch_and_connect#
- ansys.sherlock.core.launcher.launch_and_connect(host='127.0.0.1', port=9090, single_project_path='', sherlock_command_args='', year=None, release_number=None, timeout=120, transport_mode='mtls', certs_dir=None, uds_dir=None, uds_id=None)#
Launch Sherlock, start gRPC on a given host and port, and wait until connected to Sherlock.
Available Since: 2025R2
- Parameters:
host (
str) – str: IP address to start gRPC on. The default is"127.0.0.1", which is the IP address for the local host.optional – IP address to start gRPC on. The default is
"127.0.0.1", which is the IP address for the local host.port (
int) – int: Port number for the connection.optional – Port number for the connection.
single_project_path (
str) – Path to the Sherlock project if invoking Sherlock in the single-project mode.sherlock_command_args (
str) – Additional command arguments for launching Sherlock.year (
int|None) – int: 4-digit year of the Sherlock release to launch. If not provided, the latest installed version of Sherlock will be launched.optional – 4-digit year of the Sherlock release to launch. If not provided, the latest installed version of Sherlock will be launched.
release_number (
int|None) – int: Release number of Sherlock to launch. If not provided, the latest installed version of Sherlock will be launched.optional – Release number of Sherlock to launch. If not provided, the latest installed version of Sherlock will be launched.
timeout (
int) – int: Maximum time (in seconds) to wait for the connection to Sherlock to be established. Default is 120 seconds.optional – Maximum time (in seconds) to wait for the connection to Sherlock to be established. Default is 120 seconds.
transport_mode (
str) – str: The gRPC transport mode: - “insecure” : unencrypted connection - “mtls” : mutual TLS authentication (default) - “uds” : Unix Domain Socket - “wnua” : Windows Named User Authenticationoptional –
- The gRPC transport mode:
”insecure” : unencrypted connection
”mtls” : mutual TLS authentication (default)
”uds” : Unix Domain Socket
”wnua” : Windows Named User Authentication
See Securing gRPC connections for more details.
- certs_dir: str, optional
Directory containing the mTLS certificates. Default is “./certs”.
- uds_dir: str, optional
Directory for the UDS socket file. Default is “$HOME/.conn”.
- uds_id: str, optional
Identifier for the UDS socket file name. Default is no identifier.
- Returns:
- Return type:
Examples
>>> from ansys.sherlock.core import launcher >>> sherlock, ansys_install_path = launcher.launch_and_connect( >>> port=9092, year=2026, release_number=1, transport_mode="wnua")