cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelven Yang <>
Subject Re: [DISCUSS] Question about @Parameter (entityType)
Date Mon, 28 Jan 2013 06:50:07 GMT

On 1/27/13 9:52 PM, "Mice Xia" <> wrote:

>i have the same question and i found this:
>seems this annotation is used for converting entity UUID->ID

Yes, I know it is used for this purpose, my question is why we do this
indirectly through a Response class? Especially when a command object is
expecting multiple such entities, we can see a number of Response classes
be introduced to the Command class like DeployVMCmd, a new developer may
wonder what are those Response classes are to do with one command.

And one more confusing part in DeployVMCmd, I can see some entity
references are done through Response classes, while the special
ipToNetworkList parameter is trying to directly refer to the entities (by
the way, populating value of ipToNetworkList is actually done by another
helper method in DeployVMCmd class). Is this in this way for an
implementation purpose?


>2013/1/28 Kelven Yang <>:
>> I have a question about a change in @Parameter at API layer, in regards
>> entityType, does anyone know the reason behind why it has to go through
>> with some Response class which in turn declares links to the entity
>> via @EntityReference annotation?
>> And in DeployVMCmd as an example, there is also another special field
>> (ipToNetworkList) declares entity reference directly, could someone
>> clarify it?
>> @ACL(checkKeyAccess=true)
>>     @Parameter(name = ApiConstants.IP_NETWORK_LIST, type =
>> CommandType.MAP, entityType={Network.class, IpAddress.class},
>>             description = "ip to network mapping. Can't be specified
>> networkIds parameter." +
>>                     " Example:
>> iptonetworklist[0].ip=[0].networkid=uuid -
>> requests to use ip in network id=uuid")
>>     private Map ipToNetworkList;
>> Kelven

View raw message