You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Prachi Damle <Pr...@citrix.com> on 2012/11/14 19:51:18 UTC

[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.Damle@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:david@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,  <pr...@apache.org> wrote:
> Updated Branches:
>   refs/heads/api_refactoring [created] 70a5a2232

RE: [DISCUSS] API refactoring spec

Posted by Animesh Chaturvedi <an...@citrix.com>.
David

No problem, it is always good to have additional pair of eyes watching for licensing issues because they can be very costly.

Thanks
Animesh

-----Original Message-----
From: David Nalley [mailto:david@gnsa.us] 
Sent: Wednesday, November 14, 2012 3:46 PM
To: cloudstack-dev@incubator.apache.org
Subject: Re: [DISCUSS] API refactoring spec

My apologies for jumping the gun.


On Wed, Nov 14, 2012 at 5:43 PM, Animesh Chaturvedi <an...@citrix.com> wrote:
> David
>
> I had checked it is Apache license before posting, Chiradeep thanks 
> for the link
>
> Animesh
>
> -----Original Message-----
> From: David Nalley [mailto:david@gnsa.us]
> Sent: Wednesday, November 14, 2012 2:41 PM
> To: cloudstack-dev@incubator.apache.org
> Subject: Re: [DISCUSS] API refactoring spec
>
> Ohh good catch.
>
> --David
>
> On Wed, Nov 14, 2012 at 5:39 PM, Chiradeep Vittal <Ch...@citrix.com> wrote:
>> This subproject however is ASL 2.0
>> http://www.hibernate.org/subprojects/validator.html
>>
>>
>> On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:
>>
>>>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi 
>>><an...@citrix.com> wrote:
>>>> 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
>>>
>>>Hibernate uses a prohibited license.
>>>
>>>--David
>>

Re: [DISCUSS] API refactoring spec

Posted by David Nalley <da...@gnsa.us>.
My apologies for jumping the gun.


On Wed, Nov 14, 2012 at 5:43 PM, Animesh Chaturvedi
<an...@citrix.com> wrote:
> David
>
> I had checked it is Apache license before posting, Chiradeep thanks for the link
>
> Animesh
>
> -----Original Message-----
> From: David Nalley [mailto:david@gnsa.us]
> Sent: Wednesday, November 14, 2012 2:41 PM
> To: cloudstack-dev@incubator.apache.org
> Subject: Re: [DISCUSS] API refactoring spec
>
> Ohh good catch.
>
> --David
>
> On Wed, Nov 14, 2012 at 5:39 PM, Chiradeep Vittal <Ch...@citrix.com> wrote:
>> This subproject however is ASL 2.0
>> http://www.hibernate.org/subprojects/validator.html
>>
>>
>> On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:
>>
>>>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi
>>><an...@citrix.com> wrote:
>>>> 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
>>>
>>>Hibernate uses a prohibited license.
>>>
>>>--David
>>

RE: [DISCUSS] API refactoring spec

Posted by Donal Lafferty <do...@citrix.com>.
On the topic of licensing, is Microsoft Word's docx format used to express the spec well supported in ASL / OpenSource licensed editors?

DL

-----Original Message-----
From: Animesh Chaturvedi [mailto:animesh.chaturvedi@citrix.com] 
Sent: 14 November 2012 10:43 PM
To: cloudstack-dev@incubator.apache.org
Subject: RE: [DISCUSS] API refactoring spec

David

I had checked it is Apache license before posting, Chiradeep thanks for the link

Animesh

-----Original Message-----
From: David Nalley [mailto:david@gnsa.us]
Sent: Wednesday, November 14, 2012 2:41 PM
To: cloudstack-dev@incubator.apache.org
Subject: Re: [DISCUSS] API refactoring spec

Ohh good catch.

--David

On Wed, Nov 14, 2012 at 5:39 PM, Chiradeep Vittal <Ch...@citrix.com> wrote:
> This subproject however is ASL 2.0
> http://www.hibernate.org/subprojects/validator.html
>
>
> On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:
>
>>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi 
>><an...@citrix.com> wrote:
>>> 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
>>
>>Hibernate uses a prohibited license.
>>
>>--David
>

RE: [DISCUSS] API refactoring spec

Posted by Animesh Chaturvedi <an...@citrix.com>.
David

I had checked it is Apache license before posting, Chiradeep thanks for the link

Animesh

-----Original Message-----
From: David Nalley [mailto:david@gnsa.us] 
Sent: Wednesday, November 14, 2012 2:41 PM
To: cloudstack-dev@incubator.apache.org
Subject: Re: [DISCUSS] API refactoring spec

Ohh good catch.

--David

On Wed, Nov 14, 2012 at 5:39 PM, Chiradeep Vittal <Ch...@citrix.com> wrote:
> This subproject however is ASL 2.0
> http://www.hibernate.org/subprojects/validator.html
>
>
> On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:
>
>>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi 
>><an...@citrix.com> wrote:
>>> 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
>>
>>Hibernate uses a prohibited license.
>>
>>--David
>

Re: [DISCUSS] API refactoring spec

Posted by David Nalley <da...@gnsa.us>.
Ohh good catch.

--David

On Wed, Nov 14, 2012 at 5:39 PM, Chiradeep Vittal
<Ch...@citrix.com> wrote:
> This subproject however is ASL 2.0
> http://www.hibernate.org/subprojects/validator.html
>
>
> On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:
>
>>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi
>><an...@citrix.com> wrote:
>>> 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
>>
>>Hibernate uses a prohibited license.
>>
>>--David
>

Re: [DISCUSS] API refactoring spec

Posted by Chiradeep Vittal <Ch...@citrix.com>.
This subproject however is ASL 2.0
http://www.hibernate.org/subprojects/validator.html


On 11/14/12 2:36 PM, "David Nalley" <da...@gnsa.us> wrote:

>On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi
><an...@citrix.com> wrote:
>> 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
>
>Hibernate uses a prohibited license.
>
>--David


Re: [DISCUSS] API refactoring spec

Posted by David Nalley <da...@gnsa.us>.
On Wed, Nov 14, 2012 at 5:29 PM, Animesh Chaturvedi
<an...@citrix.com> wrote:
> 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

Hibernate uses a prohibited license.

--David

RE: [DISCUSS] API refactoring spec

Posted by Fang Wang <fa...@citrix.com>.
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.wang@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.chaturvedi@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.chaturvedi@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.Damle@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.Damle@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:david@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,  <pr...@apache.org> wrote:
> Updated Branches:
>   refs/heads/api_refactoring [created] 70a5a2232

RE: [DISCUSS] API refactoring spec

Posted by Fang Wang <fa...@citrix.com>.
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.chaturvedi@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.chaturvedi@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.Damle@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.Damle@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:david@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,  <pr...@apache.org> wrote:
> Updated Branches:
>   refs/heads/api_refactoring [created] 70a5a2232

RE: [DISCUSS] API refactoring spec

Posted by Animesh Chaturvedi <an...@citrix.com>.
Folks if there is no objection I would like to propose we adopt Hibernate Validator

Animesh

-----Original Message-----
From: Animesh Chaturvedi [mailto:animesh.chaturvedi@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.Damle@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.Damle@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:david@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,  <pr...@apache.org> wrote:
> Updated Branches:
>   refs/heads/api_refactoring [created] 70a5a2232

RE: [DISCUSS] API refactoring spec

Posted by Animesh Chaturvedi <an...@citrix.com>.
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.Damle@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.Damle@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:david@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,  <pr...@apache.org> wrote:
> Updated Branches:
>   refs/heads/api_refactoring [created] 70a5a2232

Re: [DISCUSS] API refactoring spec

Posted by Min Chen <mi...@citrix.com>.
Hi there,

	This wiki page and word doc are now updated with another part of API
refactoring related to List API performance optimization. Please review
and comment as well.

	Thanks
	-min

On 11/14/12 10:51 AM, "Prachi Damle" <Pr...@citrix.com> wrote:

>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+refa
>ctoring
>
>Thanks,
>Prachi
>
>
>-----Original Message-----
>From: Prachi Damle [mailto:Prachi.Damle@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:david@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,  <pr...@apache.org> wrote:
>> Updated Branches:
>>   refs/heads/api_refactoring [created] 70a5a2232


Re: [DISCUSS] API refactoring spec

Posted by Min Chen <mi...@citrix.com>.
Thanks Prachi. I will update your page with proposals about list API
optimization as well as API response refactoring, since it is also part of
API refactoring.

-min

On 11/14/12 10:51 AM, "Prachi Damle" <Pr...@citrix.com> wrote:

>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+refa
>ctoring
>
>Thanks,
>Prachi
>
>
>-----Original Message-----
>From: Prachi Damle [mailto:Prachi.Damle@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:david@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,  <pr...@apache.org> wrote:
>> Updated Branches:
>>   refs/heads/api_refactoring [created] 70a5a2232