Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-21-2009, 05:13 PM
Junior Member
 
Posts: 5
Default How to retrieve quota limit of a user via SOAP?

Hi,

I am trying to retrieve the quota limit of a user via SOAP. I found that I can retrieve user used quota with GetInfoRequest but not the quota limit. I can also retrieve used quota and quota limit of all users via the admin SOAP API.

However, I failed to find any SOAP API to retrieve the quota limit of one user.

Can anyone give me any hints? Thanks.

Jacky
Reply With Quote
  #2 (permalink)  
Old 09-21-2009, 08:38 PM
raj raj is offline
Moderator
 
Posts: 768
Default

info from soap-admin.txt

Quote:
<GetQuotaUsageRequest [limit="..."] [offset="..."] [domain="{limit-to-domain}"]
[sortBy="{sort-by}"] [sortAscending="{sort-ascending}"]]>
</GetQuotaUsageRequest>

<GetQuotaUsageResponse more="{more-flag}" [searchTotal="{search-total}"]>
<account name="{name}" id="{id}" used="quota-used" limit="quota-limit"/>+
</GetQuotaUsageResponse>

Notes:
GetQuotaUsageRequest
limit - the number of accounts to return (0 is default and means all)
offset - the starting offset (0, 25, etc)
domain - the domain name to limit the search to
sortBy - valid values: "percentUsed", "totalUsed", "quotaLimit"
sortAscending - whether to sort in ascending order (0/1), 0 is default, so highest quotas are returned first
more-flag = true if more accounts left to return
search-total = total number of accounts that matched search (not affected by limit/offset)
used = used quota in bytes, or 0 if no quota used
limit = quota limit in bytes, or 0 if unlimited

The target server should be specified in the soap header (see soap.txt, <targetServer>).

When sorting by "quotaLimit", 0 is treated as the highest value possible.
__________________
i2k2 Networks
Dedicated & Shared Zimbra Hosting Provider
Reply With Quote
  #3 (permalink)  
Old 09-21-2009, 08:50 PM
Junior Member
 
Posts: 5
Default

Hi Raj,

Thanks for your information. I came across this API before. However, this API will retrieve information for all users. If requirement is to get the limit of one user. If I have a thousands of user in a deployment, it will take ages to retrieve the limit of the user. Are there any API to retrieve quota limit by username or similar? Thanks again.

Jacky
Reply With Quote
  #4 (permalink)  
Old 09-22-2009, 09:09 PM
raj raj is offline
Moderator
 
Posts: 768
Default

<BatchRequest xmlns="urn:zimbra" onerror="continue">
<GetAccountRequest xmlns="urn:zimbraAdmin" applyCos="0">
<account xmlns="" by="id">zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz</account>
</GetAccountRequest>
<GetMailboxRequest xmlns="urn:zimbraAdmin">
<mbox xmlns="" id=""zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz""></mbox>
</GetMailboxRequest>
</BatchRequest>

zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz = zimbraId of the user
check the response you should get
"zimbraMailQuota" = user quota from GetAccountResponse
"s" = used quota from GetMailboxResponse

if you developing the please get firefox + firebug and check the console for POST and that is all you ever need.

Raj
__________________
i2k2 Networks
Dedicated & Shared Zimbra Hosting Provider
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.