def _do_api_call(self, endpoint_info, json):
method, endpoint = endpoint_info<EOL>url = '<STR_LIT>'.format(<EOL>host=self._parse_host(self.databricks_conn.host),<EOL>endpoint=endpoint)<EOL>if '<STR_LIT>' in self.databricks_conn.extra_dejson:<EOL><INDENT>self.log.info('<STR_LIT>')<EOL>auth = _TokenAuth(self.databricks_conn.extra_dejson['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>self.log.info('<STR_LIT>')<EOL>auth = (self.databricks_conn.login, self.databricks_conn.password)<EOL><DEDENT>if method == '<STR_LIT:GET>':<EOL><INDENT>request_func = requests.get<EOL><DEDENT>elif method == '<STR_LIT:POST>':<EOL><INDENT>request_func = requests.post<EOL><DEDENT>else:<EOL><INDENT>raise AirflowException('<STR_LIT>' + method)<EOL><DEDENT>attempt_num = <NUM_LIT:1><EOL>while True:<EOL><INDENT>try:<EOL><INDENT>response = request_func(<EOL>url,<EOL>json=json,<EOL>auth=auth,<EOL>headers=USER_AGENT_HEADER,<EOL>timeout=self.timeout_seconds)<EOL>response.raise_for_status()<EOL>return response.json()<EOL><DEDENT>except requests_exceptions.RequestException as e:<EOL><INDENT>if not _retryable_error(e):<EOL><INDENT>raise AirflowException('<STR_LIT>'.format(<EOL>e.response.content, e.response.status_code))<EOL><DEDENT>self._log_request_error(attempt_num, e)<EOL><DEDENT>if attempt_num == self.retry_limit:<EOL><INDENT>raise AirflowException(('<STR_LIT>' +<EOL>'<STR_LIT>').format(self.retry_limit))<EOL><DEDENT>attempt_num += <NUM_LIT:1><EOL>sleep(self.retry_delay)<EOL><DEDENT>
Utility function to perform an API call with retries

:param endpoint_info: Tuple of method and endpoint
:type endpoint_info: tuple[string, string]
:param json: Parameters for this API call.
:type json: dict
:return: If the api call returns a OK status code,
    this function returns the response in JSON. Otherwise,
    we throw an AirflowException.
:rtype: dict