Low-level API

This API is built on top of REST API endpoints exposed by Renga services.

Warning

Renga services are currently in beta preview status and they are subject to change in forseenable future.

HTTP clients for Renga platform.

class renga.api.APIClient(endpoint=None, **kwargs)[source]

A low-level client for communicating with a Renga Platform API.

Example:

>>> import renga
>>> client = renga.APIClient('http://localhost')

Create a remote API client.

delete(*args, **kwargs)[source]

Perform the DELETE request and check its status code.

endpoint

Return endpoint value.

get(*args, **kwargs)[source]

Perform the GET request and check its status code.

post(*args, **kwargs)[source]

Perform the POST request and check its status code.

put(*args, **kwargs)[source]

Perform the PUT request and check its status code.

class renga.api.LocalClient(renga_home='.renga', datadir='data', path=NOTHING)[source]

A low-level client for communicating with a local Renga repository.

Example:

>>> import renga
>>> client = renga.LocalClient('.')

Projects

Client for handling projects.

class renga.api.projects.ProjectsApiMixin[source]

Client for handling projects.

create_project(project)[source]

Create a new project and register it on the knowledge graph.

get_project(project_id)[source]

Get existing project.

list_projects()[source]

Return an iterator for all projects.

Storage

Client for storage service.

class renga.api.storage.BucketsApiMixin[source]

Client for handling storage buckets.

create_bucket(**kwargs)[source]

Create a new storage bucket.

storage_bucket_metadata_replace(resource_id, data)[source]

Replace resource metadata.

storage_info()[source]

Return information about available bucket backends.

class renga.api.storage.FilesApiMixin[source]

Client for handling file objects in a bucket.

create_file(**kwargs)[source]

Create a new file object.

storage_authorize(resource_id=None, request_type=None)[source]

Request authorization token for performing file handle request.

storage_copy_file(resource_id=None, file_name=None, **kwargs)[source]

Request a file copy.

storage_file_metadata_replace(resource_id, data)[source]

Replace resource metadata.

storage_io_read(*args, **kwargs)[source]

Write data to the file.

Note

Use only with access_token issued by storage service.

storage_io_write(data)[source]

Write data to the file.

Note

Use only with access_token issued by storage service.

Deployer

Client for deployer service.

class renga.api.deployer.ContextsApiMixin[source]

Manage deployer contexts.

create_context(spec)[source]

Create a new deployer context.

create_execution(context_id, **kwargs)[source]

Create an execution of a context on a given engine.

execution_logs(context_id, execution_id)[source]

Retrieve logs of an execution.

execution_ports(context_id, execution_id)[source]

Retrieve port mappings for an execution.

get_context(context_id)[source]

List all known contexts.

get_execution(context_id, execution_id)[source]

Retrieve an execution.

list_contexts()[source]

List all known contexts.

list_executions(context_id)[source]

List all executions of a given context.

stop_execution(context_id, execution_id)[source]

Stop a running execution.