Repository: apache/airflow
File: providers/databricks/src/airflow/providers/databricks/hooks/databricks.py (Python)

Code before:
GET_CLUSTER_ENDPOINT = ("GET", "2.0/clusters/get")
RESTART_CLUSTER_ENDPOINT = ("POST", "2.0/clusters/restart")
START_CLUSTER_ENDPOINT = ("POST", "2.0/clusters/start")
TERMINATE_CLUSTER_ENDPOINT = ("POST", "2.0/clusters/delete")

CREATE_ENDPOINT = ("POST", "2.1/jobs/create")
RESET_ENDPOINT = ("POST", "2.1/jobs/reset")
UPDATE_ENDPOINT = ("POST", "2.1/jobs/update")
RUN_NOW_ENDPOINT = ("POST", "2.1/jobs/run-now")
SUBMIT_RUN_ENDPOINT = ("POST", "2.1/jobs/runs/submit")
GET_RUN_ENDPOINT = ("GET", "2.1/jobs/runs/get")
CANCEL_RUN_ENDPOINT = ("POST", "2.1/jobs/runs/cancel")
DELETE_RUN_ENDPOINT = ("POST", "2.1/jobs/runs/delete")
REPAIR_RUN_ENDPOINT = ("POST", "2.1/jobs/runs/repair")
OUTPUT_RUNS_JOB_ENDPOINT = ("GET", "2.1/jobs/runs/get-output")
CANCEL_ALL_RUNS_ENDPOINT = ("POST", "2.1/jobs/runs/cancel-all")

INSTALL_LIBS_ENDPOINT = ("POST", "2.0/libraries/install")
UNINSTALL_LIBS_ENDPOINT = ("POST", "2.0/libraries/uninstall")
UPDATE_REPO_ENDPOINT = ("PATCH", "2.0/repos/")
DELETE_REPO_ENDPOINT = ("DELETE", "2.0/repos/")
CREATE_REPO_ENDPOINT = ("POST", "2.0/repos")

LIST_JOBS_ENDPOINT = ("GET", "2.1/jobs/list")
LIST_PIPELINES_ENDPOINT = ("GET", "2.0/pipelines")
LIST_SQL_ENDPOINTS_ENDPOINT = ("GET", "2.0/sql/endpoints")

WORKSPACE_GET_STATUS_ENDPOINT = ("GET", "2.0/workspace/get-status")

SPARK_VERSIONS_ENDPOINT = ("GET", "2.0/clusters/spark-versions")
SQL_STATEMENTS_ENDPOINT = "2.0/sql/statements"


class RunLifeCycleState(Enum):
    """
    Enum for the run life cycle state concept of Databricks runs.

    See more information at: https://docs.databricks.com/api/azure/workspace/jobs/listruns#runs-state-life_cycle_state
    """

    BLOCKED = "BLOCKED"
    INTERNAL_ERROR = "INTERNAL_ERROR"
    PENDING = "PENDING"
    QUEUED = "QUEUED"
    RUNNING = "RUNNING"
    SKIPPED = "SKIPPED"
    TERMINATED = "TERMINATED"
    TERMINATING = "TERMINATING"
    WAITING_FOR_RETRY = "WAITING_FOR_RETRY"



Review comment (bug):
This endpoint unfortunately does not exist and I even do think that has been migrated to: https://docs.databricks.com/api/workspace/warehouses/list
```
[2026-01-13 03:32:41] ERROR - Task failed with exception source=task loc=task_runner.py:986
AirflowException: Response: {"error":"Bad Target: /api/2.2/sql/endpoints"}
, Status Code: 404

HTTPError: 404 Client Error: Not Found for url: https://dbc-instance-random.cloud.databricks.com/api/2.2/sql/endpoints

File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 704 in _do_api_call
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 445 in __iter__
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 378 in iter
File "/home/airflow/.local/lib/python3.12/site-packages/tenacity/__init__.py", line 400 in <lambda>
File "/usr/python/lib/python3.12/concurrent/futures/_base.py", line 449 in result
File "/usr/python/lib/python3.12/concurrent/futures/_base.py", line 401 in __get_result
File "/home/airflow/.local/lib/python3.12/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 723 in _do_api_call
File "/home/airflow/.local/lib/python3.12/site-packages/requests/models.py", line 1026 in raise_for_status
```

Previous version `api/2.0/sql/endpoints` works is there even though is not listed in the Databricks documentation.

Code after:
GET_CLUSTER_ENDPOINT = ("GET", "2.2/clusters/get")
RESTART_CLUSTER_ENDPOINT = ("POST", "2.2/clusters/restart")
START_CLUSTER_ENDPOINT = ("POST", "2.2/clusters/start")
TERMINATE_CLUSTER_ENDPOINT = ("POST", "2.2/clusters/delete")

CREATE_ENDPOINT = ("POST", "2.2/jobs/create")
RESET_ENDPOINT = ("POST", "2.2/jobs/reset")
UPDATE_ENDPOINT = ("POST", "2.2/jobs/update")
RUN_NOW_ENDPOINT = ("POST", "2.2/jobs/run-now")
SUBMIT_RUN_ENDPOINT = ("POST", "2.2/jobs/runs/submit")
GET_RUN_ENDPOINT = ("GET", "2.2/jobs/runs/get")
CANCEL_RUN_ENDPOINT = ("POST", "2.2/jobs/runs/cancel")
DELETE_RUN_ENDPOINT = ("POST", "2.2/jobs/runs/delete")
REPAIR_RUN_ENDPOINT = ("POST", "2.2/jobs/runs/repair")
OUTPUT_RUNS_JOB_ENDPOINT = ("GET", "2.2/jobs/runs/get-output")
CANCEL_ALL_RUNS_ENDPOINT = ("POST", "2.2/jobs/runs/cancel-all")

INSTALL_LIBS_ENDPOINT = ("POST", "2.2/libraries/install")
UNINSTALL_LIBS_ENDPOINT = ("POST", "2.2/libraries/uninstall")
UPDATE_REPO_ENDPOINT = ("PATCH", "2.2/repos/")
DELETE_REPO_ENDPOINT = ("DELETE", "2.2/repos/")
CREATE_REPO_ENDPOINT = ("POST", "2.2/repos")

LIST_JOBS_ENDPOINT = ("GET", "2.2/jobs/list")
LIST_PIPELINES_ENDPOINT = ("GET", "2.2/pipelines")
LIST_SQL_ENDPOINTS_ENDPOINT = ("GET", "2.2/sql/endpoints")

WORKSPACE_GET_STATUS_ENDPOINT = ("GET", "2.2/workspace/get-status")

SPARK_VERSIONS_ENDPOINT = ("GET", "2.2/clusters/spark-versions")
SQL_STATEMENTS_ENDPOINT = "2.2/sql/statements"


class RunLifeCycleState(Enum):
    """
    Enum for the run life cycle state concept of Databricks runs.

    See more information at: https://docs.databricks.com/api/azure/workspace/jobs/listruns#runs-state-life_cycle_state
    """

    BLOCKED = "BLOCKED"
    INTERNAL_ERROR = "INTERNAL_ERROR"
    PENDING = "PENDING"
    QUEUED = "QUEUED"
    RUNNING = "RUNNING"
    SKIPPED = "SKIPPED"
    TERMINATED = "TERMINATED"
    TERMINATING = "TERMINATING"
    WAITING_FOR_RETRY = "WAITING_FOR_RETRY"