Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2025 07:13 AM
use this code to view all active jobs. But use a token that is admin to the workspace.
%python
import requests
import json
# Replace these variables with your specific values
databricks_instance = 'your-workspace-url'
token = 'use an admin token'
# Define the API endpoint
url = f'https://{databricks_instance}/api/2.0/jobs/runs/list'
# Define the parameters
params = {
'active_only': 'true'
}
# Define the headers
headers = {
'Authorization': f'Bearer {token}'
}
# Make the GET request
response = requests.get(url, headers=headers, params=params)
# Check if the request was successful
if response.status_code == 200:
# Parse the JSON response
data = response.json()
# Print the active job runs
print(json.dumps(data, indent=4))
else:
print(f'Error: {response.status_code}')
print(response.text)