JAMES-2349 Add user quota endpoints in WebAdmin documentation
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0062f1f5 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0062f1f5 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0062f1f5 Branch: refs/heads/master Commit: 0062f1f5641a3b8c924b3386407ee349f277d2c5 Parents: 2c5be2f Author: Antoine Duprat <[email protected]> Authored: Tue Mar 13 16:38:53 2018 +0100 Committer: benwa <[email protected]> Committed: Thu Mar 15 15:54:59 2018 +0700 ---------------------------------------------------------------------- src/site/markdown/server/manage-webadmin.md | 146 +++++++++++++++-------- 1 file changed, 99 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/0062f1f5/src/site/markdown/server/manage-webadmin.md ---------------------------------------------------------------------- diff --git a/src/site/markdown/server/manage-webadmin.md b/src/site/markdown/server/manage-webadmin.md index e7cc226..d3ad7fe 100644 --- a/src/site/markdown/server/manage-webadmin.md +++ b/src/site/markdown/server/manage-webadmin.md @@ -227,124 +227,176 @@ Response codes: - 404: The user name does not exist - 500: Internal error -## Administrating quotas -A quota with a value of -1 means unlimited +## Administrating quotas by users -### Reading per quotaroot mail count limitation +### Getting the quota for a user ``` -curl -XGET http://ip:port/quota/count +curl -XGET http://ip:port/quota/users/usernameToBeUsed ``` -The answer looks like: +Resource name usernameToBeUsed should be an existing user + +The answer can contain a fixed value, an empty value (null) or an unlimited value (-1): ``` -100000 +{"count":52,"size":42} + +{"count":null,"size":null} + +{"count":52,"size":-1} ``` Response codes: - - 200: Nothing special - - 500: Internal error -### Updating per quotaroot mail count limitation + - 200: The user's quota was successfully retrieved + - 404: The user does not exist + - 500: Internal error while accessing the user's quota + +### Updating the quota for a user ``` -curl -XPUT http://ip:port/quota/count -d '1024000000' +curl -XPUT http://ip:port/quota/users/usernameToBeUsed ``` -Response codes: +Resource name usernameToBeUsed should be an existing user - - 204: Value updated - - 400: The body is not a positive integer - - 500: Internal error +The body can contain a fixed value, an empty value (null) or an unlimited value (-1): -### Removing per quotaroot mail count limitation +``` +{"count":52,"size":42} -It removes the limitation, and the quota becomes UNILIMITED. +{"count":null,"size":null} -``` -curl -XDELETE http://ip:port/quota/count +{"count":52,"size":-1} ``` Response codes: - - 204: Value updated to UNLIMITED - - 500: Internal error + - 204: The quota has been updated + - 400: The body is not a positive integer or not unlimited value (-1). + - 404: The user does not exist + - 409: The requested restriction canât be enforced right now. + - 500: Internal server error - Something went bad on the server side. -### Reading per quotaroot size limitation +### Getting the quota count for a user ``` -curl -XGET http://ip:port/quota/size +curl -XGET http://ip:port/quota/users/usernameToBeUsed/count ``` +Resource name usernameToBeUsed should be an existing user + The answer looks like: ``` -100000 +52 +``` + +Response codes: + + - 200: The user's quota was successfully retrieved + - 404: The user does not exist + - 500: Internal error while accessing the user's quota + +### Updating the quota count for a user + +``` +curl -XPUT http://ip:port/quota/users/usernameToBeUsed/count ``` -It represent the allowed Byte count of the mailboxes belonging to this quotaroot. +Resource name usernameToBeUsed should be an existing user + +The body can contain a fixed value or an unlimited value (-1): + +``` +52 +``` Response codes: - - 200: Nothing special - - 500: Internal error + - 204: The quota has been updated + - 400: The body is not a positive integer or not unlimited value (-1). + - 404: The user does not exist + - 409: The requested restriction canât be enforced right now. + - 500: Internal server error - Something went bad on the server side. -### Updating per quotaroot size limitation +### Deleting the quota count for a user ``` -curl -XPUT http://ip:port/quota/size -d '1024000000' +curl -XDELETE http://ip:port/quota/users/usernameToBeUsed/count ``` +Resource name usernameToBeUsed should be an existing user + Response codes: - - 204: Value updated - - 400: The body is not a positive integer - - 500: Internal error + - 204: The quota has been updated to unlimited value. + - 400: The body is not a positive integer or not unlimited value (-1). + - 404: The user does not exist + - 409: The requested restriction canât be enforced right now. + - 500: Internal server error - Something went bad on the server side. + +### Getting the quota size for a user -### Removing per quotaroot size limitation +``` +curl -XGET http://ip:port/quota/users/usernameToBeUsed/size +``` -It removes the limitation, and the quota becomes UNILIMITED. +Resource name usernameToBeUsed should be an existing user + +The answer looks like: ``` -curl -XDELETE http://ip:port/quota/size +52 ``` Response codes: - - 204: Value updated to UNLIMITED - - 500: Internal error + - 200: The user's quota was successfully retrieved + - 404: The user does not exist + - 500: Internal error while accessing the user's quota -### Managing count and size at the same time +### Updating the quota size for a user ``` -curl -XGET http://ip:port/quota/ +curl -XPUT http://ip:port/quota/users/usernameToBeUsed/size ``` -Will return: +Resource name usernameToBeUsed should be an existing user + +The body can contain a fixed value or an unlimited value (-1): ``` -{"count":52,"size":42} +52 ``` Response codes: - - 200: Success - - 500: Internal error + - 204: The quota has been updated + - 400: The body is not a positive integer or not unlimited value (-1). + - 404: The user does not exist + - 409: The requested restriction canât be enforced right now. + - 500: Internal server error - Something went bad on the server side. -You can also write the value the same way: +### Deleting the quota size for a user ``` -curl -XPUT http://ip:port/quota/ -d '{"count":52,"size":42}' +curl -XDELETE http://ip:port/quota/users/usernameToBeUsed/size ``` +Resource name usernameToBeUsed should be an existing user + Response codes: - - 204: Success - - 400: Invalid JSON, or numbers are less than -1. - - 500: Internal error + - 204: The quota has been updated to unlimited value. + - 400: The body is not a positive integer or not unlimited value (-1). + - 404: The user does not exist + - 409: The requested restriction canât be enforced right now. + - 500: Internal server error - Something went bad on the server side. + ## Cassandra Schema upgrades Cassandra upgrades implies the creation of a new table. Thus restarting James is needed, as new tables are created on restart. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
