ni_measurementlink_service.discovery._client
Client for accessing the MeasurementLink discovery service.
Module Contents
Classes
Client for accessing the MeasurementLink discovery service. |
- class ni_measurementlink_service.discovery._client.DiscoveryClient(stub=None, *, grpc_channel_pool=None)[source]
Client for accessing the MeasurementLink discovery service.
- Parameters:
stub (Optional[ni_measurementlink_service._internal.stubs.ni.measurementlink.discovery.v1.discovery_service_pb2_grpc.DiscoveryServiceStub]) –
grpc_channel_pool (Optional[ni_measurementlink_service.grpc.channelpool.GrpcChannelPool]) –
- property registration_id: str
“The ID from discovery service upon successful registration.
- Return type:
- property stub: ni_measurementlink_service._internal.stubs.ni.measurementlink.discovery.v1.discovery_service_pb2_grpc.DiscoveryServiceStub
Get the gRPC stub used to interact with the discovery service.
- register_measurement_service(service_port, service_info, measurement_info)[source]
Register the measurement service with the discovery service.
- Parameters:
service_port (str) – The port number of the service.
service_info (ni_measurementlink_service.measurement.info.ServiceInfo) – Information describing the service.
measurement_info (ni_measurementlink_service.measurement.info.MeasurementInfo) – Information describing the measurement.
- Returns:
Boolean indicating whether the service was successfully registered.
- Return type:
- register_service(service_info, service_location)[source]
Register the specified service with the discovery service.
- Parameters:
service_info (ni_measurementlink_service.measurement.info.ServiceInfo) – Information describing the service.
service_location (ni_measurementlink_service.discovery._types.ServiceLocation) – The location of the service on the network.
- Returns:
ID that can be used to unregister the service.
- Return type:
- unregister_service(registration_id='')[source]
Unregisters the specified service from the discovery service.
This method should be called before the service exits.
- resolve_service(provided_interface, service_class='')[source]
Resolve the location of a service.
Given a description of a service, returns information that can be used to establish communication with that service. If necessary, the service will be started by the discovery service if it has not already been started.
- Parameters:
- Returns:
The service location.
- Return type: