ONTAP Rest API Discussions

REST API brings result, but PowerShell doesn't.

PAVLENYCH
3,935 Views

Hello all,

 

I'm trying to automate getting and setting Quota for users.

So far I'm doing well and have already gotten a huge help here, but recently I ran to some strange situation from my point of view at least.

What is happening is:

I get an answer while performing the following REST API request:

https://nanaspt1/api/storage/quota/reports?users.name=CLAL-INS\”userName”&fields=*

But when I'm try to get the same information for user "userName" by using PowerShell command it doesn't bring anything:

Get-NcQuota -Volume “volumeName” -Target “userName”

 

Could you please think about why there is a different behaviour, even though both ways have to bring the same result based on my knowledge with NetApp?

 

BR,

Pavel

6 REPLIES 6

aladd
3,876 Views

Are you able to provide a sample output from "Get-NcQuota -Volume “volumeName” -Target *username*"?

aladd
3,876 Views

Are you able to provide a sample output from "Get-NcQuota -Volume “volumeName” -Target *username*"?

PAVLENYCH
3,863 Views

Hello.

It just brings no information.

By the way, one thing, but very important thing I didn't mention: "get-ncquota" doesn't bring anything not for all users.

To make picture cleaner:

Rest API does bring information for every user, but "get-ncquota" doesn't.

 

BR,

Pavel

 

aladd
3,832 Views

Hi Pavel,

 

What version of the PSTK are you using, and with what version of ONTAP are you using?

 

Also, can you check the connection to storage, verifying that you are connected to the correct cluster management LIF, using the powershell cmdlets?

PAVLENYCH
3,817 Views

@aladd 

 

I'm not sure about PowerShell version, but it must be the last one or one version before.

NetApp is 9.6.

I'm not Storage administrator, therefore sorry, if make a mistake in NetApp lexicon. 

There is one name I've gotten from NetApp administrator, as my understanding it's a virtual name of Cluster.

I don't think there is some problem with connection, because no matter from which server I'm connected to the storage there are users I can get their information regarding storage usage, using Rest API, but PowerShell doesn't bring me such information, it brings nothing.

 

BR,

Pavel

aladd
3,738 Views

You can pull the version using the cmdlet "get-module -name *Data*"

 

Also, do you know which SVM you are connected to from the cluster?

Public