No description
Find a file
Côme Chilliet 22ffc10cf6
Merge pull request #83 from madrzejewski/master
Fix Call to undefined method OC_Helper::computerFileSize (#82)
2025-10-16 14:45:26 +02:00
.github/workflows update workflows 2025-02-25 17:18:21 +01:00
appinfo chore: 0.2.3 2025-09-30 11:18:09 +02:00
lib Fix Call to undefined method OC_Helper::computerFileSize (#82) 2025-10-16 10:14:52 +02:00
tests chore: psalm fixes 2025-02-25 17:19:48 +01:00
vendor-bin chore: composer update 2025-09-30 11:23:38 +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 chore: move to vendor-bin 2025-02-25 17:19:48 +01:00
CHANGELOG.md cleanup and changelog 2021-02-26 21:02:20 +01:00
composer.json chore: move to vendor-bin 2025-02-25 17:19:48 +01:00
composer.lock chore: composer update 2025-09-30 11:23:38 +02:00
krankerl.toml ci setup and psalm fixes 2021-02-26 20:38:40 +01:00
LICENSE Create LICENSE 2018-03-19 19:41:37 +01:00
psalm-baseline.xml psalm fixes 2023-03-10 21:03:16 +01:00
psalm.xml chore: psalm fixes 2025-02-25 17:19:48 +01:00
README.md Add free command documentation 2024-12-10 09:33:59 +01:00

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

Get the free space for a group

occ groupquota:free 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.