BaseServer#
- class ansys.dpf.core.server_types.BaseServer#
Bases:
abc.ABCAbstract class for servers.
Overview#
Must be implemented by subclasses. |
|
Must be implemented by subclasses. |
|
Must be implemented by subclasses. |
Set the current server as global if necessary. |
|
Check if server has a connected client. |
|
Clear the available Operators and Releases licenses when necessary. |
|
Define the settings that will be used to load DPF’s plugins. |
|
Check if the server version matches with a required version. |
|
Check if the server version matches with a required version. |
Must be implemented by subclasses. |
|
Must be implemented by subclasses. |
|
Return the list of plugins loaded on the server. |
|
Must be implemented by subclasses. |
|
Server information. |
|
Plan event callbacks from the server, such as progress bars during workflow execution and logging. |
|
Get the operating system of the server. |
|
Whether the DPF server should be started in a Docker Container by default. |
|
Return the docker config associated with the server. |
|
Must be implemented by subclasses. |
|
Returns the settings used to load DPF’s plugins. |
|
Must be implemented by subclasses. |
Import detail#
from ansys.dpf.core.server_types import BaseServer
Property detail#
- abstract property BaseServer.client#
Must be implemented by subclasses.
- abstract property BaseServer.version#
Must be implemented by subclasses.
- property BaseServer.plugins: dict#
Return the list of plugins loaded on the server.
- abstract property BaseServer.available_api_types#
Must be implemented by subclasses.
- property BaseServer.info#
Server information.
- Returns:
info – Dictionary with server information, including
"server_ip","server_port","server_process_id","server_version","os"and"path"keys.- Return type:
dictionary
- property BaseServer.session#
Plan event callbacks from the server, such as progress bars during workflow execution and logging.
- Return type:
- abstract property BaseServer.os#
Get the operating system of the server.
- Returns:
os – “nt” or “posix”
- Return type:
str
- property BaseServer.on_docker#
Whether the DPF server should be started in a Docker Container by default.
- property BaseServer.docker_config#
Return the docker config associated with the server.
- abstract property BaseServer.config#
Must be implemented by subclasses.
- property BaseServer.context#
Returns the settings used to load DPF’s plugins.
To update the context server side, use
ansys.dpf.core.BaseServer.server_types.apply_context()- Return type:
- property BaseServer.local_server: bool#
- Abstractmethod:
Must be implemented by subclasses.
Attribute detail#
- BaseServer.__slots__ = ()#
Method detail#
- BaseServer.set_as_global(as_global=True)#
Set the current server as global if necessary.
- Parameters:
as_global (bool, optional) – Global variable that stores the IP address and port for the DPF module. All DPF objects created in this Python session will use this IP and port. The default is
True.
- BaseServer.has_client()#
Check if server has a connected client.
- abstractmethod BaseServer.get_api_for_type(capi, grpcapi)#
Must be implemented by subclasses.
- abstractmethod BaseServer.shutdown()#
Must be implemented by subclasses.
- BaseServer.release()#
Clear the available Operators and Releases licenses when necessary.
Notes
Available with server’s version starting at 6.0 (Ansys 2023R2).
- BaseServer.apply_context(context)#
Define the settings that will be used to load DPF’s plugins.
A DPF xml file can be used to list the plugins and set up variables.
- Parameters:
context (ServerContext) – The context allows to choose which capabilities are available server side.
Notes
Available with server’s version starting at 6.0 (Ansys 2023R2).
- BaseServer.check_version(required_version, msg=None)#
Check if the server version matches with a required version.
- Parameters:
required_version (str) – Required version to compare with the server version.
msg (str, optional) – Message for the raised exception if version requirements do not match.
:raises dpf_errors : errors: errors.DpfVersionNotSupported is raised if failure.
- Returns:
Trueif the server version meets the requirement.- Return type:
bool
- BaseServer.meet_version(required_version)#
Check if the server version matches with a required version.
- Parameters:
required_version (str) – Required version to compare with the server version.
- Returns:
Trueif the server version meets the requirement.- Return type:
bool
- BaseServer.__str__()#
Return string representation of the instance.
- abstractmethod BaseServer.__eq__(other_server)#
Must be implemented by subclasses.
- BaseServer.__ne__(other_server)#
Return true, if the servers are not equal.
- BaseServer.__del__()#
Clean up resources associated with the instance.
- Raises:
Warning – If an exception occurs while attempting to delete resources.