ONTAP Discussions

Highlighted

[REST CLI API] Unable to create quota policy rule in the specified policy

Hi all,


I'm stuck on creating quota policy rules in the specified policy(not SVM default) via CLI REST API.

There is a requirement in my team to create such policy rule, which can be performed on ONTAP CLI with something like:

volume quota policy rule create -vserver svm12 -policy-name quota_policy_svm12 -volume vff5716a8cf824acaa5c441d515ea7287 -type tree -target nfs -disk-limit 107374182400 -file-limit 3276800


Here it is mandatory to create a rule outside the SVM default quota policy, so using `/storage/quota/rules` does not meet our requirements.
I understand that using CLI API `private/cli/volume/quota/policy/rule` is the only way to get this accomplished in the new API world.

 

I get following error when I perform this via CLI API(running on ONTAP9.7P6, P7):

$ curl -k -uadmin -XPOST -d'{"vserver": "svm12", "volume": "vff5716a8cf824acaa5c441d515ea7287", "policy-name": "quota_policy_svm12", "disk-limit": 107374182400, "file-limit": 3276800, "type": "tree", "target": "nfs"}' https://10.161.64.220/api/private/cli/volume/quota/policy/rule
Enter host password for user 'admin':
{
"error": {
"message": "Unexpected argument \"volume\".",
"code": "262179",
"target": "volume"
}
}$

 

which is similar to what I experimentally include invalid parameter "foo":

$ curl -k -uadmin -XPOST -d'{"vserver": "svm12", "foo": "bar", "volume": "vff5716a8cf824acaa5c441d515ea7287", "policy-name": "quota_policy_svm12", "disk-limit": 107374182400, "file-limit": 3276800, "type": "tree", "target": "nfs"}' https://10.161.64.220/api/private/cli/volume/quota/policy/rule
Enter host password for user 'admin':
{
"error": {
"message": "Unexpected argument \"foo\".",
"code": "262179",
"target": "foo"
}
}$ 

 

When I also try to remove "volume" parameter from the request, it replies like

$ curl -k -uadmin -XPOST -d'{"vserver": "svm12", "policy-name": "quota_policy_svm12", "disk-limit": 107374182400, "file-limit": 3276800, "type": "tree", "target": "nfs"}' https://10.161.64.220/api/private/cli/volume/quota/policy/rule
Enter host password for user 'admin':
{
"error": {
"message": "\"volume\" is a required field",
"code": "2",
"target": "volume"
}
}$

 

which is exactly the same response as what it behaves through the ONTAP command:

lb2vx-00010002n::> volume quota policy rule create -vserver svm12 -policy-name quota_policy_svm12 -type tree -target nfs -disk-limit 107374182400 -file-limit 3276800
Error: command failed: "volume" is a required field

lb2vx-00010002n::>

 

From these behaviors, I can assume that there is a bug in the validation process in the REST API server running on ONTAP,
and the request is rejected before it gets actually passed to the filer itself.

Could you please check if this is a bug or not?
Please let me know if the usage here is wrong.


Thank you very much for your kind support,

Hiroshi Abe

1 REPLY 1
Highlighted

Re: [REST CLI API] Unable to create quota policy rule in the specified policy

It might be a bug. I tried reproing and got the same result. Please open a case.

View solution in original post

Check out the KB!
Knowledge Base
All Community Forums