Metadata-Version: 2.1
Name: cloudcix
Version: 0.2.143
Summary: Python bindings and utils for CloudCIX API.
Home-page: https://python-cloudcix.readthedocs.io/en/latest/
Author: CloudCIX
Author-email: developers@cix.ie
License: Apache 2.0
Keywords: cix,cloudcix,bindings,client
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Requires-Dist: requests (==2.27.1)
Requires-Dist: certifi (==2021.10.8)
Requires-Dist: pbr (==5.11.0)
Requires-Dist: PyYAML (==5.4.1)
Requires-Dist: debtcollector (==1.22.0)
Requires-Dist: pyparsing (==2.4.7)
Requires-Dist: netaddr (==0.7.19)
Requires-Dist: rfc3986 (==1.5.0)
Requires-Dist: msgpack (==0.5.4)
Requires-Dist: iso8601 (==0.1.16)
Requires-Dist: stevedore (==1.32.0)
Requires-Dist: oslo.serialization (==2.29.3)
Requires-Dist: oslo.utils (==3.35.0)
Requires-Dist: python-keystoneclient (==3.13.1)
Requires-Dist: oslo.config (==7.0.0)
Requires-Dist: dateutils (==0.6.12)
Requires-Dist: Django (==1.9.13)
Requires-Dist: coverage (==4.5.1)
Requires-Dist: keystoneauth1 (==5.0.0)

Python Bindings for CloudCIX API
================================

Python bindings and utils to make the work with CloudCIX API fun and
easy.

`API Docs <https://docs.cloudcix.com>`__

CloudCIX is developed by `CIX <http://www.cix.ie>`__

Requirements
------------

-  `CloudCIX Account <https://auth.cloudcix.com/register/>`__
-  `CloudCIX Account's Member
   ID <https://saas.cloudcix.com/membership/setup/account/member/>`__
   under Member ID
-  `Python
   2.7.x <http://docs.python-guide.org/en/latest/starting/installation/>`__
-  `pip <https://pip.pypa.io/en/stable/installation/>`__

*It is crucial that you install Python 2.7, this library was not
designed for use with Python 3+.*

Pre Installation with pip
-------------------------

Download
`get-pip.py <https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py>`__
and run

::

    python get-pip.py

Installation
------------

With pip:

::

    pip install -U cloudcix


Required settings
-----------------

When you run your project you should set the settings variable
``CLOUDCIX_SETTINGS_MODULE`` to point to the module that contains the
settings object.

ENV Based Settings (Basic)
~~~~~~~~~~~~~~~~~~~~~~~~~~

As an alternative when used from ``console`` the settings can be set as
environment variables.

.. code:: python

    os.environ['CLOUDCIX_SERVER_URL'] = 'https://api.cloudcix.com/'
    # utils method get_admin_token and get_admin_session, will require you to set
    # following environment variables as well
    os.environ['CLOUDCIX_API_USERNAME'] = 'EMAIL'     # CloudCIX login
    os.environ['CLOUDCIX_API_PASSWORD'] = 'PASSWORD'  # CloudCIX password
    os.environ['CLOUDCIX_API_ID_MEMBER'] = 'NUMBER'   # CloudCIX Member ID (see Requirements)
    os.environ['OPENSTACK_KEYSTONE_URL'] = 'https://keystone.cloudcix.com:5000/v3'

Module Based Settings (Advanced)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    # In main python script
    import os
    os.environ.setdefault("CLOUDCIX_SETTINGS_MODULE", "my_project.my_settings")

.. code:: python

    # In my_project/my_settings.py
    CLOUDCIX_SERVER_URL = 'https://api.cloudcix.com'
    CLOUDCIX_API_USERNAME = 'EMAIL'     # CloudCIX login
    CLOUDCIX_API_PASSWORD = 'PASSWORD'  # CloudCIX password
    CLOUDCIX_API_ID_MEMBER = 'NUMBER'   # CloudCIX Member ID (see Requirements)
    OPENSTACK_KEYSTONE_URL = 'https://keystone.cloudcix.com:5000/v3'

Django Settings (Advanced)
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    # In settings.py
    INSTALLED_APPS = (
      ...
      'django_cloudcix'
    )

    CLOUDCIX_SERVER_URL = 'https://api.cloudcix.com'
    CLOUDCIX_API_USERNAME = 'EMAIL'     # CloudCIX login
    CLOUDCIX_API_PASSWORD = 'PASSWORD'  # CloudCIX password
    CLOUDCIX_API_ID_MEMBER = 'NUMBER'   # CloudCIX Member ID (see Requirements)
    OPENSTACK_KEYSTONE_URL = 'https://keystone.cloudcix.com:5000/v3'

Sample usage
------------

Use the language service
~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    import os

    os.environ['CLOUDCIX_SERVER_URL'] = 'https://api.cloudcix.com'
    os.environ['CLOUDCIX_API_USERNAME'] = 'EMAIL'
    os.environ['CLOUDCIX_API_PASSWORD'] = 'PASSWORD'
    os.environ['CLOUDCIX_API_ID_MEMBER'] = 'NUMBER'
    os.environ['OPENSTACK_KEYSTONE_URL'] = 'https://keystone.cloudcix.com:5000/v3'

    # NOTE: environ variables must be set before importing cloudcix

    from cloudcix import api
    from cloudcix.utils import get_admin_session

    token = get_admin_session().get_token()
    response = api.membership.language.list(token=token)

    print response.json()

More Examples
-------------

see ``examples`` folder for more.


