Create Data Source
Create a new data source status entry.
Request Body
Unique identifier (auto-generated if not provided)
Type of data source (e.g., “windows”, “linux”, “firewall”)
Human-readable name of the data source
Whether the data source is active
Last data received timestamp (ISO 8601 format)
Number of events received
curl -X POST https://your-utmstack-instance.com/api/utm-data-input-statuses \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"dataType": "firewall",
"dataTypeName": "Palo Alto Firewall",
"status": true,
"eventsCount": 0
}'
{
"id": "firewall-logs-002",
"dataType": "firewall",
"dataTypeName": "Palo Alto Firewall",
"status": true,
"timestamp": "2024-01-15T10:35:00Z",
"eventsCount": 0
}
Update Data Source
Update an existing data source.
Request Body
Data source identifier to update
curl -X PUT https://your-utmstack-instance.com/api/utm-data-input-statuses \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
-H "Content-Type: application/json" \
-d '{
"id": "firewall-logs-002",
"dataType": "firewall",
"dataTypeName": "Palo Alto Firewall - Updated",
"status": true,
"eventsCount": 1250
}'
{
"id": "firewall-logs-002",
"dataType": "firewall",
"dataTypeName": "Palo Alto Firewall - Updated",
"status": true,
"timestamp": "2024-01-15T10:40:00Z",
"eventsCount": 1250
}
Delete Data Source
Delete a data source status entry.
Path Parameters
Data source identifier to delete
curl -X DELETE https://your-utmstack-instance.com/api/utm-data-input-statuses/firewall-logs-002 \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..."
Configuration Best Practices
Status Updates
Update data source status regularly to monitor health:
import requests
from datetime import datetime
def update_source_heartbeat(source_id, events_count):
url = f"https://your-utmstack-instance.com/api/utm-data-input-statuses"
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
# Get current source
response = requests.get(f"{url}/{source_id}", headers=headers)
source = response.json()
# Update timestamp and event count
source["timestamp"] = datetime.utcnow().isoformat() + "Z"
source["eventsCount"] = events_count
source["status"] = True
# Save update
response = requests.put(url, headers=headers, json=source)
return response.json()
Monitoring
Monitor data sources for inactivity:
from datetime import datetime, timedelta
def get_inactive_sources(inactive_threshold_minutes=15):
url = "https://your-utmstack-instance.com/api/utm-data-input-statuses"
headers = {"Authorization": "Bearer YOUR_TOKEN"}
params = {"size": 1000}
response = requests.get(url, headers=headers, params=params)
sources = response.json()
threshold = datetime.utcnow() - timedelta(minutes=inactive_threshold_minutes)
inactive = []
for source in sources:
last_seen = datetime.fromisoformat(source["timestamp"].replace("Z", "+00:00"))
if last_seen < threshold:
inactive.append(source)
return inactive