Low-level API — Renku 0.1.0.dev20180613 documentation

Join us on GitHub

# Low-level API

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

Warning

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

HTTP clients for Renku platform.

class `renku.api.` `APIClient`(endpoint=None, **kwargs)

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

  Example:

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

  Create a remote API client.

  `delete`(*args, **kwargs)

    Perform the `DELETE` request and check its status code.

  `endpoint`

    Return endpoint value.

  `get`(*args, **kwargs)

    Perform the `GET` request and check its status code.

  `post`(*args, **kwargs)

    Perform the `POST` request and check its status code.

  `put`(*args, **kwargs)

    Perform the `PUT` request and check its status code.

class `renku.api.` `LocalClient`(renku_home='.renku', datadir='data', path=NOTHING) → None

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

  Example:

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

## Projects

Client for handling projects.

class `renku.api.projects.` `ProjectsApiMixin`

  Client for handling projects.

  `create_project`(project)

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

  `get_project`(project_id)

    Get existing project.

  `list_projects`()

    Return an iterator for all projects.

## Storage

Client for storage service.

class `renku.api.storage.` `BucketsApiMixin`

  Client for handling storage buckets.

  `create_bucket`(**kwargs)

    Create a new storage bucket.

  `storage_bucket_metadata_replace`(resource_id, data)

    Replace resource metadata.

  `storage_info`()

    Return information about available bucket backends.

class `renku.api.storage.` `FilesApiMixin`

  Client for handling file objects in a bucket.

  `create_file`(**kwargs)

    Create a new file object.

  `storage_authorize`(resource_id=None, request_type=None)

    Request authorization token for performing file handle request.

  `storage_copy_file`(resource_id=None, file_name=None, **kwargs)

    Request a file copy.

  `storage_file_metadata_replace`(resource_id, data)

    Replace resource metadata.

  `storage_io_read`(*args, **kwargs)

    Write data to the file.

    Note

    Use only with `access_token` issued by storage service.

  `storage_io_write`(data)

    Write data to the file.

    Note

    Use only with `access_token` issued by storage service.

## Deployer

Client for deployer service.

class `renku.api.deployer.` `ContextsApiMixin`

  Manage deployer contexts.

  `create_context`(spec)

    Create a new deployer context.

  `create_execution`(context_id, **kwargs)

    Create an execution of a context on a given engine.

  `execution_logs`(context_id, execution_id)

    Retrieve logs of an execution.

  `execution_ports`(context_id, execution_id)

    Retrieve port mappings for an execution.

  `get_context`(context_id)

    List all known contexts.

  `get_execution`(context_id, execution_id)

    Retrieve an execution.

  `list_contexts`()

    List all known contexts.

  `list_executions`(context_id)

    List all executions of a given context.

  `stop_execution`(context_id, execution_id)

    Stop a running execution.