serverinfo
serverinfo copied to clipboard
some values need to be documented
Hi,
on the serverinfo page you see a lot of information, most of them are self explained, but some other not, for example:
<permissions_0_1>187</permissions_0_1>
<permissions_3_1>2367</permissions_3_1>
<permissions_6_1>1</permissions_6_1>
<permissions_0_3>6</permissions_0_3>
<permissions_0_5>1</permissions_0_5>
<permissions_0_7>4</permissions_0_7>
<permissions_0_15>55</permissions_0_15>
<permissions_3_15>106</permissions_3_15>
<permissions_6_15>1</permissions_6_15>
<permissions_0_17>113</permissions_0_17>
<permissions_0_19>187</permissions_0_19>
<permissions_0_21>15</permissions_0_21>
<permissions_0_23>13</permissions_0_23>
<permissions_0_31>583</permissions_0_31>
<permissions_1_31>1</permissions_1_31>
<permissions_2_31>2</permissions_2_31>
it would be nice if you documented it somewhere
Looks like the first one is the type and the second number the permission:
types: https://github.com/nextcloud/server/blob/0eebff152a177dd59ed8773df26f1679f8a88e90/lib/private/Share/Constants.php#L32-L39
permissions: https://github.com/nextcloud/server/blob/5ca0ad4f678c067e4a33871f202a8cfd216a6769/lib/public/Constants.php#L44-L49
cc @MariusBluem @jospoortvliet
What about following addition to the monitoring endpoint like: (while keeping <permissions_X_Y> due to backwards-compatibility)
<permissions>
<element>
<permissions>
<element>
PERMISSION_READ
</element>
<element>
PERMISSION_UPDATE
</element>
</permissions>
<share_type>SHARE_TYPE_LINK</share_type>
<count>1</count>
</element>
<element>
<permissions>
<element>
PERMISSION_CREATE
</element>
</permissions>
<share_type>SHARE_TYPE_LINK</share_type>
<count>1</count>
</element>
</permissions>
The SHARE_TYPE_* and PERMISSION_* constants are being automatically retrieved by using reflection from the above mentioned classes by @MorrisJobke.
IMHO the main advantages are:
- It's easier to understand for humans, making it also easier to build a monitoring for it when you know what are you actually monitoring. (Without digging through a lot of docs, code or GitHub issues)
- It's easier to parse than splitting up
permission_X_Yby its IDs (X, Y).
Let's consolidate further discussion about potential documentation matters for the endpoint to https://github.com/nextcloud/serverinfo/issues/40.