The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Software Development Kit (SDK) and API Discussions

how to add a rule to a quota policy with OnTap API

foxd

I want to use the OnTap API to add a rule to a quota policy.  In this specific case to change the quota for a user from the default.  I cannot find the function to use in zexplore under quota or volume.

From the command line on the filer I would run:

 

volume quota policy rule create -vserver nfs1 -policy-name user_quota -volume v0 -type user -target 5120 -qtree "" -disk-limit 32GB

 

Thanks in advance for your help.

 

1 ACCEPTED SOLUTION

asulliva

Hello!

 

You will want to use the "quota-add-entry" API.

 

As an aside, you can view the CLI <-> API map using the command "security login role show-ontapi".

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

2 REPLIES 2

asulliva

Hello!

 

You will want to use the "quota-add-entry" API.

 

As an aside, you can view the CLI <-> API map using the command "security login role show-ontapi".

 

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

foxd

Thanks for the answer, I also came to the same conclusion after posting. In case it helps others below is what I learned.

 

1) The quota modify api calls are listed under the "Vserver" section in zexplore, not the "Cluster-Mode" section.

2) To use the Vserver section of calls you need to target a mgmt enabled lif on the SVM and not the cluster mgmt lif.

 

Sample code can be seen in zexplore (in my case python) and the IP or Name in the NaServer object needs to me your SVM not the cluster SVM.  To modify what I wanted (just the disk space allowed)

my object looked like this:

 

api = NaElement("quota-add-entry")
api.child_add_string("disk-limit","10G")
api.child_add_string("policy","default_user_quota")
api.child_add_string("qtree","")
api.child_add_string("quota-type","user")
api.child_add_string("quota-target","7003")
api.child_add_string("volume","user_vol18")

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public