| OLD | NEW |
| 1 # Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ | 1 # Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/ |
| 2 # Copyright (c) 2011 Jann Kleen | 2 # Copyright (c) 2011 Jann Kleen |
| 3 # | 3 # |
| 4 # Permission is hereby granted, free of charge, to any person obtaining a | 4 # Permission is hereby granted, free of charge, to any person obtaining a |
| 5 # copy of this software and associated documentation files (the | 5 # copy of this software and associated documentation files (the |
| 6 # "Software"), to deal in the Software without restriction, including | 6 # "Software"), to deal in the Software without restriction, including |
| 7 # without limitation the rights to use, copy, modify, merge, publish, dis- | 7 # without limitation the rights to use, copy, modify, merge, publish, dis- |
| 8 # tribute, sublicense, and/or sell copies of the Software, and to permit | 8 # tribute, sublicense, and/or sell copies of the Software, and to permit |
| 9 # persons to whom the Software is furnished to do so, subject to the fol- | 9 # persons to whom the Software is furnished to do so, subject to the fol- |
| 10 # lowing conditions: | 10 # lowing conditions: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 from boto.ec2.autoscale.group import AutoScalingGroup, ProcessType | 35 from boto.ec2.autoscale.group import AutoScalingGroup, ProcessType |
| 36 from boto.ec2.autoscale.activity import Activity | 36 from boto.ec2.autoscale.activity import Activity |
| 37 from boto.ec2.autoscale.policy import AdjustmentType, MetricCollectionTypes, Sca
lingPolicy | 37 from boto.ec2.autoscale.policy import AdjustmentType, MetricCollectionTypes, Sca
lingPolicy |
| 38 from boto.ec2.autoscale.instance import Instance | 38 from boto.ec2.autoscale.instance import Instance |
| 39 from boto.ec2.autoscale.scheduled import ScheduledUpdateGroupAction | 39 from boto.ec2.autoscale.scheduled import ScheduledUpdateGroupAction |
| 40 | 40 |
| 41 | 41 |
| 42 RegionData = { | 42 RegionData = { |
| 43 'us-east-1' : 'autoscaling.us-east-1.amazonaws.com', | 43 'us-east-1' : 'autoscaling.us-east-1.amazonaws.com', |
| 44 'us-west-1' : 'autoscaling.us-west-1.amazonaws.com', | 44 'us-west-1' : 'autoscaling.us-west-1.amazonaws.com', |
| 45 'us-west-2' : 'autoscaling.us-west-2.amazonaws.com', |
| 45 'eu-west-1' : 'autoscaling.eu-west-1.amazonaws.com', | 46 'eu-west-1' : 'autoscaling.eu-west-1.amazonaws.com', |
| 46 'ap-northeast-1' : 'autoscaling.ap-northeast-1.amazonaws.com', | 47 'ap-northeast-1' : 'autoscaling.ap-northeast-1.amazonaws.com', |
| 47 'ap-southeast-1' : 'autoscaling.ap-southeast-1.amazonaws.com'} | 48 'ap-southeast-1' : 'autoscaling.ap-southeast-1.amazonaws.com'} |
| 48 | 49 |
| 49 def regions(): | 50 def regions(): |
| 50 """ | 51 """ |
| 51 Get all available regions for the Auto Scaling service. | 52 Get all available regions for the Auto Scaling service. |
| 52 | 53 |
| 53 :rtype: list | 54 :rtype: list |
| 54 :return: A list of :class:`boto.RegionInfo` instances | 55 :return: A list of :class:`boto.RegionInfo` instances |
| (...skipping 24 matching lines...) Expand all Loading... |
| 79 | 80 |
| 80 | 81 |
| 81 class AutoScaleConnection(AWSQueryConnection): | 82 class AutoScaleConnection(AWSQueryConnection): |
| 82 APIVersion = boto.config.get('Boto', 'autoscale_version', '2011-01-01') | 83 APIVersion = boto.config.get('Boto', 'autoscale_version', '2011-01-01') |
| 83 DefaultRegionEndpoint = boto.config.get('Boto', 'autoscale_endpoint', | 84 DefaultRegionEndpoint = boto.config.get('Boto', 'autoscale_endpoint', |
| 84 'autoscaling.amazonaws.com') | 85 'autoscaling.amazonaws.com') |
| 85 DefaultRegionName = boto.config.get('Boto', 'autoscale_region_name', 'us-ea
st-1') | 86 DefaultRegionName = boto.config.get('Boto', 'autoscale_region_name', 'us-ea
st-1') |
| 86 | 87 |
| 87 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, | 88 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, |
| 88 is_secure=True, port=None, proxy=None, proxy_port=None, | 89 is_secure=True, port=None, proxy=None, proxy_port=None, |
| 89 proxy_user=None, proxy_pass=None, debug=None, | 90 proxy_user=None, proxy_pass=None, debug=0, |
| 90 https_connection_factory=None, region=None, path='/'): | 91 https_connection_factory=None, region=None, path='/'): |
| 91 """ | 92 """ |
| 92 Init method to create a new connection to the AutoScaling service. | 93 Init method to create a new connection to the AutoScaling service. |
| 93 | 94 |
| 94 B{Note:} The host argument is overridden by the host specified in the | 95 B{Note:} The host argument is overridden by the host specified in the |
| 95 boto configuration file. | 96 boto configuration file. |
| 96 """ | 97 """ |
| 97 if not region: | 98 if not region: |
| 98 region = RegionInfo(self, self.DefaultRegionName, | 99 region = RegionInfo(self, self.DefaultRegionName, |
| 99 self.DefaultRegionEndpoint, | 100 self.DefaultRegionEndpoint, |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 associated with the group. | 624 associated with the group. |
| 624 """ | 625 """ |
| 625 params = {'InstanceId' : instance_id, | 626 params = {'InstanceId' : instance_id, |
| 626 'HealthStatus' : health_status} | 627 'HealthStatus' : health_status} |
| 627 if should_respect_grace_period: | 628 if should_respect_grace_period: |
| 628 params['ShouldRespectGracePeriod'] = 'true' | 629 params['ShouldRespectGracePeriod'] = 'true' |
| 629 else: | 630 else: |
| 630 params['ShouldRespectGracePeriod'] = 'false' | 631 params['ShouldRespectGracePeriod'] = 'false' |
| 631 return self.get_status('SetInstanceHealth', params) | 632 return self.get_status('SetInstanceHealth', params) |
| 632 | 633 |
| OLD | NEW |