You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Ryan Dietrich <ry...@betterservers.com> on 2013/04/10 21:38:14 UTC

Associate IP feature request (RE: CLOUDSTACK-1942)

RE: https://issues.apache.org/jira/browse/CLOUDSTACK-1942

I added this feature this morning, but before I present the diff to review board, I'd like to have some feedback on the approach.  I just want to make sure how I did it is ok from the maintainers perspective so I'm not wasting anyones time.

1. Add an optional parameter to api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java allowing you to pass in a UUID of the specific IP you want to add.
2. Make AssociateIPAddrCmd either use the provided IP or use the existing "getEntity()" call it is using now.
3. Update "allocateIP" to have a new optional argument, the Long (id) of IpAddress.
4. Update the NetworkManager and NetworkService interfaces to include the new parameter
5. Update the MockNetworkManager and MockNetworkService implementations to include the new parameter.
6. Update the NetworkServiceImplementation to include the new parameter and pass it through.
7. Update NetworkManagerImpl: Use the existing functionality of "fetchNewPublicIp" and pass in the String "requestedIp" based on the Long id of IpAddress (I used ApiDBUtils to fetch the object out and transform it into a string).

I tested the code passing the UUID of the IP I wanted to attach as well as leaving it off, verifying the pre-existing method worked normally.

If there is an alternative approach you'd rather me take to accomplish this task, please let me know, otherwise I'll be happy to post the diff to review board.

Thanks,

-Ryan Dietrich

Re: Associate IP feature request (RE: CLOUDSTACK-1942)

Posted by Chiradeep Vittal <Ch...@citrix.com>.
Well, listPublicIpAddress would only return Ip addresses already acquired
via associateIpAddress (unless you are the admin, in which case it will
return all public ips).

On 4/11/13 4:13 AM, "prasanna" <ts...@apache.org> wrote:

>On 11 April 2013 01:08, Ryan Dietrich <ry...@betterservers.com> wrote:
>> RE: https://issues.apache.org/jira/browse/CLOUDSTACK-1942
>>
>> I added this feature this morning, but before I present the diff to
>>review board, I'd like to have some feedback on the approach.  I just
>>want to make sure how I did it is ok from the maintainers perspective so
>>I'm not wasting anyones time.
>>
>> 1. Add an optional parameter to
>>api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd
>>.java allowing you to pass in a UUID of the specific IP you want to add.
>> 2. Make AssociateIPAddrCmd either use the provided IP or use the
>>existing "getEntity()" call it is using now.
>> 3. Update "allocateIP" to have a new optional argument, the Long (id)
>>of IpAddress.
>> 4. Update the NetworkManager and NetworkService interfaces to include
>>the new parameter
>> 5. Update the MockNetworkManager and MockNetworkService implementations
>>to include the new parameter.
>> 6. Update the NetworkServiceImplementation to include the new parameter
>>and pass it through.
>> 7. Update NetworkManagerImpl: Use the existing functionality of
>>"fetchNewPublicIp" and pass in the String "requestedIp" based on the
>>Long id of IpAddress (I used ApiDBUtils to fetch the object out and
>>transform it into a string).
>>
>I don't see any problem with the approach.


Re: Associate IP feature request (RE: CLOUDSTACK-1942)

Posted by prasanna <ts...@apache.org>.
On 11 April 2013 01:08, Ryan Dietrich <ry...@betterservers.com> wrote:
> RE: https://issues.apache.org/jira/browse/CLOUDSTACK-1942
>
> I added this feature this morning, but before I present the diff to review board, I'd like to have some feedback on the approach.  I just want to make sure how I did it is ok from the maintainers perspective so I'm not wasting anyones time.
>
> 1. Add an optional parameter to api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java allowing you to pass in a UUID of the specific IP you want to add.
> 2. Make AssociateIPAddrCmd either use the provided IP or use the existing "getEntity()" call it is using now.
> 3. Update "allocateIP" to have a new optional argument, the Long (id) of IpAddress.
> 4. Update the NetworkManager and NetworkService interfaces to include the new parameter
> 5. Update the MockNetworkManager and MockNetworkService implementations to include the new parameter.
> 6. Update the NetworkServiceImplementation to include the new parameter and pass it through.
> 7. Update NetworkManagerImpl: Use the existing functionality of "fetchNewPublicIp" and pass in the String "requestedIp" based on the Long id of IpAddress (I used ApiDBUtils to fetch the object out and transform it into a string).
>
I don't see any problem with the approach.