Coder Social home page Coder Social logo

sage-ses's Introduction

sage-ses

SAGE Edge Scheduler

SAGE SES API

This is a mock API for the Sage Edge Scheduler (SES).

Authentication

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"

Start-up

docker-compose up

This starts a test environment without token verification.

CURL to GET and POST

To test the API:

export SES_URL="localhost:8080"
export SAGE_USER_TOKEN=user:testuser

/api/v1/metrics (to be completed)

To get stats of SES:

curl -X GET "${SES_URL}/api/v1/metrics"  -H "Authorization: sage ${SAGE_USER_TOKEN}"

/api/v1/goals

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

/api/v1/goals/{id}/status

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}"

/api/v1/goals/metrics

to get stats of goals:

curl -X GET "${SES_URL}/api/v1/goals/metrics"  -H "Authorization: sage ${SAGE_USER_TOKEN}"

sage-ses's People

Contributors

jswantek avatar wgerlach avatar hkim-dev avatar

Watchers

Scott Collis avatar James Cloos avatar Rajesh Sankaran avatar  avatar

Forkers

hkim-dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.