Software Development Kit (SDK) and API Discussions

Highlighted

python Rest Api 9.7 new user quota fails

When trying to add a new user quota the error is:

 

"users" is a required input for creating a user rule and "group" is not allowed

 

The arguments passed are:

newquota = QuotaRule(users=[{'name': linname}] , svm={'name' : self.storage_controllers[self.site]['vserver']}, volume={'name':'vol_users'}, qtree={'name':'users'}, type='user',user_mapping="off", space={'hard_limit':new_quota_size})

 

From what i can see seems that the variable is not passed to the api request.

 

Python 3.6

netapp-ontap 9.7.2

 

Modify quotas works as expected.

Any suggestion ?

2 REPLIES 2
Highlighted

Re: python Rest Api 9.7 new user quota fails

Hi @nicola_mendella ,

 

It looks like a bug.

This is because the marshmallow schema for  QuotaReportUsersSchema doesn't allow postable field for name, even id.

So you can modify quota_report_users.py in the library like


class QuotaReportUsersSchema(ResourceSchema):
"""The fields of the QuotaReportUsers object"""

id = fields.Str(data_key="id")
r""" Quota target user ID """

name = fields.Str(data_key="name")
r""" Quota target user name """

@property
def resource(self):
return QuotaReportUsers

@property
def patchable_fields(self):
return [
]

@property
def postable_fields(self):
return ['name'
]

 

View solution in original post

Highlighted

Re: python Rest Api 9.7 new user quota fails

Thank You. This solved the issue.

Check out the KB!
Knowledge Base
All Community Forums