helyos_agent_sdk.summary_request module

class helyos_agent_sdk.summary_request.SummaryRPC(helyos_client)

Bases: object

This module defines the SummaryRPC class.

The class is responsible for handling remote procedure calls (RPCs) using the AMQP protocol. It connects to a Helyos client and makes requests to helyOS database.

Attributes: connection (obj): The pika RabbitMQ connection object . helyos_client (obj): The Helyos client object. routing_key (str): The routing key for the summary requests. username (str): The username for the RabbitMQ. channel (obj): The channel object of the connection. callback_queue (str): The callback queue for receiving responses. response (str): The response received from the RPC call. corr_id (str): The unique correlation id for the RPC call.

Methods: init(connection, helyos_client): Initializes the SummaryRPC object and sets up the necessary attributes. on_response(ch, method, props, body): Callback function for handling the response received from the RPC call. call(request): Makes a remote procedure call with the given request and returns the response.


helyos_client = HelyOSClient(host=’myrabbitmq.com’, port=5672, uuid=’3452345-52453-43525’) helyos_client.connect_rabbitmq(‘my_username’, ‘secret_password’) summary_rpc = SummaryRPC(helyos_client) agents_summary = summary_rpc.call({‘query’: ‘allAgents’, ‘conditions’: {“yard_id”: 1}})

__init__(helyos_client)
on_response(ch, method, props, body)
call(request)
Parameters

request (dict) – a dictionary containing the query and conditions. The query can be one of the following: “allAgents”, “allYards”, “executingMissions”, “missionAssignments” or “allMapObjects”. The conditions specify additional filtering criteria for the query.

Returns

the requested information based on the provided query and conditions.

Return type

an