-
Notifications
You must be signed in to change notification settings - Fork 1
API Documentation
MariusDanner edited this page Mar 25, 2020
·
3 revisions
A Swagger documentation of our REST endpoints is available using
http://backend-deployment:5000/static/swagger/index.html
given default host and port settings.
A deployed version of our documentation is available here.
We use flask-restful-swagger-2 that adds swagger support to our Flask app according to the swagger 2.0 specification.
Therefore it is really easy to document the newly created endpoint right in the code as you can see in the following example:
class EdgeResource(Resource):
@swagger.doc({
'description': 'Returns a single edge',
'parameters': [
{
'name': 'edge_id',
'description': 'Edge identifier',
'in': 'path',
'type': 'integer',
'required': True
}
],
'responses': get_default_response(EdgeSchema.get_swagger()),
'tags': ['Edge']
})
def get(self, edge_id):
edge = Edge.query.get_or_404(edge_id)
return marshal(EdgeSchema, edge)
The responses are automatically created by get_default_response
(imported from src.master.helpers.swagger
)
- Home
- Setup
- API Documentation
- Data model
- How to...
- ...add a new remote database
- ...create migrations
- ...develop locally
- ...simplified dev setup
- ...deploy on kubernetes (internal)
- ...monitor the cluster
- ...fix expired K8s certificates
- ...add new dependencies
- ...rebuild base image
- ...add a new algorithm in R
- ...add support for new language
- ...add a new node to Kubernetes cluster
- Coding Conventions
- Roadmap
- Ownership