README.rst 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. Documentation
  31. ~~~~~~~~~~~~~
  32. Complete documentation can be found at <https://cloudbridge.readthedocs.org>.
  33. Running tests
  34. ~~~~~~~~~~~~~
  35. To run the test suite locally, install `tox`_ with :code:`pip install tox`
  36. and run ``tox`` command. This will run all the tests for
  37. all the environments defined in file ``tox.ini``. In order to properly run the
  38. tests, you should have all the environment variables listed in
  39. ``tox.ini`` file (under ``passenv``) exported.
  40. If you’d like to run the tests on a specific environment only, use a command
  41. like this: ``tox -e py27`` (or ``python setup.py test`` directly). If you'd
  42. like to run the tests for a specific cloud only, you should export env var
  43. ``CB_TEST_PROVIDER`` and specify the desired provider name (e.g., ``aws`` or
  44. ``openstack``) and then run the ``tox`` command.
  45. Note that running the tests will create various cloud resources, for which you
  46. may incur costs.
  47. .. _`bridge pattern`: https://en.wikipedia.org/wiki/Bridge_pattern
  48. .. _`tox`: https://tox.readthedocs.org/en/latest/