Allow setting disk quota for an entire group
Перейти к файлу
Ferdinand Thiessen cca9a0de8f
Merge pull request #45 from nextcloud/automated/noid/master-update-nextcloud-ocp
[master] Update nextcloud/ocp dependency
2024-09-14 18:11:14 +02:00
.github/workflows ci: Addpr-feedback.yml 2024-08-07 17:36:02 +02:00
appinfo 0.2.1 2024-07-31 15:22:18 +02:00
lib Add delete group quota feature 2024-02-09 16:23:04 +01:00
tests update stubs 2024-07-26 17:32:28 +02:00
.gitignore krankerl config 2021-02-26 21:00:50 +01:00
.nextcloudignore krankerl config 2021-02-26 21:00:50 +01:00
.php-cs-fixer.dist.php cs fix 2023-06-01 19:44:37 +02:00
CHANGELOG.md cleanup and changelog 2021-02-26 21:02:20 +01:00
LICENSE Create LICENSE 2018-03-19 19:41:37 +01:00
README.md Add delete group quota feature 2024-02-09 16:23:04 +01:00
composer.json chore: fix composer install in ci 2024-03-20 22:45:17 +01:00
composer.lock chore(dev-deps): Bump nextcloud/ocp package 2024-09-08 02:47:26 +00:00
krankerl.toml ci setup and psalm fixes 2021-02-26 20:38:40 +01:00
psalm-baseline.xml psalm fixes 2023-03-10 21:03:16 +01:00
psalm.xml psalm fixes 2023-03-10 21:03:16 +01:00

README.md

Group Quota

Allow setting a disk quota for an entire group.

Usage

Group quota can only be configured trough the command line or rest api, no admin UI is currently available.

OCC commandline Api

Get the quota for a group

occ groupquota:get Test

Get the used space for a group

occ groupquota:used Test

Set the quota for a group

occ groupquota:set Test 2GB

Delete the quota for a group

occ groupquota:delete Test

Lists all configured quotas

occ groupquota:list

All commands accept a --format(-f) option to format their output in a human readable format.

OCS Rest API

Get the quota and used space for a group

curl -u admin:admin -H 'OCS-APIRequest: true' https://example.com/apps/groupquota/quota/Test'
<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message>OK</message>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data>
  <quota_bytes>2147483648</quota_bytes>
  <quota_human>2 GB</quota_human>
  <used_bytes>855380973</used_bytes>
  <used_human>815.8 MB</used_human>
  <used_relative>39.83</used_relative>
 </data>
</ocs>

Note: as with all OCS requests the response can be json formatted by sending an Accept: application/json header

Set the quota for a group

Set the quota of group "Test" to 2GB

curl -u admin:admin -H 'OCS-APIRequest: true' https://example.com/apps/groupquota/quota/Test -X POST -d 'quota=2GB'

The new quota information will also be returned in the same format as from a GET request.

Limitations

Only one group with quota set per user is supported, behavior for users with more then one group with quota set is undefined.