jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nipun Udara <y.b.n.ud...@gmail.com>
Subject Re: Ec2 Load balancer example
Date Mon, 16 Mar 2015 15:18:01 GMT
Hi

Thank you for the given example

Regards

On Mon, Mar 16, 2015 at 7:23 AM, Yaron Rosenbaum <yaron.rosenbaum@gmail.com>
wrote:

> Nipun,
> For what it’s worth:
>
> <dependency>
> <groupId>org.apache.jclouds.labs</groupId>
> <artifactId>aws-elb</artifactId>
> <version>1.8.0</version>
> </dependency>
>
>
> import org.jclouds.elb.ELBApi;
>
> private synchronized ELBApi getLoadBalancer() {
> if (null == _elb) _elb = ContextBuilder.newBuilder("aws-elb").credentials(getAccount(),
> getSecret()).buildApi(ELBApi.class);
> return _elb;
> }
>
> @Override
> public void addServerToLoadBalancer(ComputeMetadata node, final
> MetaLocation location) {
> getLoadBalancer().getInstanceApiForRegion(location
> .getRegion()).registerInstanceWithLoadBalancer(node.getProviderId(),
> location.getLoadBalancerName());
> }
>
>
> @Override
> public void removeServerFromLoadBalancer(ComputeMetadata node, final
> MetaLocation location) {
> getLoadBalancer().getInstanceApiForRegion(location
> .getRegion()).deregisterInstanceFromLoadBalancer(node.getProviderId(),
> location.getLoadBalancerName());
> }
>
> MetaLocation is not a jClouds API, nor is getAccount() and getSecret(),
> but you get the gist of it.
>
> Maybe it would be a good idea to add something like this to the wiki.
>
> (Y)
>
> On Mar 16, 2015, at 9:57 AM, Nipun Udara <y.b.n.udara@gmail.com> wrote:
>
> Hi all
>
> Is there any examples for using aws elastic loadbalancer with jclouds
>
> Regards
> Nipun Udara
>
>
>
>
>


-- 
Nipun Udara

*Undergraduate*
*Department of Computer Science & Engineering*
*University of Moratuwa*
*Sri Lanka*

Mime
View raw message