Software Development Kit (SDK) and API Discussions

ONTAP 9.7 Rest API QuotaRule Python Libraries


Trying to add a new user rule and getting the following error, what am I missing?


File "/usr/local/lib/python3.8/dist-packages/netapp_ontap/", line 191, in __getattribute__
raise AttributeError(
AttributeError: The 'svm' field has not been set on the QuotaRule. Try refreshing the object by calling get().


Here is the sample code

from netapp_ontap import config
from netapp_ontap import HostConnection
from netapp_ontap.resources import QuotaRule


with HostConnection("", username="admin", password="****", verify=False):
resource = QuotaRule() = "svm0" = "NFS2"
resource.type = "user"
resource.users = [{"name": "fred2"}] = "qt1"
resource.user_mapping = "off" = 8192 = 1024
resource.files.hard_limit = 20
resource.files.soft_limit = 10

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums