ONTAP Rest API Discussions

Getting spare-disk list trough ZAPI and REST-API

ilantivienna
3,353 Views

Does anybody know how to get the list of available spare disks? On the CLI it's easy:

 

 

sim96cluster::> storage aggregate show-spare-disks 
                                                                      
Original Owner: sim96cluster-01
 Pool0
  Spare Pool

                                                             Usable Physical
 Disk             Type   Class          RPM Checksum           Size     Size Status
 ---------------- ------ ----------- ------ -------------- -------- -------- --------
 NET-1.4          FCAL   performance  15000 block            1020MB   1.00GB not zeroed
 NET-1.5          FCAL   performance  15000 block            1020MB   1.00GB not zeroed
 NET-1.6          FCAL   performance  15000 block            1020MB   1.00GB not zeroed
 NET-1.18         FCAL   performance  15000 block            1020MB   1.00GB not zeroed
 NET-1.19         FCAL   performance  15000 block            1020MB   1.00GB not zeroed
 NET-1.27         FCAL   performance  15000 block            1020MB   1.00GB zeroed
 NET-1.28         FCAL   performance  15000 block            1020MB   1.00GB zeroed
7 entries were displayed.

 

But how would I get this list with the good old ZAPI but although with the newer RestAPI?

3 REPLIES 3

donny_lang
3,330 Views

Do you have a hard requirement to use either native ZAPI or REST calls? It's quite easy to do via the PowerShell Toolkit, for example: 

 

Get-NcDisk | Where-Object {$_.DiskRaidInfo.ContainerType -eq "spare"}

However, if you need a ZAPI and REST example specifically, I can whip those up too. Might just take a little longer than PowerShell. 🙂 

ilantivienna
3,309 Views

Thanks a lot for your answer - always good to take a step behind and look for completely other solutions.

 

I am writing a plugin for a monitoring-system running on Linux servers. So Powershell is not an option. But I wonder how it could be so easy in Powershell? I always thought these SDKs are just wrappers around the generic XML-based API. That was at least the impression I got when working with the Perl ZAPI.

 

If you could point me to the right (Z)API I would be really grateful.

 

Thanks so far, Ingo

 

P.S. Just read your answer again: The problem is, that I can not use the container-type as indication for a spare disk. In the meantime my assumption, that we can use the the type field a indicator proved as wrong. So back to the start ... I will file a new question, once we have found the right attribute.

JS_Patil
3,104 Views

Are there ZAPI commands which gives the same data as following  CLI command - 

memory dimm show -instance
nfs show -fields vserver,udp,tcp
system controller ioxm show

 

Public