ObjectRocket Python Client
Project description
ObjectRocket Python Client
==========================
ObjectRocket API bindings for Python.
### Examples
To use the bindings, simply do the following:
```python
import objectrocket
>>>
client = objectrocket.Client('<user_key>', '<pass_key>')
>>>
# To create a new instance.
client.instances.create(name='instance0', size=5, zone='US-West', service_type='mongodb', version='2.4.6')
>>> <objectrocket.instances.Instance at 0x10afeacd0>
# To get one of your instances as an Instance object.
client.instances.get('instance0')
>>> <objectrocket.instances.Instance at 0x1097a8390>
# To get all of your instances in a list.
client.instances.get()
>>> [<objectrocket.instances.Instance at 0x1091f9990>]
# To see an instance's compaction state.
client.instances.compaction('instance0')
>>> {u'data': {u'state': u'compressing', ...}}
# To request compaction for an instance.
client.instances.compaction('instance0', request_compaction=True)
>>> {u'data': {u'state': u'requested', ...}}
```
### Installation
Because we do not have the package up on PyPI yet, build the package manually
as mentioned below in [Development Notes](#development_notes). E.G., `tox -e build`. After you
have the ObjectRocket wheel package, install it like so:
pip install objectrocket-0.1.0-py27-none-any.whl
### Development Notes
#### Running Tests
Before you push your code, run `tox` from the top level directory. If errors
are reported, fix them. If a PEP8 issue is reported, and you do not believe
that it is accurate, place `# noqa` at the end of the line.
#### Coverage Report
To receive a test coverage report, run `tox -e coverage` from the top level directory.
#### Building the Client
To build the client, invoke `tox -e build` from the top level directory.
Your artifact will appear in the `dist` directory, and will look
something like `objectrocket-<version>-py27-<abi>-<platform>.whl`.
#### Building Documentation
To build the documentation, invoke `tox -e docs` from the top level directory.
The HTML index can then be found at `docs/build/html/index.html`.
==========================
ObjectRocket API bindings for Python.
### Examples
To use the bindings, simply do the following:
```python
import objectrocket
>>>
client = objectrocket.Client('<user_key>', '<pass_key>')
>>>
# To create a new instance.
client.instances.create(name='instance0', size=5, zone='US-West', service_type='mongodb', version='2.4.6')
>>> <objectrocket.instances.Instance at 0x10afeacd0>
# To get one of your instances as an Instance object.
client.instances.get('instance0')
>>> <objectrocket.instances.Instance at 0x1097a8390>
# To get all of your instances in a list.
client.instances.get()
>>> [<objectrocket.instances.Instance at 0x1091f9990>]
# To see an instance's compaction state.
client.instances.compaction('instance0')
>>> {u'data': {u'state': u'compressing', ...}}
# To request compaction for an instance.
client.instances.compaction('instance0', request_compaction=True)
>>> {u'data': {u'state': u'requested', ...}}
```
### Installation
Because we do not have the package up on PyPI yet, build the package manually
as mentioned below in [Development Notes](#development_notes). E.G., `tox -e build`. After you
have the ObjectRocket wheel package, install it like so:
pip install objectrocket-0.1.0-py27-none-any.whl
### Development Notes
#### Running Tests
Before you push your code, run `tox` from the top level directory. If errors
are reported, fix them. If a PEP8 issue is reported, and you do not believe
that it is accurate, place `# noqa` at the end of the line.
#### Coverage Report
To receive a test coverage report, run `tox -e coverage` from the top level directory.
#### Building the Client
To build the client, invoke `tox -e build` from the top level directory.
Your artifact will appear in the `dist` directory, and will look
something like `objectrocket-<version>-py27-<abi>-<platform>.whl`.
#### Building Documentation
To build the documentation, invoke `tox -e docs` from the top level directory.
The HTML index can then be found at `docs/build/html/index.html`.
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
objectrocket-0.1.0.tar.gz
(9.4 kB
view hashes)
Built Distribution
Close
Hashes for objectrocket-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5f39a81701b7c09b9c386834e6e98a94871360618b115df1732e7ee981c529 |
|
MD5 | 4ca9580a6479b6a0c6a21c9947aa61c6 |
|
BLAKE2b-256 | ca29b9c3a59b54476f3f9cbc26343d2f5749e801ef7b7ff3caa12f077bee870f |