Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we want a JSON API? #66

Closed
JanKoppe opened this issue Feb 28, 2017 · 6 comments
Closed

Do we want a JSON API? #66

JanKoppe opened this issue Feb 28, 2017 · 6 comments
Assignees
Milestone

Comments

@JanKoppe
Copy link
Contributor

Looking at the new UI, we could easily leverage the internal state agent to provide detailed information about the capture agent. A neat way to do that would be to expose the states via a simple API that can also be used in monitoring. A simple /status.json would be a good start.

Thinking further, one might want to be able to manually start and stop recording remotely, because scheduling via Opencast is not comfortable if you don't know how long you actually want to record for yet.

My gut instinct would be to do it right the first time and build a small and simple JSON API (https://jsonapi.org). But this would again increase the scope, but also the functionality of pyCA.

So, do we want this?

@JanKoppe
Copy link
Contributor Author

JanKoppe commented Mar 6, 2017

Meeting with Lars via Appear.in: Yes, we should do that. Milestone 2.0

@JanKoppe JanKoppe added this to the 2.0 milestone Mar 6, 2017
@JanKoppe JanKoppe self-assigned this Mar 6, 2017
@JanKoppe JanKoppe mentioned this issue Mar 6, 2017
@lkiesow lkiesow modified the milestones: 2.1, 2.0 Mar 6, 2017
@lkiesow
Copy link
Member

lkiesow commented Mar 6, 2017

You should be able to use jsonify to easily solve this:

from flask import jsonify

@app.route('/api')
def summary():
    …
    return jsonify(data)

@lkiesow
Copy link
Member

lkiesow commented Mar 6, 2017

Maybe generate data in a separate method which we can use for home() as well to minimize code duplication.

@JanKoppe
Copy link
Contributor Author

JanKoppe commented Mar 10, 2017

Yes, I'm building a /api/internal_state endpoint as well as /api/event, which will return the events. This would probably reduce the UI to a static file with some jQuery or similar to retrieve & update data.

Probably won't get this done in time, so this will go in with 2.1 probably.

@JanKoppe
Copy link
Contributor Author

Work on this is happening in #73.

@lkiesow
Copy link
Member

lkiesow commented Dec 15, 2018

Fixed by #73

@lkiesow lkiesow closed this as completed Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants