start#
- Service.start(username: str = 'nexus', password: str = 'cei', create_db: bool = False, error_if_create_db_exists: bool = False, exit_on_close: bool = False, delete_db: bool = False) str#
Start a new service.
- Parameters:
- username
str,optional Username for the service. The default is
"nexus".- password
str,optional Password for the service. The default is
"cei".- create_dbbool,
optional Whether to create a new database before starting the service on top of it. The default is
False. IfTrue, this method creates a database in the directory specified by thedb_directoryparameter and starts the service on top of it. An error is raised if the directory specified by thedb_directoryparameter already exists and is not empty.- error_if_create_db_existsbool,
optional Whether to raise an error if the
create_dbparameter is set toTrueand the database already exists. The default isFalse, in which case thestart()method uses the database found instead of creating one.- exit_on_closebool,
optional Whether to automatically shut down the service when exiting the script. The default is
False, in which case the service continues to run.- delete_dbbool,
optional Whether to automatically delete the database when exiting the script. The default is
False. This parameter is valid only if this parameter and theexit_on_closeparameter are set toTrue.
- username
- Returns:
strID of the connected session.
- Raises:
DatabaseDirNotProvidedErrorThere is no database directory associated with the Service.
CannotCreateDatabaseErrorError when creating the database.
AlreadyConnectedErrorObject is already connected to a running ADR service.
StartingServiceErrorCan not start the ADR service.
NotValidServerCan not validate the current ADR service.
Examples
import ansys.dynamicreporting.core as adr installation_dir = r'C:\Program Files\ANSYS Inc\v232' adr_service = adr.Service(ansys_installation = installation_dir, db_directory = r'D:\tmp\new_db', port = 8020) session_guid = adr_service.start()