Skip to main content

Python3 bindings and utils for CloudCIX API.

Project description

cloudcix is a Python client for the CloudCIX REST API for rapidly building secure, scalable CloudCIX applications.

For more information about CloudCIX, see here.

Installation

Prerequisites

  1. Create an account on the CloudCIX Platform
  2. Retrieve your API Key
    • Under the My Membership tab in the sidebar, click on Member Details
    • The API Key should be available at the top of the form
  3. Ensure that you have both Python and pip installed
    • As of right now, the cloudcix module is available at different versions for Python2 and Python3
    • We recommend you use Python3 and the latest version of the cloudcix module
    • Python
    • pip

Installing the cloudcix library

The cloudcix library is installed using the pip module.

Depending on your version of Python, you need to install different versions of cloudcix

  • Python3
    • pip3 install -U cloudcix
  • Python2
    • pip install -U 'cloudcix<0.3'

The 0.2 releases are the last to support Python2. If you still use Python2 we recommend you upgrade to Python3 as support will be dropped for these versions in time.

Required settings

In order to run a project, the module requires some setting variables to exist.

The variables required are as follows:

  • CLOUDCIX_API_URL
    • The base url of the api
    • Usually https://api.cloudcix.com/ but could change over time
  • CLOUDCIX_AUTH_URL
    • The base url of the auth server
    • Usually https://keystone.cloudcix.com:5000/v3/ but could change over time
  • CLOUDCIX_API_USERNAME
    • The email of the account that you signed up with
  • CLOUDCIX_API_PASSWORD
    • The password associated with your CloudCIX account
  • CLOUDCIX_API_KEY
    • The API key associated with your CloudCIX Member (see Prerequisites)

These variables can be declared in a settings file, as follows

# In main python script
import os
os.environ.setdefault("CLOUDCIX_SETTINGS_MODULE", "my_project.my_settings")
# In my_project/my_settings.py
CLOUDCIX_API_URL = 'https://api.cloudcix.com'
CLOUDCIX_API_USERNAME = 'EMAIL'               # CloudCIX login
CLOUDCIX_API_PASSWORD = 'PASSWORD'            # CloudCIX password
CLOUDCIX_API_KEY = 'NUMBER/CHARACTER STRING'  # CloudCIX api key
CLOUDCIX_AUTH_URL = 'https://keystone.cloudcix.com:5000/v3'

Small Example

Pull a list of Countries from the CloudCIX API Assume the above settings file is available

import os

os.environ.setdefault("CLOUDCIX_SETTINGS_MODULE", "my_project.my_settings")

# NOTE: environ variables must be set before importing cloudcix

from cloudcix import api

# Get a util function to get a session using the credentials in your settings file
from cloudcix.utils import get_admin_session

# Get your authentication token for your login
token = get_admin_session().get_token()
# Get a list of the countries from the Membership Application passing your token for authentication
response = api.membership.country.list(token=token)

# Print out the json of the response data
print(response.json())

More Examples

For more examples, see the examples file

Project details


Release history Release notifications

This version
History Node

0.5.6

History Node

0.5.5

History Node

0.5.4

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0

History Node

0.4.14

History Node

0.4.13

History Node

0.4.12

History Node

0.4.11

History Node

0.4.10

History Node

0.4.9

History Node

0.4.8

History Node

0.4.7

History Node

0.4.6

History Node

0.4.5

History Node

0.4.4

History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.2.69

History Node

0.2.68

History Node

0.2.67

History Node

0.2.66

History Node

0.2.65

History Node

0.2.64

History Node

0.2.63

History Node

0.2.62

History Node

0.2.61

History Node

0.2.59

History Node

0.2.58

History Node

0.2.57

History Node

0.2.55

History Node

0.2.54

History Node

0.2.53

History Node

0.2.52

History Node

0.2.51

History Node

0.2.50

History Node

0.2.49

History Node

0.2.48

History Node

0.2.47

History Node

0.2.46

History Node

0.2.45

History Node

0.2.44

History Node

0.2.43

History Node

0.2.42

History Node

0.2.41

History Node

0.2.40

History Node

0.2.39

History Node

0.2.38

History Node

0.2.37

History Node

0.2.36

History Node

0.2.35

History Node

0.2.34

History Node

0.2.33

History Node

0.2.32

History Node

0.2.31

History Node

0.2.30

History Node

0.2.29

History Node

0.2.28

History Node

0.2.27

History Node

0.2.26

History Node

0.2.25

History Node

0.2.24

History Node

0.2.23

History Node

0.2.22

History Node

0.2.21

History Node

0.2.20

History Node

0.2.19

History Node

0.2.18

History Node

0.2.17

History Node

0.2.16

History Node

0.2.15

History Node

0.2.11

History Node

0.2.9

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3.2

History Node

0.2.3.1

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2

History Node

0.1.17.1

History Node

0.1.17

History Node

0.1.16

History Node

0.1.15

History Node

0.1.14

History Node

0.1.13

History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8.1

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
cloudcix-0.5.6.tar.gz (16.0 kB) Copy SHA256 hash SHA256 Source None Jul 3, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page