Change proposed for the @Parameter annotation In the spec 3.2.1, for @Parameter annotation, we'll change the entityType to refer to an entity response class. e.g., entityType=UserVmResponse.class
We will add another annotation @Entity in the response class, to refer to the Entity object. 3.2.1.1 Com.cloud.api.response.Entity annotation is used by the response class to refer to the entity the response Corresponds to. public @interface Entity { Class[] value() default {}; } For example, in the UserVmResponse.class, we will add this annotation: @Entity(value=VirtualMachine.class) VirtualMachine is a controlledEntity, which the security checker will check. -----Original Message----- From: Fang Wang [mailto:fang.w...@citrix.com] Sent: Wednesday, November 21, 2012 4:22 PM To: cloudstack-dev@incubator.apache.org Subject: RE: [DISCUSS] API refactoring spec I am currently working on the 3.2.1 and 3.2.2 annotation changes in the FS. I am grouping the APIs into sub groups, for example, a VM subgroup handles all the virtual machine related APIs. For 3.2.1, we may change the entityType be to the object of a response class, to present to the REST API. e.g., @Parameter(name=ApiConstants.DISK_OFFERING_ID, type=CommandType.LONG, description="the ID of the disk offering for the virtual machine. ......", entityType=DiskOfferingResponse.class) private Long diskOfferingId; thanks, -Fang -----Original Message----- From: Animesh Chaturvedi [mailto:animesh.chaturv...@citrix.com] Sent: Tuesday, November 20, 2012 5:51 PM To: cloudstack-dev@incubator.apache.org Subject: RE: [DISCUSS] API refactoring spec Folks if there is no objection I would like to propose we adopt Hibernate Validator Animesh -----Original Message----- From: Animesh Chaturvedi [mailto:animesh.chaturv...@citrix.com] Sent: Wednesday, November 14, 2012 2:29 PM To: cloudstack-dev@incubator.apache.org Subject: RE: [DISCUSS] API refactoring spec Prachi I was looking at the API refactoring document and had some comments on section 3.2.3 on validation. I think we can leverage Hibernate Validator instead of writing our own validators. It comes with decent collection of build in constraints and we can define new constraints with annotations and provide its implementation. Thanks Animesh -----Original Message----- From: Prachi Damle [mailto:prachi.da...@citrix.com] Sent: Wednesday, November 14, 2012 10:51 AM To: cloudstack-dev@incubator.apache.org Subject: [DISCUSS] API refactoring spec I have put some ideas together, regarding refactoring the current API commands to support better documentation generation, parameter validation and some code cleanup needed for future acl work. Please take a look and let me know any suggestions/comments on the proposal: https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+API+refactoring Thanks, Prachi -----Original Message----- From: Prachi Damle [mailto:prachi.da...@citrix.com] Sent: Tuesday, November 13, 2012 1:10 PM To: cloudstack-dev@incubator.apache.org Subject: RE: Git Push Summary David, This involves some annotation work for existing API commands to facilitate generation of documentation, better packaging, parameter validation at API layer and also the access control checks at API layer. I am putting together these ideas in a spec and will share it with the list for discussion. Thanks, Prachi -----Original Message----- From: David Nalley [mailto:da...@gnsa.us] Sent: Tuesday, November 13, 2012 11:52 AM To: cloudstack-dev@incubator.apache.org Subject: Re: Git Push Summary Sounds fascinating API refactoring?? In what way? On Tue, Nov 13, 2012 at 2:49 PM, <prachida...@apache.org> wrote: > Updated Branches: > refs/heads/api_refactoring [created] 70a5a2232