README.rst 2.4 KB

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