~ubuntu-branches/ubuntu/oneiric/python-boto/oneiric

« back to all changes in this revision

Viewing changes to boto/ec2/elb/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Moser
  • Date: 2010-01-05 15:12:37 UTC
  • mfrom: (4.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100105151237-skgxjkyogir1vl0k
Tags: 1.9b-1ubuntu1
* merge Loic's changes made in 1.8d-1ubuntu2
* Rename Vcs-* to XS-Debian-Vcs-*.
* Run testsuite during build but ignore failures since it currently doesn't
  pass.
* Add ${misc:Depends}.
* Add XB-Python-Version: ${python:Versions}.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        for i in range(1, len(items)+1):
57
57
            params[label % i] = items[i-1]
58
58
 
59
 
    def get_all_load_balancers(self, load_balancer_names=None):
 
59
    def get_all_load_balancers(self, load_balancer_name=None):
60
60
        """
61
61
        Retrieve all load balancers associated with your account.
62
62
 
63
 
        @type load_balancer_names: list
64
 
        @param load_balancer_names: A list of strings of load balancer names
 
63
        :type load_balancer_names: str
 
64
        :param load_balancer_names: An optional filter string to get only one ELB
65
65
 
66
 
        @rtype: list
67
 
        @return: A list of L{LoadBalancer<boto.ec2.elb.loadbalancer.LoadBalancer>}
 
66
        :rtype: list
 
67
        :return: A list of :class:`boto.ec2.elb.loadbalancer.LoadBalancer`
68
68
        """
69
69
        params = {}
70
 
        if load_balancer_names:
71
 
            self.build_list_params(params, load_balancer_names, 'LoadBalancerName.%d')
 
70
        if load_balancer_name:
 
71
            #self.build_list_params(params, load_balancer_names, 'LoadBalancerName.%d')
 
72
            params['LoadBalancerName'] = load_balancer_name
72
73
        return self.get_list('DescribeLoadBalancers', params, [('member', LoadBalancer)])
73
74
 
74
75
 
76
77
        """
77
78
        Create a new load balancer for your account.
78
79
 
79
 
        @type name: string
80
 
        @param name: The mnemonic name associated with the new load balancer
81
 
 
82
 
        @type zones: List of strings
83
 
        @param zones: The names of the availability zone(s) to add.
84
 
 
85
 
        @type listeners: List of tuples
86
 
        @param listeners: Each tuple contains three values.
 
80
        :type name: string
 
81
        :param name: The mnemonic name associated with the new load balancer
 
82
 
 
83
        :type zones: List of strings
 
84
        :param zones: The names of the availability zone(s) to add.
 
85
 
 
86
        :type listeners: List of tuples
 
87
        :param listeners: Each tuple contains three values.
87
88
                          (LoadBalancerPortNumber, InstancePortNumber, Protocol)
88
89
                          where LoadBalancerPortNumber and InstancePortNumber are
89
90
                          integer values between 1 and 65535 and Protocol is a
90
91
                          string containing either 'TCP' or 'HTTP'.
91
92
 
92
 
        @rtype: L{AccessPoint<boto.ec2.elb.loadbalancer.LoadBalancer}
93
 
        @return: The newly created L{LoadBalancer<boto.ec2.elb.loadbalancer.LoadBalancer}
 
93
        :rtype: :class:`boto.ec2.elb.loadbalancer.LoadBalancer`
 
94
        :return: The newly created :class:`boto.ec2.elb.loadbalancer.LoadBalancer`
94
95
        """
95
96
        params = {'LoadBalancerName' : name}
96
97
        for i in range(0, len(listeners)):
108
109
        """
109
110
        Delete a Load Balancer from your account.
110
111
 
111
 
        @type name: string
112
 
        @param name: The name of the Load Balancer to delete
 
112
        :type name: string
 
113
        :param name: The name of the Load Balancer to delete
113
114
        """
114
115
        params = {'LoadBalancerName': name}
115
116
        return self.get_status('DeleteLoadBalancer', params)
121
122
        Adding zones that are already registered with the Load Balancer
122
123
        has no effect.
123
124
 
124
 
        @type load_balancer_name: string
125
 
        @param load_balancer_name: The name of the Load Balancer
126
 
 
127
 
        @type zones: List of strings
128
 
        @param zones: The name of the zone(s) to add.
129
 
 
130
 
        @rtype: List of strings
131
 
        @return: An updated list of zones for this Load Balancer.
 
125
        :type load_balancer_name: string
 
126
        :param load_balancer_name: The name of the Load Balancer
 
127
 
 
128
        :type zones: List of strings
 
129
        :param zones: The name of the zone(s) to add.
 
130
 
 
131
        :rtype: List of strings
 
132
        :return: An updated list of zones for this Load Balancer.
132
133
 
133
134
        """
134
135
        params = {'LoadBalancerName' : load_balancer_name}
143
144
        has no effect.
144
145
        You cannot remove all zones from an Load Balancer.
145
146
 
146
 
        @type load_balancer_name: string
147
 
        @param load_balancer_name: The name of the Load Balancer
148
 
 
149
 
        @type zones: List of strings
150
 
        @param zones: The name of the zone(s) to remove.
151
 
 
152
 
        @rtype: List of strings
153
 
        @return: An updated list of zones for this Load Balancer.
 
147
        :type load_balancer_name: string
 
148
        :param load_balancer_name: The name of the Load Balancer
 
149
 
 
150
        :type zones: List of strings
 
151
        :param zones: The name of the zone(s) to remove.
 
152
 
 
153
        :rtype: List of strings
 
154
        :return: An updated list of zones for this Load Balancer.
154
155
 
155
156
        """
156
157
        params = {'LoadBalancerName' : load_balancer_name}
161
162
        """
162
163
        Add new Instances to an existing Load Balancer.
163
164
 
164
 
        @type load_balancer_name: string
165
 
        @param load_balancer_name: The name of the Load Balancer
166
 
 
167
 
        @type instances: List of strings
168
 
        @param instances: The instance ID's of the EC2 instances to add.
169
 
 
170
 
        @rtype: List of strings
171
 
        @return: An updated list of instances for this Load Balancer.
 
165
        :type load_balancer_name: string
 
166
        :param load_balancer_name: The name of the Load Balancer
 
167
 
 
168
        :type instances: List of strings
 
169
        :param instances: The instance ID's of the EC2 instances to add.
 
170
 
 
171
        :rtype: List of strings
 
172
        :return: An updated list of instances for this Load Balancer.
172
173
 
173
174
        """
174
175
        params = {'LoadBalancerName' : load_balancer_name}
179
180
        """
180
181
        Remove Instances from an existing Load Balancer.
181
182
 
182
 
        @type load_balancer_name: string
183
 
        @param load_balancer_name: The name of the Load Balancer
184
 
 
185
 
        @type instances: List of strings
186
 
        @param instances: The instance ID's of the EC2 instances to remove.
187
 
 
188
 
        @rtype: List of strings
189
 
        @return: An updated list of instances for this Load Balancer.
 
183
        :type load_balancer_name: string
 
184
        :param load_balancer_name: The name of the Load Balancer
 
185
 
 
186
        :type instances: List of strings
 
187
        :param instances: The instance ID's of the EC2 instances to remove.
 
188
 
 
189
        :rtype: List of strings
 
190
        :return: An updated list of instances for this Load Balancer.
190
191
 
191
192
        """
192
193
        params = {'LoadBalancerName' : load_balancer_name}
197
198
        """
198
199
        Get current state of all Instances registered to an Load Balancer.
199
200
 
200
 
        @type load_balancer_name: string
201
 
        @param load_balancer_name: The name of the Load Balancer
 
201
        :type load_balancer_name: string
 
202
        :param load_balancer_name: The name of the Load Balancer
202
203
 
203
 
        @type instances: List of strings
204
 
        @param instances: The instance ID's of the EC2 instances
 
204
        :type instances: List of strings
 
205
        :param instances: The instance ID's of the EC2 instances
205
206
                          to return status for.  If not provided,
206
207
                          the state of all instances will be returned.
207
208
 
208
 
        @rtype: List of L{InstanceState<boto.ec2.elb.instancestate.InstanceState>}
209
 
        @return: list of state info for instances in this Load Balancer.
 
209
        :rtype: List of :class:`boto.ec2.elb.instancestate.InstanceState`
 
210
        :return: list of state info for instances in this Load Balancer.
210
211
 
211
212
        """
212
213
        params = {'LoadBalancerName' : load_balancer_name}
218
219
        """
219
220
        Define a health check for the EndPoints.
220
221
 
221
 
        @type name: string
222
 
        @param name: The mnemonic name associated with the new access point
 
222
        :type name: string
 
223
        :param name: The mnemonic name associated with the new access point
223
224
 
224
 
        @type health_check: L{HealthCheck<boto.ec2.elb.healthcheck.HealthCheck>}
225
 
        @param health_check: A HealthCheck object populated with the desired
 
225
        :type health_check: :class:`boto.ec2.elb.healthcheck.HealthCheck`
 
226
        :param health_check: A HealthCheck object populated with the desired
226
227
                             values.
227
228
 
228
 
        @rtype: L{HealthCheck<boto.ec2.elb.healthcheck.HealthCheck}
229
 
        @return: The updated L{HealthCheck<boto.ec2.elb.healthcheck.HealthCheck}
 
229
        :rtype: :class:`boto.ec2.elb.healthcheck.HealthCheck`
 
230
        :return: The updated :class:`boto.ec2.elb.healthcheck.HealthCheck`
230
231
        """
231
232
        params = {'LoadBalancerName' : name,
232
233
                  'HealthCheck.Timeout' : health_check.timeout,