Example #1
0
 def get(self):
   from ggrc import services
   endpoints = {}
   for entry in services.all_services():
     service = getattr(services, entry.model_class.__name__)
     endpoints[service.__name__] = {
         'href': service.url_for(),
         # TODO additional fields
         # 'discoveryVersion': '',
         # 'id': '',
         # 'name': '',
         # 'version': '',
         # 'title': '',
         # 'description': '',
         # 'documentationLink': '',
     }
   endpoints['search'] = {'href': '/search'}
   endpoints['log_event'] = {'href': '/api/log_events'}
   return self.json_success_response({
       'service_description': {
           'name': 'GGRC-Core',
           'endpoints': endpoints,
           'selfLink': request.url,
           # TODO additional fields
           # 'id': '',
           # 'title': '',
           # 'description': '',
           # 'documentationLink': '',
       },
   })
Example #2
0
 def collect(cls):
   """Collects all application services."""
   from ggrc.services import all_services
   return all_services()