Beispiel #1
0
    def get(self):
        """
        ---
        summary: List
        description: List the full configuration.
        tags:
          - Config
        responses:
          200:
            description: OK
            content:
              application/json:
                schema:
                  description: A dict with the sections as keys and a dict with the configuration as value.
                  type: object
          401:
            description: Invalid Auth Token
          406:
            description: Not acceptable
        """
        res = {}
        for section in config.sections(issuer=request.environ.get('issuer'),
                                       vo=request.environ.get('vo')):
            res[section] = {}
            for item in config.items(section,
                                     issuer=request.environ.get('issuer'),
                                     vo=request.environ.get('vo')):
                res[section][item[0]] = item[1]

        return jsonify(res), 200
Beispiel #2
0
    def GET(self):
        """
        List full configuration.

        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
        """

        header('Content-Type', 'application/json')

        res = {}
        for section in config.sections(issuer=ctx.env.get('issuer')):
            res[section] = {}
            for item in config.items(section, issuer=ctx.env.get('issuer')):
                res[section][item[0]] = item[1]

        return json.dumps(res)
Beispiel #3
0
    def get(self):
        """
        List full configuration.

        .. :quickref: Config; List full config.

        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :status 500: Internal Error.
        """

        res = {}
        for section in config.sections(issuer=request.environ.get('issuer')):
            res[section] = {}
            for item in config.items(section,
                                     issuer=request.environ.get('issuer')):
                res[section][item[0]] = item[1]

        return Response(json.dumps(res), content_type="application/json")
Beispiel #4
0
    def GET(self):
        """
        List full configuration.

        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
        """

        header('Content-Type', 'application/json')

        res = {}
        for section in config.sections(issuer=ctx.env.get('issuer')):
            res[section] = {}
            for item in config.items(section, issuer=ctx.env.get('issuer')):
                res[section][item[0]] = item[1]

        return json.dumps(res)
Beispiel #5
0
    def get(self):
        """
        List full configuration.

        .. :quickref: Config; List full config.

        :resheader Content-Type: application/json
        :status 200: OK.
        :status 401: Invalid Auth Token.
        :status 406: Not Acceptable.
        """
        res = {}
        for section in config.sections(issuer=request.environ.get('issuer'),
                                       vo=request.environ.get('vo')):
            res[section] = {}
            for item in config.items(section,
                                     issuer=request.environ.get('issuer'),
                                     vo=request.environ.get('vo')):
                res[section][item[0]] = item[1]

        return jsonify(res), 200