Source code for awsfabrictasks.regions

from fabric.api import task
from boto.ec2 import regions, connect_to_region

from conf import awsfab_settings



@task
[docs]def list_regions(): """ List all regions. """ for region in regions(**awsfab_settings.AUTH): print '- {name} (endpoint: {endpoint})'.format(**region.__dict__)
@task
[docs]def list_zones(region=awsfab_settings.DEFAULT_REGION): """ List zones in the given region. :param region: Defaults to ``awsfab_settings.DEFAULT_REGION``. """ connection = connect_to_region(region_name=region, **awsfab_settings.AUTH) print 'Zones in {region}:'.format(region=region) for zone in connection.get_all_zones(): print '- {name} (state:{state})'.format(**zone.__dict__)
Read the Docs v: 1.0.14
Versions
latest
1.1.1
1.0.14
1.0.13
1.0.8
1.0.6
1.0.5
1.0.4
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.