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 2FB0E1085D for ; Fri, 28 Aug 2015 06:01:53 +0000 (UTC) Received: (qmail 69458 invoked by uid 500); 28 Aug 2015 06:01:48 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 69260 invoked by uid 500); 28 Aug 2015 06:01:48 -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 69151 invoked by uid 99); 28 Aug 2015 06:01:48 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Aug 2015 06:01:48 +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 E2B20EEFE8; Fri, 28 Aug 2015 06:01:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.524 X-Spam-Level: X-Spam-Status: No, score=-1.524 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-1.424, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=163.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 qt2WYCLPBCPx; Fri, 28 Aug 2015 06:01:35 +0000 (UTC) Received: from m50-134.163.com (m50-134.163.com [123.125.50.134]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 86F34255AC; Fri, 28 Aug 2015 06:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=5cfsy 09AoOczuKySEr4V2WdA8dv6SSwgtXQgAIb3EzU=; b=O5VXIY7eax8EZOwRQA0Vj PTrLKTpV8FX2v4ndOf4ZV0CxgHa5XqyT1EDDKRjv/nZ1jj2wflw7iOxrNZpaOxSE pWl3DIwzvkfV3FF7mAZ+58f3HLH62mDt+GGTUcTSkpsPwipSpzxhScY8NQQfMOAF HWNppb8I+luSM3uhah/I4o= Received: from [10.0.16.102] (unknown [111.201.68.80]) by smtp4 (Coremail) with SMTP id DtGowEBJK4Yy+d9VAW4jAg--.8703S2; Fri, 28 Aug 2015 14:01:23 +0800 (CST) Subject: Re: How does the parameter startdate/enddate of api listEvents() use new time format like 'yyyy-MM-dd HH:mm:ss' ? To: users@cloudstack.apache.org, users-cn@cloudstack.apache.org, dev@cloudstack.apache.org References: <55BB56FD.7060004@163.com> <55D300E5.3010701@163.com> <55D30348.3000700@163.com> <55D3EAC1.6050700@163.com> <55DAD7F0.1030207@163.com> <9312E43F-BBB7-4AAC-852A-543CE10BABA3@shapeblue.com> From: tony_caotong@163.com Message-ID: <55DFF933.2060609@163.com> Date: Fri, 28 Aug 2015 14:01:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <9312E43F-BBB7-4AAC-852A-543CE10BABA3@shapeblue.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: DtGowEBJK4Yy+d9VAW4jAg--.8703S2 X-Coremail-Antispam: 1Uf129KBjvJXoW3GFy8CF4rKFWfZFW8XF1fWFg_yoWfKr48p3 sxtFsFyr48Jr4vvws2vw1rGr12vrWkJF45XF1Yq3yxJFn0kry7trWxJa4rCFWUZF1Iyw4U XFWjvay7ZrWjv3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07bbL05UUUUU= X-Originating-IP: [111.201.68.80] X-CM-SenderInfo: 5wrq5sxfdr30lqj6il2tof0z/xtbBURVkPFD+YOqlqQAAs0 Thanks for all your people's replys. 1. Abhinandan, My ACS manager was not listening on port '8096', 2. As Yipeng said, When I call this api from cloudmonkey, it works=20 fine, like this " cloudmonkey api listEvents listall=3Dtrue startdate=3D'2015-08-28 = 00:00:00' " When I call it through my python scripts, I used the=20 apikey/signature pair to work, but it failed. I found that how cloudmonkey works, first it login with username/password, then call the function with=20 this session id. it seems that the apikey/signature pair's privilege is not same with=20 username/password pair's ? @Daan, yes I am a Chinese. I am afraid it's not a preblem about=20 character encodings perhaps. ----------- Cao Tong On 08/27/2015 08:54 PM, Abhinandan Prateek wrote: > Try using the =E2=80=9C8096=E2=80=9D port for testing/checking APIs. > > 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 reall= y hard for me to continue my work. >>> >>> So could Anyone spend your three minutes to give me some advice, it w= ill be very usefull to me. >>> >>> my question is: >>> >>> How does the parameter startdate/enddate of api listEvents() use n= ew 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-3= RbBmdC973utGwCL5388WypVKwtaNsDso-JzVQIZXUVwfaT1vANdDUJs3Vkkg&command=3Dli= stEvents&listall=3DTrue&response=3Djson&startdate=3D2015-08-24+00%3A00%3A= 00&signature=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_defaul= t >>> raise IOError, ('http error', errcode, errmsg, headers) >>> IOError: ('http error', 401, 'Unauthorized', ) >>> >>> ----------- >>> 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 co= mpatibility >>>>> // and support both the date formats(Bug 9724) >>>>> >>>>> Is it related to my problem? Where can I found the descriptions ab= out 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 fin= d. >>>>>> When I use it like this startdate=3D"2015-07-31 13:00:00". >>>>>> It return a error >>>>>> IOError: ('http error', 401, 'Unauthorized', ) >>>>>> >>>>>> Could anyone tell me why ? >>>>>> >>>>>> I have read the code "DefaultLoginAPIAuthenticatorCmd::authenticat= e()" , 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:m= m: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_40= 1 >>>>>>> errcode, errmsg, headers) >>>>>>> File "/usr/lib64/python2.7/urllib.py", line 381, in http_error_de= fault >>>>>>> raise IOError, ('http error', errcode, errmsg, headers) >>>>>>> IOError: ('http error', 401, 'Unauthorized', ) >>>>>>> >>>>>>> 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 serv= ices >> >> IaaS Cloud Design & Build >> CSForge =E2=80=93 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 inten= ded solely for the use of the individual to whom it is addressed. Any vie= ws or opinions expressed are solely those of the author and do not necess= arily represent those of Shape Blue Ltd or related companies. If you are = not the intended recipient of this email, you must neither take any actio= n based upon its contents, nor copy or show it to anyone. Please contact = the sender if you believe you have received this email in error. Shape Bl= ue Ltd is a company incorporated in England & Wales. ShapeBlue Services I= ndia LLP is a company incorporated in India and is operated under license= from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company inc= orporated in Brasil and is operated under license from Shape Blue Ltd. Sh= apeBlue SA Pty Ltd is a company registered by The Republic of South Afric= a and is traded under license from Shape Blue Ltd. ShapeBlue is a registe= red trademark. > Find out more about ShapeBlue and our range of CloudStack related servi= ces > > IaaS Cloud Design & Build > CSForge =E2=80=93 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 intend= ed solely for the use of the individual to whom it is addressed. Any view= s or opinions expressed are solely those of the author and do not necessa= rily represent those of Shape Blue Ltd or related companies. If you are n= ot the intended recipient of this email, you must neither take any action= based upon its contents, nor copy or show it to anyone. Please contact t= he sender if you believe you have received this email in error. Shape Blu= e Ltd is a company incorporated in England & Wales. ShapeBlue Services In= dia LLP is a company incorporated in India and is operated under license = from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a company inco= rporated in Brasil and is operated under license from Shape Blue Ltd. Sha= peBlue SA Pty Ltd is a company registered by The Republic of South Africa= and is traded under license from Shape Blue Ltd. ShapeBlue is a register= ed trademark.