NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Discussions

How can I get disk-limit immediately after quota-resize?

h-maeda
2,837 Views

SDK : netapp-manageability-sdk-5.4P1    powershell

 

 

SAMPLE -----

 

[NetApp.Manage.NaElement] $in =  New-Object NetApp.Manage.NaElement("quota-resize");
$in.AddNewChild("volume",$volume);
[NetApp.Manage.NaElement] $out = $s.InvokeElem($in);

[NetApp.Manage.NaElement] $in =  New-Object NetApp.Manage.NaElement("quota-report-iter");
$in.AddNewChild("path",$path2q);
[NetApp.Manage.NaElement] $out = $s.InvokeElem($in);

[System.Collections.IList] $quotaList =  $out.GetChildByName("attributes-list").GetChildren();
[System.Collections.IEnumerator] $quotaIter = $quotaList.GetEnumerator();
while($quotaIter.MoveNext()){
   [NetApp.Manage.NaElement] $quotaInfo = $quotaIter.Current;
   $quotasize_ = $quotaInfo.GetChildContent("disk-limit");     ★
}

-------

 

 

★ this line dosent work.

 

if "sleep 1" above of line[$out.GetChildByName("attributes-list").GetChildren();]

it works.

 

Is there a way to avoid errors other than "sleep" ?

 

 

Best regards.

 

 

1 ACCEPTED SOLUTION

h-maeda
2,687 Views

Hello,

 

I decided to use inifinite loop.

like this.

 

---------------------

while(1){

 

[NetApp.Manage.NaElement] $in =  New-Object NetApp.Manage.NaElement("quota-report-iter");
$in.AddNewChild("path",$path2q);
[NetApp.Manage.NaElement] $out = $s.InvokeElem($in);

[System.Collections.IList] $quotaList =  $out.GetChildByName("attributes-list").GetChildren();
[System.Collections.IEnumerator] $quotaIter = $quotaList.GetEnumerator();
while($quotaIter.MoveNext()){
   [NetApp.Manage.NaElement] $quotaInfo = $quotaIter.Current;
   $quotasize_ = $quotaInfo.GetChildContent("disk-limit");

   if($quotasize_ -ne "-"){

     $FLG = "ON"

   }

 

if($FLG = "ON"){

    break

}


}

--------------

 

 

i think getreportDB separates quotaDB.and quotaDB push to reportDB regulary(ex every 1 second).

if push api exists,i want to use this.

 

 

Best regards

View solution in original post

1 REPLY 1

h-maeda
2,688 Views

Hello,

 

I decided to use inifinite loop.

like this.

 

---------------------

while(1){

 

[NetApp.Manage.NaElement] $in =  New-Object NetApp.Manage.NaElement("quota-report-iter");
$in.AddNewChild("path",$path2q);
[NetApp.Manage.NaElement] $out = $s.InvokeElem($in);

[System.Collections.IList] $quotaList =  $out.GetChildByName("attributes-list").GetChildren();
[System.Collections.IEnumerator] $quotaIter = $quotaList.GetEnumerator();
while($quotaIter.MoveNext()){
   [NetApp.Manage.NaElement] $quotaInfo = $quotaIter.Current;
   $quotasize_ = $quotaInfo.GetChildContent("disk-limit");

   if($quotasize_ -ne "-"){

     $FLG = "ON"

   }

 

if($FLG = "ON"){

    break

}


}

--------------

 

 

i think getreportDB separates quotaDB.and quotaDB push to reportDB regulary(ex every 1 second).

if push api exists,i want to use this.

 

 

Best regards

Public