Return-Path: X-Original-To: apmail-jclouds-user-archive@minotaur.apache.org Delivered-To: apmail-jclouds-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9407A17A44 for ; Mon, 20 Oct 2014 08:34:56 +0000 (UTC) Received: (qmail 32670 invoked by uid 500); 20 Oct 2014 08:34:56 -0000 Delivered-To: apmail-jclouds-user-archive@jclouds.apache.org Received: (qmail 32610 invoked by uid 500); 20 Oct 2014 08:34:56 -0000 Mailing-List: contact user-help@jclouds.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@jclouds.apache.org Delivered-To: mailing list user@jclouds.apache.org Received: (qmail 32601 invoked by uid 99); 20 Oct 2014 08:34:56 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Oct 2014 08:34:56 +0000 Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 4D3721A0379 for ; Mon, 20 Oct 2014 08:34:30 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id wp4so3480811obc.10 for ; Mon, 20 Oct 2014 01:34:46 -0700 (PDT) X-Received: by 10.182.19.195 with SMTP id h3mr864448obe.47.1413794086686; Mon, 20 Oct 2014 01:34:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.86.36 with HTTP; Mon, 20 Oct 2014 01:34:26 -0700 (PDT) In-Reply-To: References: From: Ignasi Barrera Date: Mon, 20 Oct 2014 10:34:26 +0200 Message-ID: Subject: Re: Register new instance with existing load balancer To: "user@jclouds.apache.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Yaron, To do that you need to directly access the AWS ELB API, as that functionality is still not supported in the portable load balancer abstraction provided by the LoadBalancerService (just FTR there is already feature request to improve that abstraction [1]). You can get that API in two ways: You can extract it from the context you already have by doing: ELBApi api =3D elb.unwrapApi(ELBApi.class); or you can create the api directly instead of creating the LoadBalancerServiceContext (if you're not going to use the portable LoadBalancerService): ELBApi api =3D ContextBuilder.newBuilder("aws-elb").credentials(awsAccessKe= yId, awsSecretKey).buildApi(ELBApi.class); Once you have the ELBApi, you can register the nodes in the load balancer as follows: api.getInstanceApi().registerInstanceWithLoadBalancer(instanceId, loadBalancerName); HTH! I. [1] https://issues.apache.org/jira/browse/JCLOUDS-483 On 19 October 2014 12:24, Yaron Rosenbaum wrote= : > Hi > > I would like to register a newly created instance with an existing load > balancer. > My cloud provider is AWS. > > Thus far, I was able to get a context (not even sure if this is correct) > private LoadBalancerServiceContext elb =3D > ContextBuilder.newBuilder(=E2=80=9Caws-elb").credentials(awsAccessKeyId,a= wsSecretKey).buildView(LoadBalancerServiceContext.class); > > From this, I think I can do: > elb.getLoadBalancerService(). > > but there=E2=80=99s no methods for setting nodes to an existing LB, unles= s I want to > create a new LoadBalancer (which I don=E2=80=99t) > > Thanks > > (Y) >