README.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. cloudbridge
  2. ===========
  3. cloudbridge provides a layer of abstraction over different cloud providers.
  4. It's a straightfoward implementation of the `bridge pattern`_. It is currently
  5. under development and is in a Pre-Alpha state.
  6. .. image:: https://codeclimate.com/github/gvlproject/cloudbridge/badges/gpa.svg
  7. :target: https://codeclimate.com/github/gvlproject/cloudbridge
  8. :alt: Code Climate
  9. .. image:: https://landscape.io/github/gvlproject/cloudbridge/master/landscape.svg?style=flat
  10. :target: https://landscape.io/github/gvlproject/cloudbridge/master
  11. :alt: Landscape Code Health
  12. .. image:: https://coveralls.io/repos/gvlproject/cloudbridge/badge.svg?branch=master&service=github
  13. :target: https://coveralls.io/github/gvlproject/cloudbridge?branch=master
  14. :alt: Code Coverage
  15. .. image:: https://travis-ci.org/gvlproject/cloudbridge.svg?branch=master
  16. :target: https://travis-ci.org/gvlproject/cloudbridge
  17. :alt: Travis Build Status
  18. .. image:: https://img.shields.io/pypi/status/cloudbridge.svg
  19. :target: https://pypi.python.org/pypi/cloudbridge/
  20. :alt: latest version available on PyPI
  21. Usage example
  22. ~~~~~~~~~~~~~
  23. The simplest possible example for doing something useful with cloudbridge would
  24. look like the following.
  25. .. code-block:: python
  26. from cloudbridge.providers.factory import CloudProviderFactory, ProviderList
  27. provider = CloudProviderFactory().create_provider(ProviderList.AWS, {})
  28. print(provider.security.key_pairs.list())
  29. In the example above, the AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables
  30. must be set to your cloud credentials.
  31. Documentation
  32. ~~~~~~~~~~~~~
  33. Documentation can be found at <https://cloudbridge.readthedocs.org>.
  34. Running tests
  35. ~~~~~~~~~~~~~
  36. To run the test suite locally, install `tox`_ with :code:`pip install tox`
  37. and run ``tox`` command. This will run all the tests for
  38. all the environments defined in file ``tox.ini``. In order to properly run the
  39. tests, you should have all the environment variables listed in
  40. ``tox.ini`` file (under ``passenv``) exported.
  41. If you’d like to run the tests on a specific environment only, use a command
  42. like this: ``tox -e py27`` (or ``python setup.py test`` directly). If you'd
  43. like to run the tests for a specific cloud only, you should export env var
  44. ``CB_TEST_PROVIDER`` and specify the desired provider name (e.g., ``aws`` or
  45. ``openstack``) and then run the ``tox`` command.
  46. Note that running the tests will create various cloud resources, for which you
  47. may incur costs.
  48. .. _`bridge pattern`: https://en.wikipedia.org/wiki/Bridge_pattern
  49. .. _`tox`: https://tox.readthedocs.org/en/latest/