OLD | NEW |
1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ |
2 # | 2 # |
3 # Permission is hereby granted, free of charge, to any person obtaining a | 3 # Permission is hereby granted, free of charge, to any person obtaining a |
4 # copy of this software and associated documentation files (the | 4 # copy of this software and associated documentation files (the |
5 # "Software"), to deal in the Software without restriction, including | 5 # "Software"), to deal in the Software without restriction, including |
6 # without limitation the rights to use, copy, modify, merge, publish, dis- | 6 # without limitation the rights to use, copy, modify, merge, publish, dis- |
7 # tribute, sublicense, and/or sell copies of the Software, and to permit | 7 # tribute, sublicense, and/or sell copies of the Software, and to permit |
8 # persons to whom the Software is furnished to do so, subject to the fol- | 8 # persons to whom the Software is furnished to do so, subject to the fol- |
9 # lowing conditions: | 9 # lowing conditions: |
10 # | 10 # |
11 # The above copyright notice and this permission notice shall be included | 11 # The above copyright notice and this permission notice shall be included |
(...skipping 16 matching lines...) Expand all Loading... |
28 from boto.ec2.elb.loadbalancer import LoadBalancer | 28 from boto.ec2.elb.loadbalancer import LoadBalancer |
29 from boto.ec2.elb.instancestate import InstanceState | 29 from boto.ec2.elb.instancestate import InstanceState |
30 from boto.ec2.elb.healthcheck import HealthCheck | 30 from boto.ec2.elb.healthcheck import HealthCheck |
31 from boto.regioninfo import RegionInfo | 31 from boto.regioninfo import RegionInfo |
32 import boto | 32 import boto |
33 | 33 |
34 RegionData = { | 34 RegionData = { |
35 'us-east-1' : 'elasticloadbalancing.us-east-1.amazonaws.com', | 35 'us-east-1' : 'elasticloadbalancing.us-east-1.amazonaws.com', |
36 'us-west-1' : 'elasticloadbalancing.us-west-1.amazonaws.com', | 36 'us-west-1' : 'elasticloadbalancing.us-west-1.amazonaws.com', |
37 'eu-west-1' : 'elasticloadbalancing.eu-west-1.amazonaws.com', | 37 'eu-west-1' : 'elasticloadbalancing.eu-west-1.amazonaws.com', |
| 38 'ap-northeast-1' : 'elasticloadbalancing.ap-northeast-1.amazonaws.com', |
38 'ap-southeast-1' : 'elasticloadbalancing.ap-southeast-1.amazonaws.com'} | 39 'ap-southeast-1' : 'elasticloadbalancing.ap-southeast-1.amazonaws.com'} |
39 | 40 |
40 def regions(): | 41 def regions(): |
41 """ | 42 """ |
42 Get all available regions for the SDB service. | 43 Get all available regions for the SDB service. |
43 | 44 |
44 :rtype: list | 45 :rtype: list |
45 :return: A list of :class:`boto.RegionInfo` instances | 46 :return: A list of :class:`boto.RegionInfo` instances |
46 """ | 47 """ |
47 regions = [] | 48 regions = [] |
(...skipping 15 matching lines...) Expand all Loading... |
63 :return: A connection to the given region, or None if an invalid region | 64 :return: A connection to the given region, or None if an invalid region |
64 name is given | 65 name is given |
65 """ | 66 """ |
66 for region in regions(): | 67 for region in regions(): |
67 if region.name == region_name: | 68 if region.name == region_name: |
68 return region.connect(**kw_params) | 69 return region.connect(**kw_params) |
69 return None | 70 return None |
70 | 71 |
71 class ELBConnection(AWSQueryConnection): | 72 class ELBConnection(AWSQueryConnection): |
72 | 73 |
73 APIVersion = boto.config.get('Boto', 'elb_version', '2010-07-01') | 74 APIVersion = boto.config.get('Boto', 'elb_version', '2011-04-05') |
74 DefaultRegionName = boto.config.get('Boto', 'elb_region_name', 'us-east-1') | 75 DefaultRegionName = boto.config.get('Boto', 'elb_region_name', 'us-east-1') |
75 DefaultRegionEndpoint = boto.config.get('Boto', 'elb_region_endpoint', | 76 DefaultRegionEndpoint = boto.config.get('Boto', 'elb_region_endpoint', |
76 'elasticloadbalancing.amazonaws.com'
) | 77 'elasticloadbalancing.amazonaws.com'
) |
77 | 78 |
78 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, | 79 def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, |
79 is_secure=False, port=None, proxy=None, proxy_port=None, | 80 is_secure=False, port=None, proxy=None, proxy_port=None, |
80 proxy_user=None, proxy_pass=None, debug=0, | 81 proxy_user=None, proxy_pass=None, debug=0, |
81 https_connection_factory=None, region=None, path='/'): | 82 https_connection_factory=None, region=None, path='/'): |
82 """ | 83 """ |
83 Init method to create a new connection to EC2 Load Balancing Service. | 84 Init method to create a new connection to EC2 Load Balancing Service. |
(...skipping 11 matching lines...) Expand all Loading... |
95 proxy_user, proxy_pass, | 96 proxy_user, proxy_pass, |
96 self.region.endpoint, debug, | 97 self.region.endpoint, debug, |
97 https_connection_factory, path) | 98 https_connection_factory, path) |
98 | 99 |
99 def _required_auth_capability(self): | 100 def _required_auth_capability(self): |
100 return ['ec2'] | 101 return ['ec2'] |
101 | 102 |
102 def build_list_params(self, params, items, label): | 103 def build_list_params(self, params, items, label): |
103 if isinstance(items, str): | 104 if isinstance(items, str): |
104 items = [items] | 105 items = [items] |
105 for i in range(1, len(items)+1): | 106 for index, item in enumerate(items): |
106 params[label % i] = items[i-1] | 107 params[label % (index + 1)] = item |
107 | 108 |
108 def get_all_load_balancers(self, load_balancer_names=None): | 109 def get_all_load_balancers(self, load_balancer_names=None): |
109 """ | 110 """ |
110 Retrieve all load balancers associated with your account. | 111 Retrieve all load balancers associated with your account. |
111 | 112 |
112 :type load_balancer_names: list | 113 :type load_balancer_names: list |
113 :param load_balancer_names: An optional list of load balancer names | 114 :param load_balancer_names: An optional list of load balancer names |
114 | 115 |
115 :rtype: list | 116 :rtype: list |
116 :return: A list of :class:`boto.ec2.elb.loadbalancer.LoadBalancer` | 117 :return: A list of :class:`boto.ec2.elb.loadbalancer.LoadBalancer` |
117 """ | 118 """ |
118 params = {} | 119 params = {} |
119 if load_balancer_names: | 120 if load_balancer_names: |
120 self.build_list_params(params, load_balancer_names, 'LoadBalancerNam
es.member.%d') | 121 self.build_list_params(params, load_balancer_names, |
121 return self.get_list('DescribeLoadBalancers', params, [('member', LoadBa
lancer)]) | 122 'LoadBalancerNames.member.%d') |
122 | 123 return self.get_list('DescribeLoadBalancers', params, |
| 124 [('member', LoadBalancer)]) |
123 | 125 |
124 def create_load_balancer(self, name, zones, listeners): | 126 def create_load_balancer(self, name, zones, listeners): |
125 """ | 127 """ |
126 Create a new load balancer for your account. | 128 Create a new load balancer for your account. |
127 | 129 |
128 :type name: string | 130 :type name: string |
129 :param name: The mnemonic name associated with the new load balancer | 131 :param name: The mnemonic name associated with the new load balancer |
130 | 132 |
131 :type zones: List of strings | 133 :type zones: List of strings |
132 :param zones: The names of the availability zone(s) to add. | 134 :param zones: The names of the availability zone(s) to add. |
133 | 135 |
134 :type listeners: List of tuples | 136 :type listeners: List of tuples |
135 :param listeners: Each tuple contains three or four values, | 137 :param listeners: Each tuple contains three or four values, |
136 (LoadBalancerPortNumber, InstancePortNumber, Protocol, | 138 (LoadBalancerPortNumber, InstancePortNumber, |
137 [SSLCertificateId]) | 139 Protocol, [SSLCertificateId]) |
138 where LoadBalancerPortNumber and InstancePortNumber ar
e | 140 where LoadBalancerPortNumber and InstancePortNumber |
139 integer values between 1 and 65535, Protocol is a | 141 are integer values between 1 and 65535, Protocol is a |
140 string containing either 'TCP', 'HTTP' or 'HTTPS'; | 142 string containing either 'TCP', 'HTTP' or 'HTTPS'; |
141 SSLCertificateID is the ARN of a AWS AIM certificate, | 143 SSLCertificateID is the ARN of a AWS AIM certificate, |
142 and must be specified when doing HTTPS. | 144 and must be specified when doing HTTPS. |
143 | 145 |
144 :rtype: :class:`boto.ec2.elb.loadbalancer.LoadBalancer` | 146 :rtype: :class:`boto.ec2.elb.loadbalancer.LoadBalancer` |
145 :return: The newly created :class:`boto.ec2.elb.loadbalancer.LoadBalance
r` | 147 :return: The newly created :class:`boto.ec2.elb.loadbalancer.LoadBalance
r` |
146 """ | 148 """ |
147 params = {'LoadBalancerName' : name} | 149 params = {'LoadBalancerName' : name} |
148 for i in range(0, len(listeners)): | 150 for index, listener in enumerate(listeners): |
149 params['Listeners.member.%d.LoadBalancerPort' % (i+1)] = listeners[i
][0] | 151 i = index + 1 |
150 params['Listeners.member.%d.InstancePort' % (i+1)] = listeners[i][1] | 152 params['Listeners.member.%d.LoadBalancerPort' % i] = listener[0] |
151 params['Listeners.member.%d.Protocol' % (i+1)] = listeners[i][2] | 153 params['Listeners.member.%d.InstancePort' % i] = listener[1] |
152 if listeners[i][2]=='HTTPS': | 154 params['Listeners.member.%d.Protocol' % i] = listener[2] |
153 params['Listeners.member.%d.SSLCertificateId' % (i+1)] = listene
rs[i][3] | 155 if listener[2]=='HTTPS': |
| 156 params['Listeners.member.%d.SSLCertificateId' % i] = listener[3] |
154 self.build_list_params(params, zones, 'AvailabilityZones.member.%d') | 157 self.build_list_params(params, zones, 'AvailabilityZones.member.%d') |
155 load_balancer = self.get_object('CreateLoadBalancer', params, LoadBalanc
er) | 158 load_balancer = self.get_object('CreateLoadBalancer', |
| 159 params, LoadBalancer) |
156 load_balancer.name = name | 160 load_balancer.name = name |
157 load_balancer.listeners = listeners | 161 load_balancer.listeners = listeners |
158 load_balancer.availability_zones = zones | 162 load_balancer.availability_zones = zones |
159 return load_balancer | 163 return load_balancer |
160 | 164 |
161 def create_load_balancer_listeners(self, name, listeners): | 165 def create_load_balancer_listeners(self, name, listeners): |
162 """ | 166 """ |
163 Creates a Listener (or group of listeners) for an existing Load Balancer | 167 Creates a Listener (or group of listeners) for an existing Load Balancer |
164 | 168 |
165 :type name: string | 169 :type name: string |
166 :param name: The name of the load balancer to create the listeners for | 170 :param name: The name of the load balancer to create the listeners for |
167 | 171 |
168 :type listeners: List of tuples | 172 :type listeners: List of tuples |
169 :param listeners: Each tuple contains three values, | 173 :param listeners: Each tuple contains three values, |
170 (LoadBalancerPortNumber, InstancePortNumber, Protocol, | 174 (LoadBalancerPortNumber, InstancePortNumber, Protocol, |
171 [SSLCertificateId]) | 175 [SSLCertificateId]) |
172 where LoadBalancerPortNumber and InstancePortNumber ar
e | 176 where LoadBalancerPortNumber and InstancePortNumber ar
e |
173 integer values between 1 and 65535, Protocol is a | 177 integer values between 1 and 65535, Protocol is a |
174 string containing either 'TCP', 'HTTP' or 'HTTPS'; | 178 string containing either 'TCP', 'HTTP' or 'HTTPS'; |
175 SSLCertificateID is the ARN of a AWS AIM certificate, | 179 SSLCertificateID is the ARN of a AWS AIM certificate, |
176 and must be specified when doing HTTPS. | 180 and must be specified when doing HTTPS. |
177 | 181 |
178 :return: The status of the request | 182 :return: The status of the request |
179 """ | 183 """ |
180 params = {'LoadBalancerName' : name} | 184 params = {'LoadBalancerName' : name} |
181 for i in range(0, len(listeners)): | 185 for index, listener in enumerate(listeners): |
182 params['Listeners.member.%d.LoadBalancerPort' % (i+1)] = listeners[i
][0] | 186 i = index + 1 |
183 params['Listeners.member.%d.InstancePort' % (i+1)] = listeners[i][1] | 187 params['Listeners.member.%d.LoadBalancerPort' % i] = listener[0] |
184 params['Listeners.member.%d.Protocol' % (i+1)] = listeners[i][2] | 188 params['Listeners.member.%d.InstancePort' % i] = listener[1] |
185 if listeners[i][2]=='HTTPS': | 189 params['Listeners.member.%d.Protocol' % i] = listener[2] |
186 params['Listeners.member.%d.SSLCertificateId' % (i+1)] = listene
rs[i][3] | 190 if listener[2]=='HTTPS': |
| 191 params['Listeners.member.%d.SSLCertificateId' % i] = listener[3] |
187 return self.get_status('CreateLoadBalancerListeners', params) | 192 return self.get_status('CreateLoadBalancerListeners', params) |
188 | 193 |
189 | 194 |
190 def delete_load_balancer(self, name): | 195 def delete_load_balancer(self, name): |
191 """ | 196 """ |
192 Delete a Load Balancer from your account. | 197 Delete a Load Balancer from your account. |
193 | 198 |
194 :type name: string | 199 :type name: string |
195 :param name: The name of the Load Balancer to delete | 200 :param name: The name of the Load Balancer to delete |
196 """ | 201 """ |
197 params = {'LoadBalancerName': name} | 202 params = {'LoadBalancerName': name} |
198 return self.get_status('DeleteLoadBalancer', params) | 203 return self.get_status('DeleteLoadBalancer', params) |
199 | 204 |
200 def delete_load_balancer_listeners(self, name, ports): | 205 def delete_load_balancer_listeners(self, name, ports): |
201 """ | 206 """ |
202 Deletes a load balancer listener (or group of listeners) | 207 Deletes a load balancer listener (or group of listeners) |
203 | 208 |
204 :type name: string | 209 :type name: string |
205 :param name: The name of the load balancer to create the listeners for | 210 :param name: The name of the load balancer to create the listeners for |
206 | 211 |
207 :type ports: List int | 212 :type ports: List int |
208 :param ports: Each int represents the port on the ELB to be removed | 213 :param ports: Each int represents the port on the ELB to be removed |
209 | 214 |
210 :return: The status of the request | 215 :return: The status of the request |
211 """ | 216 """ |
212 params = {'LoadBalancerName' : name} | 217 params = {'LoadBalancerName' : name} |
213 for i in range(0, len(ports)): | 218 for index, port in enumerate(ports): |
214 params['LoadBalancerPorts.member.%d' % (i+1)] = ports[i] | 219 params['LoadBalancerPorts.member.%d' % (index + 1)] = port |
215 return self.get_status('DeleteLoadBalancerListeners', params) | 220 return self.get_status('DeleteLoadBalancerListeners', params) |
216 | 221 |
217 | |
218 | |
219 def enable_availability_zones(self, load_balancer_name, zones_to_add): | 222 def enable_availability_zones(self, load_balancer_name, zones_to_add): |
220 """ | 223 """ |
221 Add availability zones to an existing Load Balancer | 224 Add availability zones to an existing Load Balancer |
222 All zones must be in the same region as the Load Balancer | 225 All zones must be in the same region as the Load Balancer |
223 Adding zones that are already registered with the Load Balancer | 226 Adding zones that are already registered with the Load Balancer |
224 has no effect. | 227 has no effect. |
225 | 228 |
226 :type load_balancer_name: string | 229 :type load_balancer_name: string |
227 :param load_balancer_name: The name of the Load Balancer | 230 :param load_balancer_name: The name of the Load Balancer |
228 | 231 |
229 :type zones: List of strings | 232 :type zones: List of strings |
230 :param zones: The name of the zone(s) to add. | 233 :param zones: The name of the zone(s) to add. |
231 | 234 |
232 :rtype: List of strings | 235 :rtype: List of strings |
233 :return: An updated list of zones for this Load Balancer. | 236 :return: An updated list of zones for this Load Balancer. |
234 | 237 |
235 """ | 238 """ |
236 params = {'LoadBalancerName' : load_balancer_name} | 239 params = {'LoadBalancerName' : load_balancer_name} |
237 self.build_list_params(params, zones_to_add, 'AvailabilityZones.member.%
d') | 240 self.build_list_params(params, zones_to_add, |
238 return self.get_list('EnableAvailabilityZonesForLoadBalancer', params, N
one) | 241 'AvailabilityZones.member.%d') |
| 242 return self.get_list('EnableAvailabilityZonesForLoadBalancer', |
| 243 params, None) |
239 | 244 |
240 def disable_availability_zones(self, load_balancer_name, zones_to_remove): | 245 def disable_availability_zones(self, load_balancer_name, zones_to_remove): |
241 """ | 246 """ |
242 Remove availability zones from an existing Load Balancer. | 247 Remove availability zones from an existing Load Balancer. |
243 All zones must be in the same region as the Load Balancer. | 248 All zones must be in the same region as the Load Balancer. |
244 Removing zones that are not registered with the Load Balancer | 249 Removing zones that are not registered with the Load Balancer |
245 has no effect. | 250 has no effect. |
246 You cannot remove all zones from an Load Balancer. | 251 You cannot remove all zones from an Load Balancer. |
247 | 252 |
248 :type load_balancer_name: string | 253 :type load_balancer_name: string |
249 :param load_balancer_name: The name of the Load Balancer | 254 :param load_balancer_name: The name of the Load Balancer |
250 | 255 |
251 :type zones: List of strings | 256 :type zones: List of strings |
252 :param zones: The name of the zone(s) to remove. | 257 :param zones: The name of the zone(s) to remove. |
253 | 258 |
254 :rtype: List of strings | 259 :rtype: List of strings |
255 :return: An updated list of zones for this Load Balancer. | 260 :return: An updated list of zones for this Load Balancer. |
256 | 261 |
257 """ | 262 """ |
258 params = {'LoadBalancerName' : load_balancer_name} | 263 params = {'LoadBalancerName' : load_balancer_name} |
259 self.build_list_params(params, zones_to_remove, 'AvailabilityZones.membe
r.%d') | 264 self.build_list_params(params, zones_to_remove, |
260 return self.get_list('DisableAvailabilityZonesForLoadBalancer', params,
None) | 265 'AvailabilityZones.member.%d') |
| 266 return self.get_list('DisableAvailabilityZonesForLoadBalancer', |
| 267 params, None) |
261 | 268 |
262 def register_instances(self, load_balancer_name, instances): | 269 def register_instances(self, load_balancer_name, instances): |
263 """ | 270 """ |
264 Add new Instances to an existing Load Balancer. | 271 Add new Instances to an existing Load Balancer. |
265 | 272 |
266 :type load_balancer_name: string | 273 :type load_balancer_name: string |
267 :param load_balancer_name: The name of the Load Balancer | 274 :param load_balancer_name: The name of the Load Balancer |
268 | 275 |
269 :type instances: List of strings | 276 :type instances: List of strings |
270 :param instances: The instance ID's of the EC2 instances to add. | 277 :param instances: The instance ID's of the EC2 instances to add. |
271 | 278 |
272 :rtype: List of strings | 279 :rtype: List of strings |
273 :return: An updated list of instances for this Load Balancer. | 280 :return: An updated list of instances for this Load Balancer. |
274 | 281 |
275 """ | 282 """ |
276 params = {'LoadBalancerName' : load_balancer_name} | 283 params = {'LoadBalancerName' : load_balancer_name} |
277 self.build_list_params(params, instances, 'Instances.member.%d.InstanceI
d') | 284 self.build_list_params(params, instances, |
278 return self.get_list('RegisterInstancesWithLoadBalancer', params, [('mem
ber', InstanceInfo)]) | 285 'Instances.member.%d.InstanceId') |
| 286 return self.get_list('RegisterInstancesWithLoadBalancer', |
| 287 params, [('member', InstanceInfo)]) |
279 | 288 |
280 def deregister_instances(self, load_balancer_name, instances): | 289 def deregister_instances(self, load_balancer_name, instances): |
281 """ | 290 """ |
282 Remove Instances from an existing Load Balancer. | 291 Remove Instances from an existing Load Balancer. |
283 | 292 |
284 :type load_balancer_name: string | 293 :type load_balancer_name: string |
285 :param load_balancer_name: The name of the Load Balancer | 294 :param load_balancer_name: The name of the Load Balancer |
286 | 295 |
287 :type instances: List of strings | 296 :type instances: List of strings |
288 :param instances: The instance ID's of the EC2 instances to remove. | 297 :param instances: The instance ID's of the EC2 instances to remove. |
289 | 298 |
290 :rtype: List of strings | 299 :rtype: List of strings |
291 :return: An updated list of instances for this Load Balancer. | 300 :return: An updated list of instances for this Load Balancer. |
292 | 301 |
293 """ | 302 """ |
294 params = {'LoadBalancerName' : load_balancer_name} | 303 params = {'LoadBalancerName' : load_balancer_name} |
295 self.build_list_params(params, instances, 'Instances.member.%d.InstanceI
d') | 304 self.build_list_params(params, instances, |
296 return self.get_list('DeregisterInstancesFromLoadBalancer', params, [('m
ember', InstanceInfo)]) | 305 'Instances.member.%d.InstanceId') |
| 306 return self.get_list('DeregisterInstancesFromLoadBalancer', |
| 307 params, [('member', InstanceInfo)]) |
297 | 308 |
298 def describe_instance_health(self, load_balancer_name, instances=None): | 309 def describe_instance_health(self, load_balancer_name, instances=None): |
299 """ | 310 """ |
300 Get current state of all Instances registered to an Load Balancer. | 311 Get current state of all Instances registered to an Load Balancer. |
301 | 312 |
302 :type load_balancer_name: string | 313 :type load_balancer_name: string |
303 :param load_balancer_name: The name of the Load Balancer | 314 :param load_balancer_name: The name of the Load Balancer |
304 | 315 |
305 :type instances: List of strings | 316 :type instances: List of strings |
306 :param instances: The instance ID's of the EC2 instances | 317 :param instances: The instance ID's of the EC2 instances |
307 to return status for. If not provided, | 318 to return status for. If not provided, |
308 the state of all instances will be returned. | 319 the state of all instances will be returned. |
309 | 320 |
310 :rtype: List of :class:`boto.ec2.elb.instancestate.InstanceState` | 321 :rtype: List of :class:`boto.ec2.elb.instancestate.InstanceState` |
311 :return: list of state info for instances in this Load Balancer. | 322 :return: list of state info for instances in this Load Balancer. |
312 | 323 |
313 """ | 324 """ |
314 params = {'LoadBalancerName' : load_balancer_name} | 325 params = {'LoadBalancerName' : load_balancer_name} |
315 if instances: | 326 if instances: |
316 self.build_list_params(params, instances, 'Instances.member.%d.Insta
nceId') | 327 self.build_list_params(params, instances, |
317 return self.get_list('DescribeInstanceHealth', params, [('member', Insta
nceState)]) | 328 'Instances.member.%d.InstanceId') |
| 329 return self.get_list('DescribeInstanceHealth', params, |
| 330 [('member', InstanceState)]) |
318 | 331 |
319 def configure_health_check(self, name, health_check): | 332 def configure_health_check(self, name, health_check): |
320 """ | 333 """ |
321 Define a health check for the EndPoints. | 334 Define a health check for the EndPoints. |
322 | 335 |
323 :type name: string | 336 :type name: string |
324 :param name: The mnemonic name associated with the new access point | 337 :param name: The mnemonic name associated with the load balancer |
325 | 338 |
326 :type health_check: :class:`boto.ec2.elb.healthcheck.HealthCheck` | 339 :type health_check: :class:`boto.ec2.elb.healthcheck.HealthCheck` |
327 :param health_check: A HealthCheck object populated with the desired | 340 :param health_check: A HealthCheck object populated with the desired |
328 values. | 341 values. |
329 | 342 |
330 :rtype: :class:`boto.ec2.elb.healthcheck.HealthCheck` | 343 :rtype: :class:`boto.ec2.elb.healthcheck.HealthCheck` |
331 :return: The updated :class:`boto.ec2.elb.healthcheck.HealthCheck` | 344 :return: The updated :class:`boto.ec2.elb.healthcheck.HealthCheck` |
332 """ | 345 """ |
333 params = {'LoadBalancerName' : name, | 346 params = {'LoadBalancerName' : name, |
334 'HealthCheck.Timeout' : health_check.timeout, | 347 'HealthCheck.Timeout' : health_check.timeout, |
335 'HealthCheck.Target' : health_check.target, | 348 'HealthCheck.Target' : health_check.target, |
336 'HealthCheck.Interval' : health_check.interval, | 349 'HealthCheck.Interval' : health_check.interval, |
337 'HealthCheck.UnhealthyThreshold' : health_check.unhealthy_thre
shold, | 350 'HealthCheck.UnhealthyThreshold' : health_check.unhealthy_thre
shold, |
338 'HealthCheck.HealthyThreshold' : health_check.healthy_threshol
d} | 351 'HealthCheck.HealthyThreshold' : health_check.healthy_threshol
d} |
339 return self.get_object('ConfigureHealthCheck', params, HealthCheck) | 352 return self.get_object('ConfigureHealthCheck', params, HealthCheck) |
340 | 353 |
341 def set_lb_listener_SSL_certificate(self, lb_name, lb_port, ssl_certificate_
id): | 354 def set_lb_listener_SSL_certificate(self, lb_name, lb_port, |
| 355 ssl_certificate_id): |
342 """ | 356 """ |
343 Sets the certificate that terminates the specified listener's SSL | 357 Sets the certificate that terminates the specified listener's SSL |
344 connections. The specified certificate replaces any prior certificate | 358 connections. The specified certificate replaces any prior certificate |
345 that was used on the same LoadBalancer and port. | 359 that was used on the same LoadBalancer and port. |
346 """ | 360 """ |
347 params = { | 361 params = { |
348 'LoadBalancerName' : lb_name, | 362 'LoadBalancerName' : lb_name, |
349 'LoadBalancerPort' : lb_port, | 363 'LoadBalancerPort' : lb_port, |
350 'SSLCertificateId' : ssl_certificate_id, | 364 'SSLCertificateId' : ssl_certificate_id, |
351 } | 365 } |
(...skipping 15 matching lines...) Expand all Loading... |
367 If the application cookie is explicitly removed or expires, the session | 381 If the application cookie is explicitly removed or expires, the session |
368 stops being sticky until a new application cookie is issued. | 382 stops being sticky until a new application cookie is issued. |
369 """ | 383 """ |
370 params = { | 384 params = { |
371 'CookieName' : name, | 385 'CookieName' : name, |
372 'LoadBalancerName' : lb_name, | 386 'LoadBalancerName' : lb_name, |
373 'PolicyName' : policy_name, | 387 'PolicyName' : policy_name, |
374 } | 388 } |
375 return self.get_status('CreateAppCookieStickinessPolicy', params) | 389 return self.get_status('CreateAppCookieStickinessPolicy', params) |
376 | 390 |
377 def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, lb_na
me, policy_name): | 391 def create_lb_cookie_stickiness_policy(self, cookie_expiration_period, |
| 392 lb_name, policy_name): |
378 """ | 393 """ |
379 Generates a stickiness policy with sticky session lifetimes controlled | 394 Generates a stickiness policy with sticky session lifetimes controlled |
380 by the lifetime of the browser (user-agent) or a specified expiration | 395 by the lifetime of the browser (user-agent) or a specified expiration |
381 period. This policy can only be associated only with HTTP listeners. | 396 period. This policy can only be associated only with HTTP listeners. |
382 | 397 |
383 When a load balancer implements this policy, the load balancer uses a | 398 When a load balancer implements this policy, the load balancer uses a |
384 special cookie to track the backend server instance for each request. | 399 special cookie to track the backend server instance for each request. |
385 When the load balancer receives a request, it first checks to see if | 400 When the load balancer receives a request, it first checks to see if |
386 this cookie is present in the request. If so, the load balancer sends | 401 this cookie is present in the request. If so, the load balancer sends |
387 the request to the application server specified in the cookie. If not, | 402 the request to the application server specified in the cookie. If not, |
(...skipping 30 matching lines...) Expand all Loading... |
418 with a listener. | 433 with a listener. |
419 """ | 434 """ |
420 params = { | 435 params = { |
421 'LoadBalancerName' : lb_name, | 436 'LoadBalancerName' : lb_name, |
422 'LoadBalancerPort' : lb_port, | 437 'LoadBalancerPort' : lb_port, |
423 } | 438 } |
424 self.build_list_params(params, policies, 'PolicyNames.member.%d') | 439 self.build_list_params(params, policies, 'PolicyNames.member.%d') |
425 return self.get_status('SetLoadBalancerPoliciesOfListener', params) | 440 return self.get_status('SetLoadBalancerPoliciesOfListener', params) |
426 | 441 |
427 | 442 |
OLD | NEW |