Skip to content

Commit

Permalink
Add documentation to dirac endpoint : Closes rucio#3971
Browse files Browse the repository at this point in the history
  • Loading branch information
cserf committed Oct 21, 2020
1 parent 2d6921b commit eaebc1c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions doc/source/restapi/dirac.rst
@@ -0,0 +1,12 @@
Dirac Rest API
================

**Overview**

.. qrefflask:: rucio.web.rest.flaskapi.v1.dirac:make_doc()
:undoc-static:

**Details**

.. autoflask:: rucio.web.rest.flaskapi.v1.dirac:make_doc()
:undoc-static:
11 changes: 9 additions & 2 deletions lib/rucio/web/rest/flaskapi/v1/dirac.py
Expand Up @@ -21,7 +21,7 @@

from traceback import format_exc

from flask import Blueprint, request
from flask import Flask, Blueprint, request
from flask.views import MethodView

from rucio.api.dirac import add_files
Expand Down Expand Up @@ -90,7 +90,7 @@ def post(self):
return 'Created', 201


def blueprint():
def blueprint(no_doc=True):
bp = Blueprint('dirac', __name__, url_prefix='/dirac')

add_file_view = AddFiles.as_view('addfiles')
Expand All @@ -100,3 +100,10 @@ def blueprint():
bp.before_request(request_auth_env)
bp.after_request(response_headers)
return bp


def make_doc():
""" Only used for sphinx documentation """
doc_app = Flask(__name__)
doc_app.register_blueprint(blueprint(no_doc=False))
return doc_app

0 comments on commit eaebc1c

Please sign in to comment.