Esempio n. 1
0
# IN THE SOFTWARE.
#
"""
This module provides an interface to the Elastic Compute Cloud (Computing)
load balancing service from AWS.
"""
from niftycloud.connection import AWSQueryConnection
from niftycloud.computing.instanceinfo import InstanceInfo
from niftycloud.computing.loadbalancer.loadbalancer import LoadBalancer, LoadBalancerZones
from niftycloud.computing.loadbalancer.instancestate import InstanceState
from niftycloud.computing.loadbalancer.healthcheck import HealthCheck
from niftycloud.regioninfo import RegionInfo, get_regions, load_regions
import niftycloud
from niftycloud.compat import six

RegionData = load_regions().get('loadbalancer', {})


def regions():
    """
    Get all available regions for the Loadbalancer service.

    :rtype: list
    :return: A list of :class:`niftycloud.RegionInfo` instances
    """
    return get_regions('loadbalancer', connection_cls=LoadbalancerConnection)


def connect_to_region(region_name, **kw_params):
    """
    Given a valid region name, return a
Esempio n. 2
0
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
"""
This module provides an interface to the Elastic Compute Cloud (Computing)
service from AWS.
"""
from niftycloud.computing.connection import ComputingConnection
from niftycloud.regioninfo import RegionInfo, get_regions, load_regions


RegionData = load_regions().get('computing', {})


def regions(**kw_params):
    """
    Get all available regions for the Computing service.
    You may pass any of the arguments accepted by the ComputingConnection
    object's constructor as keyword arguments and they will be
    passed along to the ComputingConnection object.

    :rtype: list
    :return: A list of :class:`niftycloud.computing.regioninfo.RegionInfo`
    """
    return get_regions('computing', connection_cls=ComputingConnection)