How to update "quota_cluster_limit" settings of a quota object through REST API?

Hi, I can update the vCPU and memory quota by editing a Quota object of a datacenter through webadmin portal, but it seems that I cannot update through REST API... For example, I have a quota object with a global quota_cluster_limit object: GET https://192.168.80.168/ovirt-engine/api/datacenters/ 5ad4fafe-0253-0015-0215-000000000378/quotas/8a6b3336- 2dfc-4e40-a58e-9bdcb45d228a/quotaclusterlimits/ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <quota_cluster_limits> <quota_cluster_limit href="/ovirt-engine/api/ datacenters/5ad4fafe-0253-0015-0215-000000000378/quotas/ 8a6b3336-2dfc-4e40-a58e-9bdcb45d228a/quotaclusterlimits/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a" id="8a6b3336-2dfc-4e40-a58e-9bdcb45d228a"> <memory_limit>16.0</memory_limit> <memory_usage>0.0</memory_usage> <vcpu_limit>6</vcpu_limit> <vcpu_usage>0</vcpu_usage> <quota href="/ovirt-engine/api/ datacenters/5ad4fafe-0253-0015-0215-000000000378/quotas/ 8a6b3336-2dfc-4e40-a58e-9bdcb45d228a" id="8a6b3336-2dfc-4e40-a58e-9bdcb45d228a"/> </quota_cluster_limit> </quota_cluster_limits> But when I try to do PUT https://192.168.80.168/ovirt-engine/api/datacenters/5ad4fafe-0253-0015-0215- 000000000378/quotas/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a/ quotaclusterlimits/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a with request body like: <quota_cluster_limit> <vcpu_limit>8</vcpu_limit> </quota_cluster_limit> I got *405 Method Not Allowed.* Could anyone give me some advices?

Hi, Currently the REST API does not support updating the quota_cluster_limit using the PUT method. To change the limit, it has to be removed first using DELETE method and then added again using POST. The methods are described in the API documentation here: http://ovirt.github.io/ovirt-engine-api-model/4.2/#services/quota_cluster_li... The same also applies to quota_storage_limit. The web UI does the same in the background, when changing quota_cluster_limit or quota_storage_limit. Best regards, Andrej On 9 May 2018 at 08:48, Shao-Da Huang <sdhuang32@gmail.com> wrote:
Hi,
I can update the vCPU and memory quota by editing a Quota object of a datacenter through webadmin portal, but it seems that I cannot update through REST API...
For example, I have a quota object with a global quota_cluster_limit object:
GET https://192.168.80.168/ovirt-engine/api/datacenters/5ad4fafe -0253-0015-0215-000000000378/quotas/8a6b3336-2dfc-4e40- a58e-9bdcb45d228a/quotaclusterlimits/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <quota_cluster_limits> <quota_cluster_limit href="/ovirt-engine/api/datace nters/5ad4fafe-0253-0015-0215-000000000378/quotas/8a6b3336- 2dfc-4e40-a58e-9bdcb45d228a/quotaclusterlimits/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a" id="8a6b3336-2dfc-4e40-a58e-9bdcb45d228a"> <memory_limit>16.0</memory_limit> <memory_usage>0.0</memory_usage> <vcpu_limit>6</vcpu_limit> <vcpu_usage>0</vcpu_usage> <quota href="/ovirt-engine/api/datace nters/5ad4fafe-0253-0015-0215-000000000378/quotas/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a" id="8a6b3336-2dfc-4e40-a58e-9bdcb45d228a"/> </quota_cluster_limit> </quota_cluster_limits>
But when I try to do
PUT https://192.168.80.168/ovirt-engine/api/datacenters/5ad4fafe -0253-0015-0215-000000000378/quotas/8a6b3336-2dfc-4e40- a58e-9bdcb45d228a/quotaclusterlimits/8a6b3336-2dfc-4e40-a58e-9bdcb45d228a
with request body like: <quota_cluster_limit> <vcpu_limit>8</vcpu_limit> </quota_cluster_limit>
I got *405 Method Not Allowed.* Could anyone give me some advices?
_______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org
participants (2)
-
Andrej Krejcir
-
Shao-Da Huang