Return-Path: X-Original-To: apmail-incubator-cloudstack-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A496AE706 for ; Fri, 11 Jan 2013 15:52:16 +0000 (UTC) Received: (qmail 82747 invoked by uid 500); 11 Jan 2013 15:52:16 -0000 Delivered-To: apmail-incubator-cloudstack-users-archive@incubator.apache.org Received: (qmail 82728 invoked by uid 500); 11 Jan 2013 15:52:16 -0000 Mailing-List: contact cloudstack-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-users@incubator.apache.org Delivered-To: mailing list cloudstack-users@incubator.apache.org Received: (qmail 82720 invoked by uid 99); 11 Jan 2013 15:52:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 15:52:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.97.132.66] (HELO homiemail-a32.g.dreamhost.com) (208.97.132.66) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 15:52:08 +0000 Received: from homiemail-a32.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a32.g.dreamhost.com (Postfix) with ESMTP id 0926358406F for ; Fri, 11 Jan 2013 07:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nfinausa.com; h=date:from :reply-to:to:subject:message-id:mime-version:content-type; s= nfinausa.com; bh=f7/6YxNxvUuRz/3zNeWnpv8dnUQ=; b=q5TLpWTWIWw37Z6 xM3icj5RHxqIq05Pnj/dEPKcBNclqYzWcGRuYsgOCTX72pF9NeFCjjddd4gLx08W 6FSdjt73+diRNEvhpN0MKdqDx/3xU2HJcHGGf/GiMGNC8xDcCs/gtgB5aAQXXp5I TBxUYDP9e00xxiu/Uf6eDnbuSKng= Received: from nmartin-HP-EliteBook-8460p.local (adsl-98-90-195-231.mob.bellsouth.net [98.90.195.231]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nik.martin@nfinausa.com) by homiemail-a32.g.dreamhost.com (Postfix) with ESMTPSA id 83E3C584065 for ; Fri, 11 Jan 2013 07:51:46 -0800 (PST) Date: Fri, 11 Jan 2013 09:51:44 -0600 (CST) From: Nik Martin Reply-To: Nik Martin To: cloudstack-users@incubator.apache.org Subject: Usage API Paging question Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org Could someone post some pseudocode on how to use paging when processing usage reports? I'm having a bit of trouble getting my head wrapped around this. Here's pseudocode for what I have right now: default.page.size: 2000 var page=1 usage = api.listusage{domain:xxx, page:page, pagesize: 2000, startdate:xx-xx-xxxx, enddate: xx-xx-xxxx}; while usage.length = 2000{ //there are more records page+=1; usage= usage + api.listusage{domain:xxx, page:page, pagesize: 2000, startdate:xx-xx-xxxx, enddate: xx-xx-xxxx}; } Is this in line with what I should be doing? As long as the number of records is 2000, it can be assumes that there are more records, so I should fetch until usage.length < 2000. Regards, Nik Nik Martin +1.251.243.0043 x1003 Relentless Reliability