def make_rest_call(self, method, url, params=None, headers=None, data=None, retry_401=0):
        """Make a rest call.

        Args:
            url (str): The URL to make the call to.
            method (str): The HTTP method to use for the call.
            params (dict, optional): The parameters to pass in the call (default is None).
            headers (dict, optional): The headers to pass in the call (default is None).
            data (dict, optional): The body of the request (default is None).
            retry_401(int): Number of retry in 401(default is 0).

        Returns:
            dict: The JSON response if the call is successful.
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:
            for _ in range(retry_401 + 1):
                response = requests.request(
                    method, url, headers=self.header, params=params, data=data, timeout=consts.REQUEST_TIMEOUT
                )
                if response.status_code == 200:
                    response_json = response.json()
                    logging.info(
                        consts.LOG_FORMAT.format(
                            __method_name, "Success, Status code : {}.".format(response.status_code)
                        )
                    )
                    return response_json
                elif response.status_code == 400:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name,
                            "Bad Request = {}, Status code : {}.".format(response.text, response.status_code),
                        )
                    )
                    raise ArmisException()
                elif response.status_code == 401:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name, "Unauthorized, Status code : {}, Retrying...".format(response.status_code)
                        )
                    )
                    self.compare_access_token()
                    self.retry_count += 1
                    continue
                elif response.status_code == 429:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name,
                            "Too Many Requests, Status code : {}.".format(response.status_code),
                        )
                    )
                    raise ArmisException()
                elif response.status_code == 500:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name,
                            "Internal Server Error, Status code : {}.".format(response.status_code),
                        )
                    )
                    raise ArmisException()
                elif response.status_code == 502:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name,
                            "Bad GateWay, Status code : {}.".format(response.status_code),
                        )
                    )
                    raise ArmisException()
                else:
                    logging.error(
                        consts.LOG_FORMAT.format(
                            __method_name,
                            "Unexpected Error = {}, Status code : {}.".format(response.text, response.status_code),
                        )
                    )
                    raise ArmisException()
            logging.error(consts.LOG_FORMAT.format(__method_name, "Max retries exceeded."))
            raise ArmisException()
        except ArmisException:
            raise ArmisException()
        except requests.ConnectionError as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "Connection error : {}.".format(err),
                )
            )
            raise ArmisException()
        except requests.HTTPError as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "HTTP error : {}.".format(err),
                )
            )
            raise ArmisException()
        except requests.Timeout as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "Timeout error : {}.".format(err),
                )
            )
            raise ArmisException()
        except requests.exceptions.InvalidURL as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "Invalid URL error : {}.".format(err),
                )
            )
            raise ArmisException()
        except Exception as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "Unexpected error : {}.".format(err),
                )
            )
            raise ArmisException()
Make a rest call.

        Args:
            url (str): The URL to make the call to.
            method (str): The HTTP method to use for the call.
            params (dict, optional): The parameters to pass in the call (default is None).
            headers (dict, optional): The headers to pass in the call (default is None).
            data (dict, optional): The body of the request (default is None).
            retry_401(int): Number of retry in 401(default is 0).

        Returns:
            dict: The JSON response if the call is successful.
        
Solutions/Armis/Data Connectors/ArmisAlertsActivities/ArmisAlertActivitySentinelConnector/utils.py