def get_brokers(self,
                    *,
                    caller: AuthToken,
                    broker_id: ID = None,
                    id_token: str = None) -> ResultProxyAvro:
        result = ResultProxyAvro()
        result.status = ResultAvro()

        if caller is None:
            result.status.set_code(ErrorCodes.ErrorInvalidArguments.value)
            result.status.set_message(
                ErrorCodes.ErrorInvalidArguments.interpret())
            return result

        try:
            brokers = None
            if broker_id is None:
                brokers = self.client.get_brokers()
            else:
                broker = self.client.get_broker(guid=broker_id)
                if broker is not None:
                    brokers = [broker]
                    result.proxies = Converter.fill_proxies(proxies=brokers)
                else:
                    result.status.set_code(ErrorCodes.ErrorNoSuchBroker.value)
                    result.status.set_message(
                        ErrorCodes.ErrorNoSuchBroker.interpret())
            if brokers is not None:
                result.proxies = Converter.fill_proxies(proxies=brokers)
        except Exception as e:
            self.logger.error("get_brokers {}".format(e))
            result.status.set_code(ErrorCodes.ErrorInternalError.value)
            result.status.set_message(
                ErrorCodes.ErrorInternalError.interpret(exception=e))
            result.status = ManagementObject.set_exception_details(
                result=result.status, e=e)

        return result
    def do_get_proxies(self,
                       *,
                       atype: ActorType,
                       protocol: str,
                       caller: AuthToken,
                       id_token: str = None) -> ResultProxyAvro:
        result = ResultProxyAvro()
        result.status = ResultAvro()

        if caller is None or protocol is None:
            result.status.set_code(ErrorCodes.ErrorInvalidArguments.value)
            result.status.set_message(ErrorCodes.ErrorInvalidArguments.name)
            return result

        try:
            proxies = None
            if atype == ActorType.Broker:
                proxies = ActorRegistrySingleton.get().get_broker_proxies(
                    protocol=protocol)
            elif atype == ActorType.Authority:
                proxies = ActorRegistrySingleton.get().get_site_proxies(
                    protocol=protocol)
            else:
                proxies = ActorRegistrySingleton.get().get_proxies(
                    protocol=protocol)

            result.proxies = Converter.fill_proxies(proxies=proxies)
        except Exception as e:
            self.logger.error("get_broker_proxies {}".format(e))
            result.status.set_code(ErrorCodes.ErrorInternalError.value)
            result.status.set_message(
                ErrorCodes.ErrorInternalError.interpret(exception=e))
            result.status = ManagementObject.set_exception_details(
                result=result.status, e=e)

        return result