Action API - aaronwmorris/indi-allsky GitHub Wiki
Action API Reference
The Action API permits remote management and automation systems (such as Home Assistant, Node-RED, or shell scripts) to control indi-allsky execution states using authenticated HTTP POST requests.
Action requests operate asynchronously: the API validates credentials and enqueues a priority task into the daemon's internal taskqueue table (IndiAllSkyDbTaskQueueTable). The daemon executes the task on the subsequent loop iteration.
Authentication & Network Access Controls
Every request must satisfy two strict security requirements:
- User Credentials:
- The request payload must contain valid credentials for an administrative account (
is_admin=TrueinIndiAllSkyDbUserTable). Passwords are verified using Argon2 hashing.
- The request payload must contain valid credentials for an administrative account (
- Admin Network Restriction:
- The requesting client's IP address must reside within the CIDR subnets defined by
ADMIN_NETWORKSin/etc/indi-allsky/flask.json:
Requests arriving from unauthorized IP addresses receive an HTTP 400"ADMIN_NETWORKS": [ "127.0.0.1/32", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" ]permission deniedresponse. - The requesting client's IP address must reside within the CIDR subnets defined by
Endpoints
| Endpoint | Method | Action | HTTP Response Codes |
|---|---|---|---|
/indi-allsky/action/pause |
POST |
Pauses camera image acquisition. | 201 Created: Pause task enqueued.200 OK: Capture was already paused.400 Bad Request: Authentication or network authorization failure. |
/indi-allsky/action/unpause |
POST |
Resumes camera image acquisition. | 201 Created: Unpause task enqueued.200 OK: Capture was already active.400 Bad Request: Authentication or network authorization failure. |
Request Format & Examples
JSON Payload
All requests require the Content-Type: application/json header and a JSON body containing administrative credentials:
{
"username": "admin",
"password": "your_secure_password"
}
cURL Invocation
# Pause capture
curl -s -X POST \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "your_secure_password"}' \
https://allsky.local/indi-allsky/action/pause
# Resume capture
curl -s -X POST \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "your_secure_password"}' \
https://allsky.local/indi-allsky/action/unpause