Quota¶
Quotas only apply to resources (i.e. uploaded files), but not for metadata and metametadata. I.e. there is no restriction in the amount of links that can be created.
Configuration of default settings¶
By default quotas are turned off. Quotas are activated and the default quota is configured through entrystore.properties. The possible settings are:
entrystore.data.quota=on|off
entrystore.data.quota.default=bytes[unit]
Possible values for the unit in the default setting are k, m, g and t (for kilo, mega, giga and tera bytes respectively, in powers of 1024). The unit is optional, if omitted bytes are used. The default quota is used for portfolios where no specific quota has been configured. See Value syntax for the accepted boolean values.
A value of -1 means unlimited quota.
Complementary to the quota settings above, a maximum file size for resources can be specified. This setting can be configured independently from the quota settings. I.e., even if quota is off, the following setting is respected:
entrystore.data.max-file-size=bytes[unit] (default: 1G, -1 for no limit)
Uploads that exceed the maximum file size are answered with 413. See Files.
EntryStore 5.x
In 5.x entrystore.data.max-file-size has no default, i.e. the file size is not limited unless the setting is configured.
Quota per context¶
The quota of a context can only be set when the context is created, by an admin user or a member of the admin group. The value in bytes is provided as quota in the resource object of the request that creates the context entry in _contexts:
Request
POST http://{base}/_contexts
Request body (excerpt)
{
"resource": { "name": "Some Portfolio", "quota": 2097152 },
...
}
The quota of an existing context cannot be changed or reset to the default quota via the REST API, since the quota resource {context-id}/quota of 5.x does not exist in 6.x.
Quota information can be requested using GET on the context's entry URI, e.g. GET http://base/store/_contexts/entry/1. If quotas are enabled, the information is returned inside the quota object:
{
"quota": {
"quota": 2097152,
"fillLevel": 141328,
"hasDefaultQuota": false
},
"name": "Some Portfolio",
...
}
The parameter fillLevel holds information about how many bytes have been used so far by that portfolio. This value cannot be set or overridden. The quota object is omitted for callers who may read neither the metadata nor the resource of the context entry.
Quota information is accessed and modified through the Context's quota resource at http://base/store/context-id/quota.
The JSON object returned on GET requests holds 3 values:
Request
GET http://{base}/{context-id}/quota
Response
{
"quota": 2097152,
"fillLevel": 141328,
"hasDefaultQuota": false
}
If the installation does not have quota support enabled a HTTP status 501 (not implemented) is returned.
Admin users can set the quota by doing a PUT on the Context's quota resource. The only value that can be set is "quota" in bytes:
Request
PUT http://{base}/{context-id}/quota
Request body
{ "quota": 2048 }
Quota information can also be requested using GET on the context's entry URI, e.g. GET http://base/store/_contexts/entry/1. The information is returned inside the quota object.
{
"quota": {
"quota": 2097152,
"fillLevel": 141328,
"hasDefaultQuota": false
},
"name": "Some Portfolio",
...
}
The quota-specific parameters are quota, fillLevel and hasDefaultQuota.
All GET requests contain the parameter fillLevel which holds information about how many bytes have been used so far by that portfolio. This value cannot be set or overridden. The quota parameter can also be set when the context is created, but only by the admin users or users in the admin group.
Restoring default quota¶
The default quota can be restored by making a DELETE request on the context's quota resource, this removes the manual quota setting on the context.
HTTP behaviour when quotas are exceeded¶
The quota check is only performed upon creation or replacement of a binary resource. If the quota is exceeded, the response to the modifying HTTP request has a status 413 (Request Entity Too Large). The uploaded resource is not stored in the system and a previously stored file of the entry is kept.
EntryStore 5.x
In 5.x an upload that exceeds the quota also deletes the previously stored file of the entry.