title: How to handle multiple 'GET' endpoints in a Flask-Restplus response class
body: <p>I'm just starting learning Flask and are trying to create a simple API dealing with a data processing backend (named ATExplorer).</p>
  
  <p>I started by creating a 'backend' namespace, i.e. backendAPI:</p>
  
  <pre><code>from flask import Flask, Blueprint, redirect, url_for
  from flask_restplus import Resource, Api
  from werkzeug.routing import Rule
  
  app = Flask(__name__)
  app.config.SWAGGER_UI_DOC_EXPANSION = 'list'
  blueprint = Blueprint('api', __name__, url_prefix='/api')
  api = Api(blueprint, version=0.1, title='AT Pipeline API', doc='/swagger/')
  app.register_blueprint(blueprint)
  backendAPI = api.namespace('backend', description='Manage ATExplorer backend API.')
  </code></pre>
  
  <p>I want two endpoints, <em>version</em>, returning the version of the backend, e.g. 0.1 and <em>status</em>, returning the status of the backend, e.g. 'stopped', or 'running'</p>
  
  <p>I created a response class and routes like this:</p>
  
  <pre><code>@backendAPI.route('/version', methods=['GET'])
  @backendAPI.route('/status',  methods=['GET'])
  
  class Backend(Resource):
  
       def get(self):
          #How to differentiate between the ../backend/version call and a 
          # ../backend/status call here??
          #if call is for status:
          #     return {'status': 'running'}
          #elif call is for version
          #     return {'version': '0.1'}
  </code></pre>
  
  <p>Guess this is a question of design. What 'design' is preferable for this case?</p>
  
  <p>---- EDIT -----
  The above code can be rewritten, achieving a desired end (client) result by the following:</p>
  
  <pre><code>class Backend(Resource):
      def __init__(self, api=None, *args, **kwargs):
           #The 'actual' backend resource
           self.backend = atp.backend
  
  @backend_api.route('/status',  methods=['GET'])
  class Dummy(Backend):
       def get(self):
           return {'status':self.backend.getStatus()}
  
  @backend_api.route('/version',  methods=['GET'])
  class Dummy(Backend):
       def get(self):
           return {'status':self.backend.getVersion()}
  </code></pre>
  
  <p>It seem flask allow multiple classes with the same name, doing different things based on the 'route' decorator, i.e. the class name is <strong>irrelevant</strong>. </p>
  
  <p>Is there a 'text-book' way to express the above logic?</p>