Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DE0E10FF4 for ; Thu, 20 Nov 2014 20:13:24 +0000 (UTC) Received: (qmail 44961 invoked by uid 500); 20 Nov 2014 20:13:23 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 44918 invoked by uid 500); 20 Nov 2014 20:13:23 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 44906 invoked by uid 99); 20 Nov 2014 20:13:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2014 20:13:23 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Prachi.Damle@citrix.com designates 66.165.176.63 as permitted sender) Received: from [66.165.176.63] (HELO SMTP02.CITRIX.COM) (66.165.176.63) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2014 20:13:19 +0000 X-IronPort-AV: E=Sophos;i="5.07,425,1413244800"; d="scan'208";a="194963226" From: Prachi Damle To: "dev@cloudstack.apache.org" Subject: RE: [DISCUSS] Major business logic refactoring: Move from Account to UserAccount Thread-Topic: [DISCUSS] Major business logic refactoring: Move from Account to UserAccount Thread-Index: AQHP/+hsCwSNib86uEGCFyh31/QEXpxgb1IAgAAEeACAAAKIgIAABVwAgAACn9CAAIexgIAAIogAgACkkwCAAB2ygIAAGV6AgABoJICAAFS3gIABEjOAgAYoCRA= Date: Thu, 20 Nov 2014 20:11:52 +0000 Message-ID: <75942ED3FD12D64EABE71209BD0F62CC791FDD@SJCPEX01CL01.citrite.net> References: <9024DC55-3CA5-4DA6-9D0D-24BA767EA3E7@shapeblue.com> In-Reply-To: <9024DC55-3CA5-4DA6-9D0D-24BA767EA3E7@shapeblue.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Rohit, I checked the code here https://git-wip-us.apache.org/repos/asf?p=3Dcloudst= ack.git;a=3Dshortlog;h=3Drefs/heads/useraccount-refactoring and I don't und= erstand why we need to expose the userId parameter in the deployVm API.=20 I think we should be using the userId of the logged in user always.=20 Exposing the parameter at the API allows it to be set by a user to the ID o= f another user . Also we need validation around it to make sure it belongs = to the passed account etc. + //Owner userId + @Parameter(name =3D ApiConstants.USER_ID, type =3D CommandType.UUID, e= ntityType =3D UserResponse.class, required =3D true, description =3D "the u= ser ID of the owner, optional to use with account and domainId. If not prov= ided logged in user's ID is used.") + private Long userId; Prachi -----Original Message----- From: Rohit Yadav [mailto:rohit.yadav@shapeblue.com]=20 Sent: Sunday, November 16, 2014 6:06 AM To: dev@cloudstack.apache.org Subject: Re: [DISCUSS] Major business logic refactoring: Move from Account = to UserAccount Only one table will be affected. > On 16-Nov-2014, at 3:14 am, Amogh Vasekar wrot= e: > > Question - What happens to the already existing VMs with entries in=20 > the DB? Do we keep it NULL? NULL will be and not useful. I think it should be okay to have a db migrati= on path that sets user_id to the first user in account_id (which usually ha= s the same name as account) for existing VMs. The amount of code change wil= l be minimal. Checkout some code in this branch (has the db migration code and API layer = changes); https://git-wip-us.apache.org/repos/asf?p=3Dcloudstack.git;a=3Dsh= ortlog;h=3Drefs/heads/useraccount-refactoring Regards, Rohit Yadav Software Architect, ShapeBlue M. +91 88 262 30892 | rohit.yadav@shapeblue.com Blog: bhaisaab.org | Twitter: @_bhaisaab Find out more about ShapeBlue and our range of CloudStack related services IaaS Cloud Design & Build CSForge - rapid IaaS deployment framework CloudStack Consulting CloudStack Software Engineering CloudStack Infrastructure Support CloudStack Bootcamp Training Courses This email and any attachments to it may be confidential and are intended s= olely for the use of the individual to whom it is addressed. Any views or o= pinions expressed are solely those of the author and do not necessarily rep= resent those of Shape Blue Ltd or related companies. If you are not the int= ended recipient of this email, you must neither take any action based upon = its contents, nor copy or show it to anyone. Please contact the sender if y= ou believe you have received this email in error. Shape Blue Ltd is a compa= ny incorporated in England & Wales. ShapeBlue Services India LLP is a compa= ny incorporated in India and is operated under license from Shape Blue Ltd.= Shape Blue Brasil Consultoria Ltda is a company incorporated in Brasil and= is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd is a c= ompany registered by The Republic of South Africa and is traded under licen= se from Shape Blue Ltd. ShapeBlue is a registered trademark.