Example #1
0
            self.session, self.username)

        body = buildPayload('application/json', recentActivity)
        request.setHeader('Content-length', str(len(body)))
        request.setHeader('Content-type', 'application/json')
        request.setResponseCode(http.OK)
        returnValue(body)

# API DOCUMENTATION

# GET on  /recent
topLevel = HTTPTopLevel('recent', 'GET')
topLevel.description = dedent("""
    The GET method on recent is used to retrieve information about the latest
    updated tag values on a given object or user.""")
registry.register(topLevel)

# GET on /recent/objects
usage = HTTPUsage('/objects', dedent("""
    To request information on the latest tag values on the objects returned by
    a given query"""))
usage.resourceClass = RecentObjectsActivityResource
usage.addArgument(Argument(
    'query',
    dedent("""
    A query string specifying what sorts of objects to get recent activity for.
    The query language is described <a
    href="http://doc.fluidinfo.com/fluidDB/queries.html">here</a>. You must
    convert your query to UTF-8 and then <a href="http://en.wikipedia.org/wiki
    /Percent-encoding">
     percent-encode</a> it before adding it to the request URI
Example #2
0
        yield self.facadeClient.deleteValuesForQuery(self.session, query, tags)
        request.setResponseCode(usage.successCode)
        defer.returnValue(None)


# ------------------------------ Values GET -----------------------------
topLevel = HTTPTopLevel(httpValueCategoryName, 'GET')

topLevel.description = """The GET method on values is used to retrieve
    tag values from objects matching a query."""

# We could here mention
# href="http://doc.fluidinfo.com/fluidDB/api/draft-values-spec.html">
# /values draft spec</a>.

registry.register(topLevel)

# --- GET /values --------------------------------------------------------

usage = HTTPUsage(
    '', """Search for objects matching a Fluidinfo query, and return the
           value of the requested tags on the matching objects.""")
usage.resourceClass = ValuesResource
topLevel.addUsage(usage)

usage.addArgument(
    Argument(queryArg,
             '''A query string specifying what objects to match. The
       Fluidinfo query language is described
       <a href="http://doc.fluidinfo.com/fluidDB/queries.html">here</a>.''',
             'string',