Skip to main content

Python bindings and utils for CloudCIX API.

Project description

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

API Docs

CloudCIX is developed by CIX

Requirements

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 and run

python get-pip.py

Installation

With pip:

pip install -U cloudcix

Without pip * download this * extract to your project folder * open a new python file and add the settings described below:

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.

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)

# In main python script
import os
os.environ.setdefault("CLOUDCIX_SETTINGS_MODULE", "my_project.my_settings")
# 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)

# 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

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudcix-0.2.95.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file cloudcix-0.2.95.tar.gz.

File metadata

  • Download URL: cloudcix-0.2.95.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for cloudcix-0.2.95.tar.gz
Algorithm Hash digest
SHA256 99d6c980aad40f3e4a35759af10b77cff22c52b903d9b8dcaeb0074ea799ab11
MD5 4eebb00977bb058e627656217384f912
BLAKE2b-256 8b5cc6c0437b54884080e9ce11f4d7a674f6f62cee64521d6dc30dd1f0e8403b

See more details on using hashes here.

Supported by

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