def cancel_execution(self, exec_id):
    """Cancel workflow execution.

    :param exec_id: Execution ID.

    """
    self._logger.debug('Cancelling execution %s.', exec_id)
    res = _extract_json(self._request(
      method='GET',
      endpoint='executor',
      params={
        'execid': exec_id,
        'ajax': 'cancelFlow',
      },
    ))
    if 'error' in res:
      raise AzkabanError('Execution %s is not running.', exec_id)
    else:
      self._logger.info('Execution %s cancelled.', exec_id)
    return res
dataset/ETHPy150Open mtth/azkaban/azkaban/remote.py/Session.cancel_execution/original