12.4. Sherlock Common Service- SherlockCommonService.proto

Click here to return to the main index to Sherlock's APIs.

This section contains health checks and exit APIs shared by all services. Clicking on the active links in the table below will take you to the selected API.

Table 12.41: Index to Sherlock Common Service APIs

Method NameRequest TypeResponse TypeDescription
For display purposes, the long strings in columns one through three are broken into multiple lines. Example: .IsSherlockClientLoadingRequest
check.HealthCheck Request.HealthCheck ResponseReturns health status of gRPC server.
exit.ExitRequest.ReturnCodeSignals for gRPC connection to shutdown.
isSherlock ClientLoading.IsSherlockClient LoadingRequestReturnCodeCheck if SherlockClient is still loading.
listUnits.ListUnitsRequest.ListUnits ResponseReturns a list of valid units of the provided unit type.
getSolders.GetSoldersRequest.GetSoldersResponseReturns a list of valid solder materials.

12.4.1. Exit Request

Empty request to exit the gRPC connection.

12.4.1.1. ExitRequest

Table 12.42: ExitRequest

FieldTypeLabelDescription
closeSherlockClientbool If set to true, exits the Sherlock client if it is opened. Otherwise, just closes the gRPC connection.

12.4.1.2. Examples: Exit

Proto Request Example
{
  "closeSherlockClient": true
}
Python Example:
import SherlockCommonService_pb2
import SherlockCommonService_pb2_grpc
import grpc

channel = grpc.insecure_channel('localhost:9090')
stub = SherlockCommonService_pb2_grpc.SherlockCommonServiceStub(channel)

message = SherlockCommonService_pb2.ExitRequest()
message.closeSherlockClient = True

response = stub.exit(message)

print(str(response))
Python Example:

For a Python example, refer to the online PySherlock Reference.

12.4.2. IsSherlockClientLoadingRequest

Check if the Sherlock client is still loading.

12.4.3. List Units

12.4.3.1. ListUnitsRequest

Request for a list of valid units of the provided unit type.

Table 12.43: ListUnitsRequest

FieldTypeLabelDescription
unitTypeListUnitsRequest.UnitType Unit type to request valid units of.

12.4.3.2. ListUnitsRequest.UnitType

Table 12.44: ListUnitsRequest.UnitType

NameNumberDescription
UNKNOWN0Indicates an unknown unit type.
ACCEL_DENSITY1Units used for acceleration density.
ACCELERATION2Units used for acceleration.
AREA3Units used for area.
BANDWIDTH4Units used for bandwidth.
CAPACITANCE5Units used for electrical capacitance.
CTE6Units used for material CTE.
CURRENT7Units used for electrical current.
DENSITY8Units used for density.
DISP_DENSITY9Units used for displacement density.
FORCE10Units used for force.
FREQUENCY11Units used for frequency.
INDUCTANCE12Units used for inductance.
LENGTH13Units used for length.
POWER14Units used for electrical power.
RESISTANCE15Units used for electrical resistance.
SIZE16Units used for size.
SPECIFIC_HEAT17Units used for specific heat.
STRAIN18Units used for strain.
STRESS19Units used for stress.
TEMPERATURE20Units used for temperature.
THERMAL_CONDUCTIVITY21Units used for thermal conductivity.
THERMAL_RESISTANCE22Units used for thermal resistance.
TIME23Units used for time.
VELOCITY24Units used for velocity.
VELOCITY_DENSITY25Units used for velocity density.
VOLTAGE26Units used for electrical voltage.
VOLUME27Units used for volume.
WEIGHT28Units used for weight.

12.4.3.3. ListUnitsResponse

Represents a list of valid units for the provided unit type.

Table 12.45: ListUnitsResponse

FieldTypeLabelDescription
returnCodeReturnCode Status code of response.
unitsstringrepeatedList of valid units for the requested type.

12.4.4. Return Code

Status response of a message. A value of 0 indicates a successful request.

Table 12.46: ReturnCode

FieldTypeLabelDescription
valueint32 Status code of response. A value of 0 indicates success.
messagestring Message indicating the status of response including any error.

12.4.5. Get Solders

12.4.5.1. GetSoldersRequest

Represents a request for a list of valid solder materials

12.4.5.2. GetSoldersResponse

Represents a list of valid solder materials

Table 12.47: GetSoldersResponse

FieldTypeLabelDescription
solderNamestringrepeatedList of valid solder materials.

12.4.5.3. Example: Get Solders

Proto Request Example
{}
Python Example:

For a Python example, refer to the online PySherlock Reference.

12.4.6. Health Check

12.4.6.1. HealthCheckRequest

Empty request to check if the gRPC connection is open.

12.4.6.2. HealthCheckResponse

Represents whether the gRPC connection is open.

Table 12.48: HealthCheckResponse

FieldTypeLabelDescription
statusHealthCheckResponse.ServingStatus  
portint32 Listening port number on server.

12.4.6.3. HealthCheckResponse.ServingStatus

Table 12.49: HealthCheckResponse.ServingStatus

NameNumberDescription
UNKNOWN0Indicates an unknown connection status.
SERVING1Indicates the connection is up and server is listening.
NOT_SERVING2Indicates connection with server is closed.

12.4.6.4. Examples: Health Check

Proto Request Example
{ }
Python Example
import SherlockCommonService_pb2
import SherlockCommonService_pb2_grpc
import grpc

channel = grpc.insecure_channel('localhost:9090')
stub = SherlockCommonService_pb2_grpc.SherlockCommonServiceStub(channel)
response = stub.check(SherlockCommonService_pb2.HealthCheckRequest())

print(str(response))

12.4.6.5. Example: List Units

Proto Request Example:
{
  "unitType": 13
}
Python Example:

For a Python example, refer to the online PySherlock Reference.