Skip to main content

Joyent SmartDataCenter CloudAPI connector using http-signature authentication via Requests

Project description

Connect with Joyent’s SmartDataCenter CloudAPI via Python, using secure http-signature signed requests.

This is a third-party effort.

This module currently supports:

  • Secure connections (via py-http-signature)

  • Key management

  • Browsing and access of datacenters, datasets (OS distributions/VM bundles), and packages (machine sizes and resources)

  • Machine listing, search, creation, management (start/stop/reboot/resize/delete), snapshotting, metadata, and tags

It attempts to provide Pythonic objects (for Data Centers, Machines and Snapshots) and convenience methods only when appropriate, and otherwise deals with string identifiers or dicts as lightweight objects.

Requirements

We assume that json is present because requests now requires py2.6 and up.

Installation

pip install smartdc

Quickstart

from smartdc import DataCenter

sdc = DataCenter(location='us-sw-1', key_id='/test/keys/test_key')

sdc.datasets()

sm = sdc.create_machine(name='test', dataset='sdc:sdc:smartosplus:',
      package='Small 1GB')

sm.poll_until('running')

import urllib2

urllib2.urlopen('http://' + sm.public_ips[0]).headers.dict

sm.stop()

sm.poll_until('stopped')

sm.delete()

Why?

A colleague and I wanted something Pythonic to fit into our preferred toolchain, and the easiest approach was to build it myself. Requests made some aspects stupidly easy, which is why I created the dependency for the first version. The colleague wanted integration with ssh-agent, and using ssh was the easiest path to that.

Authors

Adam T. Lindsay

License

MIT

Changes

0.1.6 (2012-04-30)

Fixed release issues (README), and moved documentation around. Integrated with ssh-agent changes in http_signature.

Project details


Download files

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

Source Distribution

smartdc-0.1.6.tar.gz (13.4 kB view hashes)

Uploaded Source

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