This repo is archived. See http://github.com/waggle-sensor/edge-scheduler
SAGE Edge Scheduler
This is a mock API for the Sage Edge Scheduler (SES).
SAGE users authenticate via token they can get from the SAGE website.
example:
-H "Authorization: sage <sage_user_token>"
for test environment:
-H "Authorization: sage user:test"
docker-compose up
This starts a test environment without token verification.
To test the API:
export SES_URL="localhost:8080"
export SAGE_USER_TOKEN=user:testuser
To get stats of SES:
curl -X GET "${SES_URL}/api/v1/metrics" -H "Authorization: sage ${SAGE_USER_TOKEN}"
To get a list of goals:
curl -X GET "${SES_URL}/api/v1/goals" -H "Authorization: sage ${SAGE_USER_TOKEN}"
To take a goal to be added:
curl -X POST "${SES_URL}/api/v1/goals?name=mygoal" -H "Authorization: sage ${SAGE_USER_TOKEN}"
example response:
{
"id": "0000000001",
"name": "mygoal",
"owner": "testuser"
}
to do the following:
export GOAL_ID=0000000001
to get the current status of a goal:
curl -X GET "${SES_URL}/api/v1/goals/${GOAL_ID}/status" -H "Authorization: sage ${SAGE_USER_TOKEN}"
to take a status of a goal to be added (e.g., SUBMITTED, SUSPENDED, SCHEDULED, ACTIVATED, DONE):
curl -X POST "${SES_URL}/api/v1/goals/${GOAL_ID}/status?status=scheduled" -H "Authorization: sage ${SAGE_USER_TOKEN}"
to get stats of goals:
curl -X GET "${SES_URL}/api/v1/goals/metrics" -H "Authorization: sage ${SAGE_USER_TOKEN}"