GrpcClient
#
- class ansys.geometry.core.connection.client.GrpcClient(host: str = DEFAULT_HOST, port: str | int = DEFAULT_PORT, channel: grpc.Channel | None = None, remote_instance: ansys.platform.instancemanagement.Instance | None = None, docker_instance: ansys.geometry.core.connection.docker_instance.LocalDockerInstance | None = None, product_instance: ansys.geometry.core.connection.product_instance.ProductInstance | None = None, timeout: ansys.geometry.core.typing.Real = 120, logging_level: int = logging.INFO, logging_file: pathlib.Path | str | None = None, backend_type: ansys.geometry.core.connection.backend.BackendType | None = None)#
Wraps the gRPC connection for the Geometry service.
- Parameters:
- host
str
, default:DEFAULT_HOST
Host where the server is running.
- port
str
orint
, default:DEFAULT_PORT
Port number where the server is running.
- channel
Channel
, default:None
gRPC channel for server communication.
- remote_instance
ansys.platform.instancemanagement.Instance
, default:None
Corresponding remote instance when the Geometry service is launched through PyPIM. This instance is deleted when calling the
GrpcClient.close
method.- docker_instance
LocalDockerInstance
, default:None
Corresponding local Docker instance when the Geometry service is launched using the
launch_docker_modeler()
method. This local Docker instance is deleted when theGrpcClient.close
method is called.- product_instance
ProductInstance
, default:None
Corresponding local product instance when the product (Discovery or SpaceClaim) is launched through the
launch_modeler_with_geometry_service()
,launch_modeler_with_discovery()
or thelaunch_modeler_with_spaceclaim()
interface. This instance will be deleted when theGrpcClient.close
method is called.- timeout
real
, default: 120 Maximum time to spend trying to make the connection.
- logging_level
int
, default:INFO
Logging level to apply to the client.
- logging_file
str
orPath
, default:None
File to output the log to, if requested.
- backend_type: BackendType, default: None
Type of the backend that PyAnsys Geometry is communicating with. By default, this value is unknown, which results in
None
being the default value.
- host
Overview#
Backend type. |
|
Get the current backend version. |
|
Flag indicating whether multiple designs are allowed. |
|
Client gRPC channel. |
|
Specific instance logger. |
|
Flag indicating whether the client connection is closed. |
|
Flag indicating whether the client channel is healthy. |
Represent the client as a string. |
Import detail#
from ansys.geometry.core.connection.client import GrpcClient
Property detail#
- property GrpcClient.backend_type: ansys.geometry.core.connection.backend.BackendType#
Backend type.
Options are
Windows Service
,Linux Service
,Discovery
, andSpaceClaim
.Notes
This method might return
None
because determining the backend type is not straightforward.
- property GrpcClient.backend_version: semver.version.Version#
Get the current backend version.
- Returns:
Version
Backend version.
- property GrpcClient.multiple_designs_allowed: bool#
Flag indicating whether multiple designs are allowed.
Notes
This method will return
False
if the backend type isDiscovery
orLinux Service
. Otherwise, it will returnTrue
.
- property GrpcClient.channel: grpc.Channel#
Client gRPC channel.
- property GrpcClient.log: ansys.geometry.core.logger.PyGeometryCustomAdapter#
Specific instance logger.