Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A6D1CDC13 for ; Sat, 1 Sep 2012 19:48:49 +0000 (UTC) Received: (qmail 70649 invoked by uid 500); 1 Sep 2012 19:48:49 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 70621 invoked by uid 500); 1 Sep 2012 19:48:49 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 70613 invoked by uid 99); 1 Sep 2012 19:48:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Sep 2012 19:48:49 +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 Nitin.Mehta@citrix.com designates 203.166.19.134 as permitted sender) Received: from [203.166.19.134] (HELO SMTP.CITRIX.COM.AU) (203.166.19.134) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Sep 2012 19:48:43 +0000 X-IronPort-AV: E=Sophos;i="4.80,353,1344211200"; d="scan'208";a="12559085" Received: from banpmailmx01.citrite.net ([10.103.128.73]) by SYDPIPO01.CITRIX.COM.AU with ESMTP/TLS/RC4-MD5; 01 Sep 2012 19:48:21 +0000 Received: from BANPMAILBOX01.citrite.net ([10.103.128.71]) by BANPMAILMX01.citrite.net ([10.103.128.73]) with mapi; Sun, 2 Sep 2012 01:18:19 +0530 From: Nitin Mehta To: "cloudstack-dev@incubator.apache.org" Date: Sun, 2 Sep 2012 01:18:10 +0530 Subject: Re: Template status field via API Thread-Topic: Template status field via API Thread-Index: Ac2IerxKLGfWI2HjT5iPeDS5SqkcLw== Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi Richard, Please find my answers inline. Thanks, -Nitin On 01-Sep-2012, at 10:07 PM, Richard Downer wrote: > Hi, >=20 > I'm working on the jclouds project, and its support for the CloudStack AP= I. > I'm looking at the responses for the listTemplates command, status field. > This field appears to include English text which describes the template > state, presumably ready to go straight into a UI element. But jclouds > prefers to have enumerated types, so it wants to parse the strings and > return a known enum to its users. >=20 > I've been examining the CloudStack source code, and it seems that this is > the piece of code responsible for writing that field: > https://github.com/CloudStack/CloudStack/blob/e2e76c70ec51bfb35d755371f6c= 33856cef8a277/server/src/com/cloud/api/ApiResponseHelper.java#L1968 > =20 > First question - do I have that right, or is this response field from > somewhere else? (I'm a bit of a newbie at the CloudStack codebase.) >=20 This is the correct location. > Here are the possible strings that the field could be set to: > - Processing > - Installing Template > - x% Downloaded > - Download Complete > - Successfully Installed >=20 I think you missed the error situation. This string can vary in case of err= or cases. > Second question - what states lead to each of these statuses? In > particular, I'm uncertain of the final one, "Successfully Installed". By > using the registerTemplate command I was able to see most of the other > status strings, but I haven't yet seen the last one. Is it reachable, and > if so by what route? >=20 You are right. From the code it seems to be unreachable code.=20 > Last question - are there significant differences between 2.2.x and 3.0.x > in this area? >=20 No, there aren't significant changes > Many thanks, >=20 > --=20 > Richard Downer =95 Lead Engineer =95 Cloudsoft Corporation =95 > http://www.cloudsoftcorp.com > Skype richardcloudsoft =95 Twitter @FrontierTown