...
However if you have a batch of domains that you need to set a quota on or if you have a regular check that you want to report the management api is there to give you a hand.
How to get the status of Quotas
In the docs this is what is written to check wether the feature is enabled at all , do this first with the user that you are attempting to perform quota checks with.
...
GET /_admin/manage/quota/status
translated to curlcURL
Code Block | ||
---|---|---|
| ||
curl -iL -u <user>:<password> 'http://<gateway-ip>:<gateway-port>/_admin/manage/quota/status' |
...
Code Block |
---|
HTTP/1.1 200 OK Date: Mon, 24 Apr 2023 15:36:44 GMT Content-Type: application/json Server: Cloud Gateway SCSP/7.10.4 Gateway-Request-Id: 34A21DA7ADAAFB8E Gateway-Manage-API-Version: 2.0 Content-Length: 47 {"queueSize":1,"stateChanges":1,"enabled":true} |
How to check on a single domain
The permission required at a userlevel on the domain / bucket or tenant that you are querying here is GetQuota
...
In this scenario the 10.42.0.63 address is my gateway and the 8084 port is my scsp SCSP endpoint.
Code Block | ||
---|---|---|
| ||
curl -IL -u <user>:<password> http://10.42.0.63:8084/_admin/manage/tenants/<tenant>/domains/<domain>/quota/check |
curl cURL -IL is a head request.
if we just wanted to check the tentant tenant quota the request for a tenant named tenant1 would look like this.
...
x-caringo-meta-quota-state: ok
...
Quota Metric Check
Code Block | ||
---|---|---|
| ||
curl -IL -u periferyadmin:Datacore1! http://10.42.0.63:8084/_admin/manage/tenants/_system/domains/avi-transporter-mk1.local/quota/storage |
...
The action on hitting the limit is nowrite and the size is 10GB the value is reported in Bytes 10737418240
= 10GB
Setting a storage limit
The api for a storage limit looks like this
Code Block |
---|
PUT /_admin/manage/tenants/{T}/ quota/{M}/limit domains/{D}/quota/{M}/limit domains/{D}/buckets/{B}/quota/{M}/limit |
translated to curl cURL →
Code Block | ||
---|---|---|
| ||
curl -L -X PUT -u <user>:<password> "http://10.42.0.63:8084/_admin/manage/tenants/tenant1/domains/domain1/quota/storage/limit?limit=10GB&state=nowrite" |
Note that the email field is a separate request.
System Tenant
In many scenarios multi tenancy may not be required for a cluster and often the System Tenant is what is used. In this case you can still use quotas but requests like this
...
So if your domain is in the system tenant and not in a named tenant you can use this kind of curl cURL call.
Code Block | ||
---|---|---|
| ||
curl -L -X PUT -u <user>:<password> "http://10.42.0.63:8084/_admin/manage/tenants/_system/domains/domain1/quota/storage/limit?limit=10GB&state=nowrite" |
...