Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 05:53 AM
Hi @prathameshJoshi,
I was able to get the API url using this piece of code and is working on my browser.
Not sure how to authenticate while making calls programmatically.
from databricks_api import DatabricksAPI
from dbruntime.databricks_repl_context import get_context
databricks_api_instance = DatabricksAPI(
host=get_context().apiUrl,
token=get_context().apiToken,
)
host = get_context().browserHostName
cluster_id = get_context().clusterId
spark_context_id = databricks_api_instance.cluster.get_cluster(get_context().clusterId)['spark_context_id']
spark_ui_api_url = f"https://{host}/sparkui/{cluster_id}/driver-{spark_context_id}/api/v1/"
endpoint = 'applications'
print(spark_ui_api_url + endpoint)