jina.types.request.status module#

class jina.types.request.status.StatusMessage(status_object=None)[source]#

Bases: ProtoTypeMixin

Represents a Status message used for health check of the Flow

CopyFrom(other)#

Copy the content of target

Parameters:

other (TypeVar(T)) – the document to copy from

Return type:

None

MergeFrom(other)#

Merge the content of target

Parameters:

other (TypeVar(T)) – the document to merge from

Return type:

None

binary_str(**kwargs)#
clear()#

Remove all values from all fields of this Document.

Return type:

None

dict(**kwargs)#
json(**kwargs)#
property nbytes: int#

Return total bytes consumed by protobuf.

Return type:

int

Returns:

number of bytes

pop(*fields)#

Remove the values from the given fields of this Document.

Parameters:

fields – field names

Return type:

None

property proto#

Return the underlying Protobuf object

Returns:

Protobuf representation of the object

set_exception(ex)[source]#

Set exception information into the Status Message

Parameters:

ex (Exception) – The Exception to be filled

to_bytes()#

Return the serialized the message to a string.

For more Pythonic code, please use bytes(...).

Return type:

bytes

Returns:

binary string representation of the object

to_dict(**kwargs)#

Return the object in Python dictionary.

Note

Array like object such as numpy.ndarray (i.e. anything described as jina_pb2.NdArrayProto) will be converted to Python list.

Parameters:

kwargs – Extra kwargs to be passed to MessageToDict, like use_integers_for_enums

Return type:

Dict

Returns:

dict representation of the object

to_json()#

Return the object in JSON string

Return type:

str

Returns:

JSON string of the object

set_code(code)[source]#

Set the code of the Status Message

Parameters:

code – The code to be added