Skip to main content

A ReSTful web api backed by cloudbridge for interacting with cloud providers

Project description

latest version available on PyPI Travis Build Status Test Coverage Report

A reusable Django app that exposes a ReSTful Web API for interacting with CloudBridge providers. The structure of the API mirrors the organisation of CloudBridge’s API and allows for creating, retrieving and updating CloudBridge resources.

Documentation

The full documentation is at https://djcloudbridge.readthedocs.io.

Quickstart

Install djcloudbridge:

pip install djcloudbridge

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'djcloudbridge.apps.DjangoCloudbridgeConfig',
    ...
)

Add djcloudbridge’s URL patterns:

from djcloudbridge import urls as djcloudbridge_urls


urlpatterns = [
    ...
    url(r'^', include(djcloudbridge_urls)),
    ...
]

And finally, the following settings are recommended in your settings.py

REST_FRAMEWORK = {
    'PAGE_SIZE': 50,
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework.authentication.TokenAuthentication'
    )
}

REST_AUTH_SERIALIZERS = {
    'USER_DETAILS_SERIALIZER': 'djcloudbridge.serializers.UserSerializer'
}

REST_SESSION_LOGIN = True

# **Make sure to change** the value for ``FERNET_KEYS`` variable
# because it is used to encrypt sensitive database fields.
FERNET_KEYS = [
    'new key for encrypting'
]

Running the API Locally

You can run a test server to browse the API endpoints locally. DJCloudBridge is based on Python 3.6 and although it may work on older Python versions, 3.6 is the only supported version. Use of virtualenv is also highly advised.

To get started, simply register the provider connection information under the relevant cloud model (e.g. AWS, Azure, GCE, OpenStack) in Django Admin. Then create a User Profile under the User Profile model. Finally, use the API browser at http://localhost:8000/clouds to view the cloud you registered and interact with cloud resources for that provider.

  1. Checkout djcloudbridge and create environment

$ mkdir djcloudbridge && cd djcloudbridge
$ virtualenv -p python3.6 venv --prompt "(djcloudbridge)" && source venv/bin/activate
$ git clone https://github.com/cloudve/djcloudbridge.git
$ cd djcloudbridge
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
  1. Visit http://127.0.0.1:8000/admin/ to define your cloud connection settings.

  2. Visit http://127.0.0.1:8000/clouds/ to explore the API.

Features

  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.1.0 (2017-10-04)

  • First release on PyPI.

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

djcloudbridge-0.2.1.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djcloudbridge-0.2.1-py2.py3-none-any.whl (28.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file djcloudbridge-0.2.1.tar.gz.

File metadata

  • Download URL: djcloudbridge-0.2.1.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for djcloudbridge-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7521a2db80b17cb0b65d57cf875b2eb281eb7356b95b49d2e5866788b0bc80b9
MD5 b6f572027b81a82e01a4fb26120c789f
BLAKE2b-256 52b6b02cf6d70fa29f1d6313b1b3d8e202d398f5188ec860bc63e2a3a3a256db

See more details on using hashes here.

File details

Details for the file djcloudbridge-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for djcloudbridge-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fa3c2a99ebd41349eb8e85a09c9a05c699e1e64fca9772240e1cf20e1304952e
MD5 c4a50cc19a7cbf31d3e1bc72eee2afcc
BLAKE2b-256 1c7d980b2ecc713c4cda095462533a5cd556b44093b838d92e626714816f6830

See more details on using hashes here.

Supported by

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