Python library for working with the Asgard api.
Project description
Asgard Python Library
---------------------
This is a wrapper for the asgard api.
The api mapping is in `pyasgard/endpoints.py`
Example usage:
```python
from pyasgard import Asgard
# With authentication
# from base64 import b64encode
# asgard = Asgard('http://asgard.example.com',
# username='user',
# password=b64encode('secret'))
asgard = Asgard('http://asgard.example.com')
asgard.ami.list()
asgard.ami.show(ami_id='ami-i1234x')
asgard.cluster.list()
asgard.cluster.resize(name='appname', minAndMaxSize=4)
```
## Warning
The `Asgard.asg.create()` command requires some hacking to support a dynamic
keyword argument. This is documented in the command docstring as well.
```python
client = Asgard('http://test.com')
vpc_id = 'vpc-something'
lb_list = ['lb-something']
lb_param = 'selectedLoadBalancersForVpcId{0}'.format(vpc_id)
api = client.mapping_table['asg']['create']['default_params']
api[lb_param] = lb_list
client.asg.create(**{lotsofparams})
```
## Testing
To run the unit tests, create a `config.py` file and run `tox`:
```python
# Unit test contants
ENC_PASSWD = 'dGVzdHBhc3N3ZA=='
URL = 'http://asgard.demo.com'
USERNAME = 'happydog'
```
---------------------
This is a wrapper for the asgard api.
The api mapping is in `pyasgard/endpoints.py`
Example usage:
```python
from pyasgard import Asgard
# With authentication
# from base64 import b64encode
# asgard = Asgard('http://asgard.example.com',
# username='user',
# password=b64encode('secret'))
asgard = Asgard('http://asgard.example.com')
asgard.ami.list()
asgard.ami.show(ami_id='ami-i1234x')
asgard.cluster.list()
asgard.cluster.resize(name='appname', minAndMaxSize=4)
```
## Warning
The `Asgard.asg.create()` command requires some hacking to support a dynamic
keyword argument. This is documented in the command docstring as well.
```python
client = Asgard('http://test.com')
vpc_id = 'vpc-something'
lb_list = ['lb-something']
lb_param = 'selectedLoadBalancersForVpcId{0}'.format(vpc_id)
api = client.mapping_table['asg']['create']['default_params']
api[lb_param] = lb_list
client.asg.create(**{lotsofparams})
```
## Testing
To run the unit tests, create a `config.py` file and run `tox`:
```python
# Unit test contants
ENC_PASSWD = 'dGVzdHBhc3N3ZA=='
URL = 'http://asgard.demo.com'
USERNAME = 'happydog'
```
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
pyasgard-1.4.tar.gz
(11.8 kB
view hashes)