GrpcClient#
- class ansys.geometry.core.connection.client.GrpcClient(host: str = pygeom_defaults.DEFAULT_HOST, port: str | int = pygeom_defaults.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, proto_version: str | None = None)#
Wraps the gRPC connection for the Geometry service.
- Parameters:
- host
str, default:DEFAULT_HOST Host where the server is running.
- port
strorint, 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.closemethod.- 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.closemethod 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.closemethod 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
strorPath, default:None File to output the log to, if requested.
- proto_version: str or None, default: None
Version of the gRPC protocol to use. If
None, the latest version is used.
- host
Overview#
Get a string with the backend information. |
|
Close the channel. |
|
Get the target of the channel. |
|
Get the target name of the connection. |
Backend type. |
|
Get the current backend version. |
|
Flag indicating whether multiple designs are allowed. |
|
Client gRPC channel. |
|
GRPC services. |
|
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
Nonebecause determining the backend type is not straightforward.
- property GrpcClient.backend_version: semver.version.Version#
Get the current backend version.
- Returns:
VersionBackend version.
- property GrpcClient.multiple_designs_allowed: bool#
Flag indicating whether multiple designs are allowed.
Notes
Currently, only one design is allowed per service. This method will always return
False.
- property GrpcClient.channel: grpc.Channel#
Client gRPC channel.
- property GrpcClient.services: ansys.geometry.core._grpc._services._service._GRPCServices#
GRPC services.
- property GrpcClient.log: ansys.geometry.core.logger.PyGeometryCustomAdapter#
Specific instance logger.
Method detail#
- GrpcClient.backend_info(indent=0) str#
Get a string with the backend information.
- Returns:
strString with the backend information.