Skip to main content

restfull rql edition capabilities

Project description

Summary

Controller that gives users rql read/ write capabilities. To have token authentication, install cubicweb_signedrequest.

Sample usage

Users of this service must perform a HTTP POST request to its endpoint, that is the base url of the CubicWeb application instance appended with the “rqlio/1.0” url path.

The posted data must use the application/json or multipart/form-data. For the application/json MIME type, the posted data must contain a list of pairs of the form (rql_string, rql_args), where:

  • rql_string is any valid RQL query that may contain mapping keys with their usual form

  • rql_args is a dictionary, whose keys are the mapping keys from rql_string, and the values can be:

    • actual values

    • string references to a previous RQL query’s result, with the assumption that the referenced RQL query returns a single line and single column rset; under such conditions, a string reference must be “__rXXX” where XXX is the (0-based) index of the RQL query in the json-encoded list of queries.

The HTTP request’s response (in case where there is no error), is a json-encoded list. Its length is the number of RQL queries in the request, and each element contains the json-encoded result set rows from the corresponding query.

In case of an error, a json object with a reason key will explain the problem.

Python client example using python-requests:

import requests
import json

args = [('INSERT CWUser U: U login %(l)s, U upassword %(p)s',
        {'l': 'Babar', 'p': 'cubicweb rulez & 42'}),

       ('INSERT CWGroup G: G name "pachyderms"', {}),

       ('SET U in_group G WHERE U eid %(u)s, G eid %(g)s',
        {'u': '__r0', 'g': '__r1'})
       ]

resp = requests.post('https://myinstance.example.com/rqlio/1.0'),
                     data=json.dumps(args),
                     headers={'Content-Type': 'application/json'})
assert resp.status_code == 200

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubicweb-rqlcontroller-1.0.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

cubicweb_rqlcontroller-1.0.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file cubicweb-rqlcontroller-1.0.0.tar.gz.

File metadata

File hashes

Hashes for cubicweb-rqlcontroller-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1edd8784a1bcfa54e83b6233410a7848efa9f2f8a490698c5f459c99dd9f79d9
MD5 74fa69eebaeff44b121c1735a4e166d0
BLAKE2b-256 970518935f0ff4d72ab34e811415a077c9ecaf581eb1c17085dc04513eb549f9

See more details on using hashes here.

File details

Details for the file cubicweb_rqlcontroller-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cubicweb_rqlcontroller-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6c0a6723f2f1a021997c92b909739ef1e1d385b3ad35715f9fb57ee63638f4
MD5 4144c8ac4465ce6515b7fd7dc8ab4bdf
BLAKE2b-256 6d0fb3fa58ee2b32ab18d2b937e7b6c76ced7bdcc2f6d6c28cc50d32df44d448

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page