Example #1
0
    def get(self, key):
        """
        .. http:get:: /analysis
          The current list of analysiss

          **Example request**:
          .. sourcecode:: http
             GET /analysis HTTP/1.1
             Host: example.com
             Accept: application/json, text/javascript

          **Example response**:
          .. sourcecode:: http
             HTTP/1.1 200 OK
             Vary: Accept
             Content-Type: text/javascript

             # TODO

          :statuscode 200: no error
          :statuscode 403: unauthenticated
        """
        plugin_slug = current_app.config['DIFFY_PERSISTENCE_PLUGIN']
        p = plugins.get(plugin_slug)
        return p.get('analysis', key)
Example #2
0
    def get(self, key):
        """
        .. http:get:: /analysis
          The current list of analysiss

          **Example request**:
          .. sourcecode:: http
             GET /analysis HTTP/1.1
             Host: example.com
             Accept: application/json, text/javascript

          **Example response**:
          .. sourcecode:: http
             HTTP/1.1 200 OK
             Vary: Accept
             Content-Type: text/javascript

             # TODO

          :statuscode 200: no error
          :statuscode 403: unauthenticated
        """
        plugin_slug = current_app.config['DIFFY_PERSISTENCE_PLUGIN']
        p = plugins.get(plugin_slug)
        return p.get('analysis', key)
Example #3
0
    def get(self):
        """
        .. http:get:: /baselines
          The current list of baselines

          **Example request**:
          .. sourcecode:: http
             GET /baselines HTTP/1.1
             Host: example.com
             Accept: application/json, text/javascript

          **Example response**:
          .. sourcecode:: http
             HTTP/1.1 200 OK
             Vary: Accept
             Content-Type: text/javascript

             # TODO

          :statuscode 200: no error
          :statuscode 403: unauthenticated
        """
        data = plugins.get(
            current_app.config["DIFFY_PERSISTENCE_PLUGIN"]).get_all("baseline")
        return data, 200
Example #4
0
    def get(self, key):
        """
        .. http:get:: /baselines
          The current list of baselines

          **Example request**:
          .. sourcecode:: http
             GET /baselines HTTP/1.1
             Host: example.com
             Accept: application/json, text/javascript

          **Example response**:
          .. sourcecode:: http
             HTTP/1.1 200 OK
             Vary: Accept
             Content-Type: text/javascript

             # TODO

          :statuscode 200: no error
          :statuscode 403: unauthenticated
        """
        return plugins.get(current_app.config["DIFFY_PERSISTENCE_PLUGIN"]).get(
            "baseline", key
        )
Example #5
0
def resolve_plugin_slug(slug):
    """Attempts to resolve plugin to slug."""
    plugin = plugins.get(slug)

    if not plugin:
        raise ValidationError(f'Could not find plugin. Slug: {slug}')

    return plugin
Example #6
0
def resolve_plugin_slug(slug):
    """Attempts to resolve plugin to slug."""
    plugin = plugins.get(slug)

    if not plugin:
        raise ValidationError(f'Could not find plugin. Slug: {slug}')

    return plugin