Utilities
Calendar, weather, and location services.
Overview
Utility services provide supporting functionality:
| Service | Port | Purpose |
|---|---|---|
| calendar_service | 8217 | Events, scheduling, sync |
| weather_service | 8218 | Weather data, forecasts |
| location_service | 8224 | Geolocation, geofencing |
Calendar Service (8217)
Create Event
curl -X POST "http://localhost:8217/api/v1/calendar/events" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Team Meeting",
"start_time": "2024-01-29T10:00:00Z",
"end_time": "2024-01-29T11:00:00Z",
"location": "Conference Room A",
"recurrence": {
"type": "weekly",
"days": ["monday"]
}
}'Sync with External Calendar
curl -X POST "http://localhost:8217/api/v1/calendar/sync" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"provider": "google",
"access_token": "google_oauth_token",
"sync_direction": "bidirectional"
}'Recurrence Types
| Type | Description |
|---|---|
daily | Every day |
weekly | Weekly on specific days |
monthly | Monthly on date or day |
yearly | Yearly on date |
Weather Service (8218)
Get Current Weather
curl "http://localhost:8218/api/v1/weather/current?lat=37.7749&lon=-122.4194" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Get Weather Forecast
curl "http://localhost:8218/api/v1/weather/forecast?lat=37.7749&lon=-122.4194&days=7" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Weather Conditions
| Condition | Description |
|---|---|
sunny | Clear sky |
partly_cloudy | Partial clouds |
cloudy | Overcast |
rain | Rain |
snow | Snow |
thunderstorm | Thunderstorm |
Location Service (8224)
Report Location
curl -X POST "http://localhost:8224/api/v1/locations/report" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"latitude": 37.7749,
"longitude": -122.4194,
"accuracy": 10,
"method": "gps"
}'Create Geofence
curl -X POST "http://localhost:8224/api/v1/geofences" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Home",
"shape": "circle",
"center": {"latitude": 37.7749, "longitude": -122.4194},
"radius": 100,
"triggers": ["enter", "exit"]
}'Geofence Triggers
| Trigger | Description |
|---|---|
enter | Device enters geofence |
exit | Device exits geofence |
dwell | Device stays for specified time |
Python SDK
from isa_user import CalendarClient, WeatherClient, LocationClient
# Calendar
calendar = CalendarClient("http://localhost:8217")
event = await calendar.create_event(
token=access_token,
title="Team Meeting",
start_time="2024-01-29T10:00:00Z",
end_time="2024-01-29T11:00:00Z"
)
# Weather
weather = WeatherClient("http://localhost:8218")
current = await weather.get_current(
token=access_token,
lat=37.7749,
lon=-122.4194
)
# Location
location = LocationClient("http://localhost:8224")
geofence = await location.create_geofence(
token=access_token,
name="Home",
center={"lat": 37.7749, "lon": -122.4194},
radius=100
)Next Steps
- Devices - IoT management
- Operations - Tasks & events
- Security - Vault & secrets