That's right, but you'll have to also rename the "@PayloadParam" from
pool to address.

On 21 August 2014 14:07, Udara Liyanage <udaraliyan...@gmail.com> wrote:
> Hi Ignasi,
>
> I am trying to figure out how the response is generated by looking at method
> declaration and know requests.
>
> For instance, if I change the method as
>
> @Payload("%7B\"addFloatingIp\":%7B\"address\":\"{address}\",\"interface\":\"{interface}\"%7D%7D")
> FloatingIP allocateFromPool(@PayloadParam("pool") String pool,
> @PayloadParam("interface") String interface);
>
> Will the  HTTP request generated would be as below.
>
> {
>     "addFloatingIp": {
>         "address": "10.10.10.1","interface":"eth1"
>     }
> }
>
>
>
> On Thu, Aug 21, 2014 at 3:45 PM, Ignasi Barrera <ignasi.barr...@gmail.com>
> wrote:
>>
>> Hi Udara,
>>
>> There is no implementation for the API interfaces. jclouds dynamically
>> generates the HTTP requests on the fly, based on the annotations of
>> the invoked method. Adding an operation to the FloatingIpApi should
>> only require to add the method to the interface with the corresponding
>> annotations.
>>
>> You can take a look at the "AllocateFromPool" method [1] to see an
>> example of how a simple POST request is generated.
>>
>> Feel free to ask anything you need or to join the #jclouds IRC channel!
>>
>>
>> HTH!
>>
>> Ignasi
>>
>>
>> [1]
>> https://github.com/jclouds/jclouds/blob/master/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/FloatingIPApi.java#L93-L108
>>
>> On 21 August 2014 11:53, Udara Liyanage <udaraliyan...@gmail.com> wrote:
>> > Hi Zack,
>> >
>> > Thanks for the confirmation. Could you please point me to the place
>> > where
>> > REST API call is made to the Openstack so I would give a try patching
>> > Jclouds. I had a look at the code, I only found FloatingIpAPI.java which
>> > is
>> > the interface. I could not find the place where REST API call is made.
>> >
>> > According to the Openstack Quantum API, it may be possible to specify a
>> > nic
>> > other than eth0
>> >
>> > associate a floating IP to a certain instance
>> >
>> > POST /v2.0/floating-ips/{ipid}/action
>> > {"associate": {"instance_id": "xxx", "interface": "eth0"}}
>> >
>> >
>> >
>> > [1] https://wiki.openstack.org/wiki/Neutron/Quantum-floating-ips
>> >
>> >
>> > On Thu, Aug 21, 2014 at 11:14 AM, Udara Liyanage <ud...@wso2.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >>
>> >> Created a jira for this [1]
>> >>
>> >> [1] https://issues.apache.org/jira/browse/JCLOUDS-682
>> >>
>> >>
>> >> On Wed, Aug 20, 2014 at 10:53 PM, Udara Liyanage <ud...@wso2.com>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> I create instances with multiple network interfaces. However when I
>> >>> associate an floating ip to the instance as below, floating ip is
>> >>> always get
>> >>> allocated to the first interface of the instance.
>> >>>
>> >>> api.addToServer(ip, server-id);
>> >>>
>> >>> How do I get the floating ip assigned to the second or an interface
>> >>> other
>> >>> than the first interface. I could not find a way of specifying a nic
>> >>> when
>> >>> associating an floating ip.
>> >>>
>> >>> I tried a different approach using Openstack commandline and seems it
>> >>> is
>> >>> working.
>> >>>
>> >>> neutron floatingip-create ext
>> >>> neutron floatingip-associate floating_ip-id port-id
>> >>>
>> >>> However I could not find a way to associate a floating ip to a port
>> >>> also.
>> >>>
>> >>> Then starting the instance with the port-id.
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>> Udara Liyanage
>> >>> Software Engineer
>> >>> WSO2, Inc.: http://wso2.com
>> >>> lean. enterprise. middleware
>> >>>
>> >>> web: http://udaraliyanage.wordpress.com
>> >>> phone: +94 71 443 6897
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Udara Liyanage
>> >> Software Engineer
>> >> WSO2, Inc.: http://wso2.com
>> >> lean. enterprise. middleware
>> >>
>> >> web: http://udaraliyanage.wordpress.com
>> >> phone: +94 71 443 6897
>> >
>> >
>> >
>> >
>> > --
>> > Udara S.S Liyanage.
>> > Software Engineer at WSO2.
>> > Commiter and PPMC Member of Apache Stratos.
>> > Blog - http://udaraliyanage.wordpress.com
>> > phone: +94 71 443 6897
>
>
>
>
> --
> Udara S.S Liyanage.
> Software Engineer at WSO2.
> Commiter and PPMC Member of Apache Stratos.
> Blog - http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897

Reply via email to