OLD | NEW |
1 # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2006-2009 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 # |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return self.connection.create_load_balancer_listeners(self.name, listene
rs) | 160 return self.connection.create_load_balancer_listeners(self.name, listene
rs) |
161 | 161 |
162 def create_listener(self, inPort, outPort=None, proto="tcp"): | 162 def create_listener(self, inPort, outPort=None, proto="tcp"): |
163 if outPort == None: | 163 if outPort == None: |
164 outPort = inPort | 164 outPort = inPort |
165 return self.create_listeners([(inPort, outPort, proto)]) | 165 return self.create_listeners([(inPort, outPort, proto)]) |
166 | 166 |
167 def delete_listeners(self, listeners): | 167 def delete_listeners(self, listeners): |
168 return self.connection.delete_load_balancer_listeners(self.name, listene
rs) | 168 return self.connection.delete_load_balancer_listeners(self.name, listene
rs) |
169 | 169 |
170 def delete_listener(self, inPort, outPort=None, proto="tcp"): | 170 def delete_listener(self, inPort): |
171 if outPort == None: | 171 return self.delete_listeners([inPort]) |
172 outPort = inPort | |
173 return self.delete_listeners([(inPort, outPort, proto)]) | |
174 | 172 |
175 def delete_policy(self, policy_name): | 173 def delete_policy(self, policy_name): |
176 """ | 174 """ |
177 Deletes a policy from the LoadBalancer. The specified policy must not | 175 Deletes a policy from the LoadBalancer. The specified policy must not |
178 be enabled for any listeners. | 176 be enabled for any listeners. |
179 """ | 177 """ |
180 return self.connection.delete_lb_policy(self.name, policy_name) | 178 return self.connection.delete_lb_policy(self.name, policy_name) |
181 | 179 |
182 def set_policies_of_listener(self, lb_port, policies): | 180 def set_policies_of_listener(self, lb_port, policies): |
183 return self.connection.set_lb_policies_of_listener(self.name, lb_port, p
olicies) | 181 return self.connection.set_lb_policies_of_listener(self.name, lb_port, p
olicies) |
184 | 182 |
185 def create_cookie_stickiness_policy(self, cookie_expiration_period, policy_n
ame): | 183 def create_cookie_stickiness_policy(self, cookie_expiration_period, policy_n
ame): |
186 return self.connection.create_lb_cookie_stickiness_policy(cookie_expirat
ion_period, self.name, policy_name) | 184 return self.connection.create_lb_cookie_stickiness_policy(cookie_expirat
ion_period, self.name, policy_name) |
187 | 185 |
188 def create_app_cookie_stickiness_policy(self, name, policy_name): | 186 def create_app_cookie_stickiness_policy(self, name, policy_name): |
189 return self.connection.create_app_cookie_stickiness_policy(name, self.na
me, policy_name) | 187 return self.connection.create_app_cookie_stickiness_policy(name, self.na
me, policy_name) |
190 | 188 |
191 def set_listener_SSL_certificate(self, lb_port, ssl_certificate_id): | 189 def set_listener_SSL_certificate(self, lb_port, ssl_certificate_id): |
192 return self.connection.set_lb_listener_SSL_certificate(self.name, lb_por
t, ssl_certificate_id) | 190 return self.connection.set_lb_listener_SSL_certificate(self.name, lb_por
t, ssl_certificate_id) |
193 | 191 |
OLD | NEW |