Welcome to cdrouter.py’s documentation!¶
Introduction¶
cdrouter is a simple Python wrapper for the CDRouter Web API. https://support.qacafe.com/cdrouter-web-api/
For more information on CDRouter, please visit http://www.qacafe.com/.
Usage¶
import time
import cdrouter
from cdrouter.jobs import Job
cdr = cdrouter.Service('http://localhost:8015', token='deadbeef')
for p in cdr.packages.list(filter=['tags@>{noretry}'], limit='none'):
print 'Launching package ' + p.name
j = cdr.jobs.launch(Job(package_id=p.id, extra_cli_args='-testvar myvar=example'))
while j.result_id == None:
time.sleep(1)
j = cdr.jobs.get(j.id)
print ' Result-ID: ' + j.result_id
print 'done.'
Reference¶
cdrouter¶
Python client for the CDRouter Web API.
cdrouter.Service¶
-
class
cdrouter.
Service
(base, token, insecure=False)¶ Service for accessing the CDRouter Web API.
-
bulk_copy
(base, resource, ids, schema)¶ Send an authorized POST request to bulk copy a set of resources.
-
bulk_delete
(base, resource, ids=None, filter=None, all=False)¶ Send an authorized POST request to bulk delete a set of resources.
-
bulk_edit
(base, resource, fields, ids=None, filter=None, all=False, testvars=None)¶ Send an authorized POST request to bulk edit a set of resources.
-
bulk_export
(base, ids, params=None)¶ Send an authorized GET request to bulk export a set of resources.
-
create
(base, resource)¶ Send an authorized POST request to create a new resource.
-
delete
(path, params=None)¶ Send an authorized DELETE request.
-
delete_id
(base, id)¶ Send an authorized DELETE request to delete a resource by ID.
-
edit
(base, id, resource)¶ Send an authorized PATCH request to edit a resource.
Send an authorized PATCH request to edit a resource’s shares.
-
export
(base, id, format='gz', params=None)¶ Send an authorized GET request to export a resource.
-
get
(path, params=None, stream=None)¶ Send an authorized GET request.
-
get_id
(base, id, params=None)¶ Send an authorized GET request to get a resource by ID.
Send an authorized GET request to get a resource’s shares.
-
list
(base, filter=None, sort=None, limit=None, page=None, format=None)¶ Send an authorized GET request for a collection.
-
patch
(path, json, params=None)¶ Send an authorized PATCH request.
-
post
(path, json=None, data=None, params=None, files=None)¶ Send an authorized POST request.
-