Skip to content

cbrightsci/starter_template

Repository files navigation

Qumulo REST API -- Sample/ Starter Project Template

Prerequisites

  • Python 2.7
  • Node 0.12.4 or greater

Installing the Prerequisites

Python

if you're developing on a current version of Mac OSX, you should already have a 2.7 version of python. you can check which version of python you have by opening a command promopt and typing

python -V

To install Python 2.7 please visit the Python Software Foundation Download Page and select the most current version (at time of writing it is version 2.7.10)

Node

On OSX yu can run

  brew install node

to install the latest version, or visit Joyent/Node and follow instructions for your platform.

Once You Have Prerequisites Installed

1. Install the supporting libraries for python and javascript

Just run the local installer shell script to install the libraries you'll need for python and/or javascript samples:

  ./install_tools

You should only need to run this once.

2. Install the Qumulo REST API Python Wrapper library

run

  pip install -r requirements.txt

You can verify that you have the Qumulo REST API installed by running the following command at a command prompt:

  pip list

You should see something like the following output:


astroid (1.3.6)

logilab-common (1.0.1)

nose (1.3.7)

pip (7.1.0)

pylint (1.4.4)

qumulo-api (1.2.6)

setuptools (17.0)

six (1.9.0)

wheel (0.24.0)

3. Kick the Tires

To get started the project includes a sample command get_stats.py (and an associated test) that will use the Qumulo REST API to get filesystem stats for a specified cluster; you can run it like this (changing the host, port and user acct/pwd parameters to match your local environment):

/get_stats.py --host dev --user clusteruser --pass pwd --port 20095

your output from running this command should look something like this:

{
    "block_size_bytes": 4096,
    "free_size_bytes": "11254198272",
    "raw_size_bytes": "28521267200",
    "total_size_bytes": "11254276096"
}

4. Check your code quality

We support Pylint and JsHint / EsLint to ensure that sample code meets coding standards such as PEP8 and Qumulo's own coding standards for Python and Javascript. To check your code against the checking rules, just run


  ./runlint

from the directory where you downloaded this sample project.

You should ./runlint each time you update your source code.

5. Create and run tests to verify that your sample works

We support Python unit tests via Nose and Javascript tests using Jasmine. You can run all python and javascript tests in the current directory (one python test is included by default) by running the following shell script:


  ./runtests

Ideally you should create tests that exercise your sample code, so you can easily tell if your sample works when we drop new versions of the Qumulo REST API framework or when you've made changes to your sample.

About

use this template to start Qumulo REST API projects. It pulls in pylint, nose etc. for python and npm, jslint, jasmine etc. for javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors