Example #1
0
               title='Vira-lata',
               description='An authentication microservice.')

api.update_parser_arguments({
    'username': {
        'location': 'json',
        'help': 'The username.',
    },
    'password': {
        'location': 'json',
        'help': 'The password.',
    },
    'new_password': {
        'location': 'json',
        'help': 'A new password, when changing the current one.',
    },
    'code': {
        'location': 'json',
        'help': 'A temporary code used to reset the password.',
    },
    'email': {
        'location': 'json',
        'help': 'The email.',
    },
    'description': {
        'location': 'json',
        'help': 'The user description.',
    },
})


@api.route('/login/external/manual/<string:backend>')
Example #2
0
from models import Comment, Thread, Author
from extensions import db, sv


api = ExtraApi(version='1.0',
               title='Tagarela!',
               description='A commenting microservice. All non-get operations '
               'require a micro token.')

api.update_parser_arguments({
    'text': {
        'location': 'json',
        'help': 'The text for the comment.',
    },
    'vote': {
        'location': 'json',
        'type': bool,
        'help': 'Use "true" for a upvote, "false" for a downvote.',
    },
})


@api.route('/thread/<string:thread_name>')
class ThreadAPI(Resource):

    def get(self, thread_name):
        '''Get comments from a thread.'''
        return get_thread_comments(thread_name=thread_name)

    @api.doc(parser=api.create_parser('token', 'text'))
Example #3
0
from extensions import db, sv


api = ExtraApi(version='1.0',
               title='EsicLivre',
               description='A microservice for eSIC interaction. All non-get '
               'operations require a micro token.')

api.update_parser_arguments({
    'text': {
        'location': 'json',
        'help': 'The text for the pedido.',
    },
    'orgao': {
        'location': 'json',
        'help': 'Orgao that should receive the pedido.',
    },
    'keywords': {
        'location': 'json',
        'type': list,
        'help': 'Keywords to tag the pedido.',
    },
})


@api.route('/orgaos')
class ListOrgaos(Resource):

    def get(self):
        '''List orgaos.'''
        return {