Reference

cdrouter

Python client for the CDRouter Web API.

cdrouter.CDRouter

class cdrouter.CDRouter(base, token=None, 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.

edit_shares(base, id, user_ids)

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.

get_shares(base, id)

Send an authorized GET request to get a resource’s shares.

list(base, filter=None, type=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.

cdrouter.configs.ConfigsService

class cdrouter.configs.ConfigsService(service)

Service for accessing CDRouter Configs.

bulk_copy(ids)

Bulk copy a set of configs.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of configs.

bulk_edit(_fields, ids=None, filter=None, all=False, testvars=None)

Bulk edit a set of configs.

bulk_edit_testvars(id, testvars)

Bulk edit a config’s testvars.

bulk_export(ids)

Bulk export a set of configs.

check_config(contents)

Process config contents with cdrouter-cli -check-config.

create(resource)

Create a new config.

delete(id)

Delete a config.

delete_testvar(id, name, group=None)

Delete a testvar in a config. Deleting a testvar unsets any explicitly configured value for it in the config.

edit(resource)

Edit a config.

edit_shares(id, user_ids)

Edit shares for a config.

edit_testvar(id, resource)

Edit a testvar in a config.

export(id)

Export a config.

get(id, format=None)

Get a config.

get_networks(contents)

Process config contents with cdrouter-cli -print-networks-json.

get_new()

Get output of cdrouter-cli -new-config.

get_plaintext(id)

Get a config as plaintext.

get_shares(id)

Get shares for a config.

get_testvar(id, name, group=None)

Get a testvar from a config.

list(filter=None, sort=None, limit=None, page=None)

Get a list of configs.

list_testvars(id)

Get a list of a config’s testvars.

upgrade_config(contents)

Process config contents with cdrouter-cli -upgrade-config.

cdrouter.devices.DevicesService

class cdrouter.devices.DevicesService(service)

Service for accessing CDRouter Devices.

bulk_copy(ids)

Bulk copy a set of devices.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of devices.

bulk_edit(_fields, ids=None, filter=None, all=False)

Bulk edit a set of devices.

bulk_export(ids)

Bulk export a set of devices.

create(resource)

Create a new device.

delete(id)

Delete a device.

edit(resource)

Edit a device.

edit_shares(id, user_ids)

Edit shares for a device.

export(id)

Export a device.

get(id)

Get a device.

get_shares(id)

Get shares for a device.

list(filter=None, sort=None, limit=None, page=None)

Get a list of devices.

cdrouter.jobs.JobsService

class cdrouter.jobs.JobsService(service)

Service for accessing CDRouter Jobs.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of jobs.

bulk_launch(jobs=None, filter=None, all=False)

Bulk launch a set of jobs.

delete(id)

Delete a job.

edit(resource)

Edit a tag.

get(id)

Get a job.

launch(resource)

Launch a new job.

list(filter=None, sort=None, limit=None, page=None)

Get a list of jobs.

cdrouter.packages.PackagesService

class cdrouter.packages.PackagesService(service)

Service for accessing CDRouter Packages.

analyze(id)

Get a list of tests that will be skipped for a package.

bulk_copy(ids)

Bulk copy a set of packages.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of packages.

bulk_edit(_fields, ids=None, filter=None, all=False)

Bulk edit a set of packages.

bulk_export(ids)

Bulk export a set of packages.

create(resource)

Create a new package.

delete(id)

Delete a package.

edit(resource)

Edit a package.

edit_shares(id, user_ids)

Edit shares for a package.

export(id)

Export a package.

get(id)

Get a package.

get_shares(id)

Get shares for a package.

list(filter=None, sort=None, limit=None, page=None)

Get a list of packages.

cdrouter.results.ResultsService

class cdrouter.results.ResultsService(service)

Service for accessing CDRouter Results.

all_stats()

Compute stats for all results.

bulk_copy(ids)

Bulk copy a set of results.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of results.

bulk_edit(_fields, ids=None, filter=None, all=False)

Bulk edit a set of results.

bulk_export(ids, exclude_captures=False)

Bulk export a set of results.

delete(id)

Delete a result.

download_logdir_archive(id, filename, format='zip', exclude_captures=False)

Download logdir archive in tgz or zip format.

edit(resource)

Edit a result.

edit_shares(id, user_ids)

Edit shares for a result.

export(id, exclude_captures=False)

Export a result.

get(id)

Get a result.

get_logdir_file(id, filename)

Download a logdir file.

get_shares(id)

Get shares for a result.

get_test_metric(id, name, metric, format=None)

Get a test metric.

get_test_metric_csv(id, name, metric)

Get a test metric as CSV.

list(filter=None, sort=None, limit=None, page=None)

Get a list of results.

list_csv(filter=None, sort=None, limit=None, page=None)

Get a list of results as CSV.

list_logdir(id, filter=None, sort=None)

Get a list of logdir files.

pause(id, when=None)

Pause a running result.

pause_end_of_loop(id)

Pause a running result at the end of the current loop.

pause_end_of_test(id)

Pause a running result at the end of the current test.

set_stats(ids)

Compute stats for a set of results.

single_stats(id)

Compute stats for a result.

stop(id, when=None)

Stop a running result.

stop_end_of_loop(id)

Stop a running result at the end of the current loop.

stop_end_of_test(id)

Stop a running result at the end of the current test.

unpause(id)

Unpause a running result.

cdrouter.testresults.TestResultsService

class cdrouter.testresults.TestResultsService(service)

Service for accessing CDRouter TestResults.

edit(id, resource)

Edit a test result.

get(id, seq)

Get a test result.

get_log(id, seq, offset=None, limit=None, filter=None, packets=None, timestamp_format=None)

Get a test result’s log.

get_log_plaintext(id, seq)

Get a test result’s log as plaintext.

list(id, filter=None, sort=None, limit=None, page=None)

Get a list of test results.

list_csv(id, filter=None, sort=None, limit=None, page=None)

Get a list of test results as CSV.

cdrouter.annotations.AnnotationsService

class cdrouter.annotations.AnnotationsService(service)

Service for accessing CDRouter Annotations.

create_or_edit(id, seq, resource)

Create or edit an annotation.

delete(id, seq, line)

Delete an annotation.

get(id, seq, line)

Get an annotation.

list(id, seq)

Get a list of annotations.

cdrouter.captures.CapturesService

class cdrouter.captures.CapturesService(service)

Service for accessing CDRouter Captures.

ascii(id, seq, intf, filter=None, frame=None, inline=False)

Get a capture’s ASCII (hex dump).

decode(id, seq, intf, filter=None, frame=None, inline=False)

Get a capture’s decode.

download(id, seq, intf, inline=False)

Download a capture as a PCAP file.

get(id, seq, intf)

Get a capture.

list(id, seq)

Get a list of captures.

send_to_cloudshark(id, seq, intf, inline=False)

Send a capture to a CloudShark Appliance. Both cloudshark_appliance_url and cloudshark_appliance_token must be properly configured via system preferences.

summary(id, seq, intf, filter=None, inline=False)

Get a capture’s summary.

cdrouter.highlights.HighlightsService

class cdrouter.highlights.HighlightsService(service)

Service for accessing CDRouter Highlights.

create_or_edit(id, seq, resource)

Create or edit a highlight.

delete(id, seq, line)

Get a highlight.

get(id, seq, line)

Get a highlight.

list(id, seq)

Get a list of highlights.

cdrouter.imports.ImportsService

class cdrouter.imports.ImportsService(service)

Service for accessing CDRouter Imports.

commit(id, impreq)

Commit a staged import.

delete(id)

Delete a staged import.

get(id)

Get a staged import.

get_commit_request(id)

Get a commit request for a staged import.

list()

Get a list of staged (in-progress) imports.

stage_import_from_file(fd, filename='upload.gz')

Stage an import from a file upload.

stage_import_from_filesystem(filepath)

Stage an import from a filesystem path.

stage_import_from_url(url, token=None, insecure=False)

Stage an import from a URL to another CDRouter system.

cdrouter.exports.ExportsService

class cdrouter.exports.ExportsService(service)

Service for accessing CDRouter Exports.

bulk_export(config_ids=None, device_ids=None, package_ids=None, result_ids=None, exclude_captures=False)

Bulk export a set of configs, devices, packages and results.

cdrouter.history.HistoryService

class cdrouter.history.HistoryService(service)

Service for accessing CDRouter History.

list(filter=None, sort=None, limit=None, page=None)

Get a list of history entries.

cdrouter.system.SystemService

class cdrouter.system.SystemService(service)

Service for accessing CDRouter System.

check_for_lounge_upgrade(email, password)

Check the CDRouter Support Lounge for eligible upgrades using your Support Lounge email & password.

diagnostics()

Get system diagnostics from cdrouter-diag output.

edit_preferences(resource)

Edit preferences in /usr/cdrouter-data/etc/config.yml.

get_preferences()

Get preferences from /usr/cdrouter-data/etc/config.yml.

hostname()

Get system hostname.

info()

Get system info from cdrouter-cli -info output.

interfaces(addresses=False)

Get system interfaces.

latest_lounge_release()

Get the latest release of CDRouter from the CDRouter Support Lounge.

live()

Get CDRouter Live info from cdrouter-cli -live output.

lounge_update_license()

Download & install a license for your CDRouter system from the CDRouter Support Lounge.

lounge_upgrade(email, password, release_id)

Download & install an upgrade from the CDRouter Support Lounge using your Support Lounge email & password. Please note that any running tests will be stopped.

manual_update_license(fd, filename='cdrouter.lic')

“Update the license on your CDRouter system manually by uploading a .lic license from the CDRouter Support Lounge.

manual_upgrade(fd, filename='cdrouter.bin')

Upgrade CDRouter manually by uploading a .bin installer from the CDRouter Support Lounge. Please note that any running tests will be stopped.

restart()

Restart CDRouter web interface. Please note that any running tests will be stopped.

time()

Get system time.

cdrouter.tags.TagsService

class cdrouter.tags.TagsService(service)

Service for accessing CDRouter Tags.

delete(name)

Delete a tag.

edit(resource)

Edit a tag.

get(name)

Get a tag.

list(resource=None, sort=None)

Get a list of tags.

cdrouter.testsuites.TestsuitesService

class cdrouter.testsuites.TestsuitesService(service)

Service for accessing CDRouter Testsuites.

get_error(name)

Get a error.

get_group(name)

Get a group.

get_label(name)

Get a label.

get_module(name)

Get a module.

get_test(name)

Get a test.

get_testvar(name)

Get a testvar.

info()

Get testsuite info.

list_errors(filter=None, sort=None)

Get a list of errors.

list_groups(filter=None, sort=None)

Get a list of groups.

list_labels(filter=None, sort=None)

Get a list of labels.

list_modules(filter=None, sort=None)

Get a list of modules.

list_tests(filter=None, sort=None)

Get a list of tests.

list_testvars(filter=None, sort=None)

Get a list of testvars.

search(query)

Perform full text search of testsuite.

cdrouter.users.UsersService

class cdrouter.users.UsersService(service)

Service for accessing CDRouter Users.

bulk_copy(ids)

Bulk copy a set of users.

bulk_delete(ids=None, filter=None, all=False)

Bulk delete a set of users.

bulk_edit(_fields, ids=None, filter=None, all=False)

Bulk edit a set of users.

change_password(id, new, old=None, change_token=True)

Change a user’s password.

change_token(id)

Change a user’s token.

create(resource)

Create a new user.

delete(id)

Delete a user.

edit(resource)

Edit a user.

get(id)

Get a user.

list(filter=None, sort=None, limit=None, page=None)

Get a list of users.