Skip to main content

report

Used to report messages to the Swarm Controller server.


attr STUB

Type: ReportStub

Stub that is automatically set at runtime so that actions for this service can connect to grpc.


class SendReport

Inherits from: Action

Send a report to the server.

Attributes

attr  report  (ReportMessage) report data

method execute

Call Type: async

Execute the SendReport action.

Returns

Response response generated by the RPC call.

View Source
@register_action
class SendReport(Action):
"""Send a report to the server.

Attributes:
report (params.ReportMessage): report data
"""
report: params.ReportMessage

async def execute(self) -> Response:
"""Execute the SendReport action.

Returns:
Response: response generated by the RPC call.
"""
req = report_service_pb2.SendReportRequest()
ParseDict(payload_from_action(self), req)
return await run_unary(STUB.SendReport, req)