Return-Path: X-Original-To: apmail-cloudstack-users-archive@www.apache.org Delivered-To: apmail-cloudstack-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF01518CDF for ; Tue, 25 Aug 2015 10:23:25 +0000 (UTC) Received: (qmail 27185 invoked by uid 500); 25 Aug 2015 10:23:21 -0000 Delivered-To: apmail-cloudstack-users-archive@cloudstack.apache.org Received: (qmail 26711 invoked by uid 500); 25 Aug 2015 10:23:21 -0000 Mailing-List: contact users-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cloudstack.apache.org Delivered-To: mailing list users@cloudstack.apache.org Received: (qmail 26630 invoked by uid 99); 25 Aug 2015 10:23:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2015 10:23:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7583FED997; Tue, 25 Aug 2015 10:23:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id N3d--Bm-dGkQ; Tue, 25 Aug 2015 10:23:08 +0000 (UTC) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 5DC1F2557B; Tue, 25 Aug 2015 10:23:07 +0000 (UTC) Received: by labia3 with SMTP id ia3so30575651lab.3; Tue, 25 Aug 2015 03:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=i9RDqX0skuaNPZ95jsbI1+ikSlGO9NednPqG3Lwf7Rg=; b=sUq5c1TnhG/znbO2+OTGQzAP3aiLy+1zFkVeenvtE55v50Xw9QjTaxRdNqgdg4P/4r B17M/kgXPqtb9cR3KCm4FhJE1xmOyaN8sFB3eu+NFfDOGgiyWvzSrA5/qIEanPgxAr6u gZofffYCshqbJM3guYABl4V/JFDDJqd2Mevv4oXbkmxW4wYjW2jA3daILaBmD00+Iwkt Qydo46hjzlWjZ1EA4t9GMk1493Onxg72evCfwAjTkyaRPYOIr8vKKeRcMa3GKIt3Zuaj 84GWFPCyg1bA7MEOU6p5J9lp1AfdGjo7+9Lb8YVQxoVD4QCPEsBpnn5qP9U4v+6aMfgI SHtA== X-Received: by 10.152.21.71 with SMTP id t7mr24195388lae.118.1440498185427; Tue, 25 Aug 2015 03:23:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.181.101 with HTTP; Tue, 25 Aug 2015 03:22:45 -0700 (PDT) In-Reply-To: References: <55BB56FD.7060004@163.com> <55D300E5.3010701@163.com> <55D30348.3000700@163.com> <55D3EAC1.6050700@163.com> <55DAD7F0.1030207@163.com> From: Daan Hoogland Date: Tue, 25 Aug 2015 12:22:45 +0200 Message-ID: Subject: Re: How does the parameter startdate/enddate of api listEvents() use new time format like 'yyyy-MM-dd HH:mm:ss' ? To: dev Cc: "users@cloudstack.apache.org" , "users-cn@cloudstack.apache.org" Content-Type: multipart/alternative; boundary=089e013d1fe4a4604f051e201ea0 --089e013d1fe4a4604f051e201ea0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Tony/Cao Tong, just as a guess and as I see you are chinese; the chacter between the date and the time is a 32 (uri encoded %20)? Not sure if that is your problem but it might be. Looking at the stack trace you might as well want to look at the version of your client library as it seems to refuse the format client side. regards, Daan On Tue, Aug 25, 2015 at 12:16 PM, Abhinandan Prateek < abhinandan.prateek@shapeblue.com> wrote: > Yes, as per > https://cloudstack.apache.org/api/apidocs-4.2/root_admin/listEvents.html > > > > On 24-Aug-2015, at 2:08 pm, tony_caotong@163.com wrote: > > > > Hello Every. > > > > I know this is a very simple question to most of you. but it is really > hard for me to continue my work. > > > > So could Anyone spend your three minutes to give me some advice, it wil= l > be very usefull to me. > > > > my question is: > > > > How does the parameter startdate/enddate of api listEvents() use new > time format like 'yyyy-MM-dd HH:mm:ss' ? > > > > > > >>> Event({'listall':'True', 'startdate':'2015-08-24 00:00:00'}) > > > http://10.0.1.100:8080/client/api?apiKey=3DhjZ12EQ4JfFasIHO3RCXBLji-3RbBm= dC973utGwCL5388WypVKwtaNsDso-JzVQIZXUVwfaT1vANdDUJs3Vkkg&command=3DlistEven= ts&listall=3DTrue&response=3Djson&startdate=3D2015-08-24+00%3A00%3A00&signa= ture=3Dz4LQCw7yzGmTK5B7TzAbzl1biXI%3D > > Traceback (most recent call last): > > File "", line 1, in > > File "SignedAPICall.py", line 67, in Event > > a =3D api.listEvents(request) > > File "SignedAPICall.py", line 49, in handlerFunction > > return self._make_request(name, args[0]) > > File "SignedAPICall.py", line 61, in _make_request > > data =3D self._http_get(self.value) > > File "SignedAPICall.py", line 54, in _http_get > > response =3D urllib.urlopen(url) > > File "/usr/lib64/python2.7/urllib.py", line 87, in urlopen > > return opener.open(url) > > File "/usr/lib64/python2.7/urllib.py", line 208, in open > > return getattr(self, name)(url) > > File "/usr/lib64/python2.7/urllib.py", line 359, in open_http > > return self.http_error(url, fp, errcode, errmsg, headers) > > File "/usr/lib64/python2.7/urllib.py", line 372, in http_error > > result =3D method(url, fp, errcode, errmsg, headers) > > File "/usr/lib64/python2.7/urllib.py", line 683, in http_error_401 > > errcode, errmsg, headers) > > File "/usr/lib64/python2.7/urllib.py", line 381, in http_error_default > > raise IOError, ('http error', errcode, errmsg, headers) > > IOError: ('http error', 401, 'Unauthorized', instance at 0x7f083da78998>) > > > > ----------- > > Cao Tong > > > > On 08/19/2015 10:32 AM, tony_caotong@163.com wrote: > >> > >> Hi All: > >> > >> Does any one have any idea ? Thanks. > >> > >> ----------- > >> Cao Tong > >> > >> On 08/18/2015 06:04 PM, tony_caotong@163.com wrote: > >>> > >>> In ParamProcessWorker::setFieldValue() I found this lins: > >>> > >>> case DATE: > >>> // This piece of code is for maintaining backward > compatibility > >>> // and support both the date formats(Bug 9724) > >>> > >>> Is it related to my problem? Where can I found the descriptions abou= t > BUG9724 ? > >>> > >>> ----------- > >>> Cao Tong > >>> > >>> On 08/18/2015 05:54 PM, tony_caotong@163.com wrote: > >>>> > >>>> Hello, > >>>> > >>>> When I use timestamp format startdate=3D"2015-07-31", it works find. > >>>> When I use it like this startdate=3D"2015-07-31 13:00:00". > >>>> It return a error > >>>> IOError: ('http error', 401, 'Unauthorized', instance at 0x16dca70>) > >>>> > >>>> Could anyone tell me why ? > >>>> > >>>> I have read the code > "DefaultLoginAPIAuthenticatorCmd::authenticate()" , but I am still not > understand what was happening, > >>>> it seems authenticate failed, but why?? > >>>> > >>>> ----------- > >>>> Cao Tong > >>>> > >>>> On 07/31/2015 07:07 PM, tony_caotong@163.com wrote: > >>>>> > >>>>> Hi, > >>>>> > >>>>> was this format is enabled in ACS 4.5.1 like /"yyyy-MM-dd > HH:mm:ss" > >>>>> > >>>>> > >>>>> / I found it in 4.5.0 API doc, but it seems not enabled. > >>>>> > >>>>> http://cloudstack.apache.org/api/apidocs-4.5/user/listEvents.html > >>>>> > >>>>> >>> api.listEvents(startdate=3D"2015-07-31 13:00:00") > >>>>> Traceback (most recent call last): > >>>>> File "", line 1, in > >>>>> File "call.py", line 48, in handlerFunction > >>>>> return self._make_request(name, kwargs) > >>>>> File "call.py", line 60, in _make_request > >>>>> data =3D self._http_get(self.value) > >>>>> File "call.py", line 53, in _http_get > >>>>> response =3D urllib.urlopen(url) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 87, in urlopen > >>>>> return opener.open(url) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 208, in open > >>>>> return getattr(self, name)(url) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 359, in open_http > >>>>> return self.http_error(url, fp, errcode, errmsg, headers) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 372, in http_error > >>>>> result =3D method(url, fp, errcode, errmsg, headers) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 683, in http_error_401 > >>>>> errcode, errmsg, headers) > >>>>> File "/usr/lib64/python2.7/urllib.py", line 381, in > http_error_default > >>>>> raise IOError, ('http error', errcode, errmsg, headers) > >>>>> IOError: ('http error', 401, 'Unauthorized', instance at 0x16dca70>) > >>>>> >>> > >>>>> > >>>>> > >>>>> my ACS version: > >>>>> > >>>>> [root@cs ~]# rpm -qa |grep cloud > >>>>> cloudstack-management-4.5.1-shapeblue0.el6.x86_64 > >>>>> cloudstack-awsapi-4.5.1-shapeblue0.el6.x86_64 > >>>>> cloudstack-agent-4.5.1-shapeblue0.el6.x86_64 > >>>>> cloudstack-common-4.5.1-shapeblue0.el6.x86_64 > >>>>> > >>>>> > >>>> > >>>> > >>> > >>> > >> > >> > > > > > > Find out more about ShapeBlue and our range of CloudStack related service= s > > IaaS Cloud Design & Build< > http://shapeblue.com/iaas-cloud-design-and-build//> > CSForge =E2=80=93 rapid IaaS deployment framework > CloudStack Consulting > CloudStack Software Engineering< > http://shapeblue.com/cloudstack-software-engineering/> > CloudStack Infrastructure Support< > http://shapeblue.com/cloudstack-infrastructure-support/> > CloudStack Bootcamp Training Courses< > http://shapeblue.com/cloudstack-training/> > > This email and any attachments to it may be confidential and are intended > solely for the use of the individual to whom it is addressed. Any views o= r > opinions expressed are solely those of the author and do not necessarily > represent those of Shape Blue Ltd or related companies. If you are not th= e > intended recipient of this email, you must neither take any action based > upon its contents, nor copy or show it to anyone. Please contact the send= er > if you believe you have received this email in error. Shape Blue Ltd is a > company incorporated in England & Wales. ShapeBlue Services India LLP is = a > company incorporated in India and is operated under license from Shape Bl= ue > Ltd. Shape Blue Brasil Consultoria Ltda is a company incorporated in Bras= il > and is operated under license from Shape Blue Ltd. ShapeBlue SA Pty Ltd i= s > a company registered by The Republic of South Africa and is traded under > license from Shape Blue Ltd. ShapeBlue is a registered trademark. > --=20 Daan --089e013d1fe4a4604f051e201ea0--