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 Rest API Discussions

how to do lun show -path via API

kbhonagiri
2,636 Views
Hi All, 
how do i get information of serial-hex of a lun using API. Essentaily i need to get output  of "lun show -path" using API  
1 ACCEPTED SOLUTION

steiner
2,605 Views

The serial_number property returned by the GET /storage/luns/{uuid} can be converted to hex. That ASCII and the hex are the same thing. 

 

For example:

 

[root@jfs0 current]# echo -n '80A2z+UglTqg' | od -A n -t x1
38 30 41 32 7a 2b 55 67 6c 54 71 67

View solution in original post

2 REPLIES 2

ddegraaf
2,599 Views

The LUN endpoints do not support returning the serial number in hexadecimal form. However, you can retrieve the serial number through the REST API with "/api/storage/luns?fields=serial_number". You can then convert this returned string to to a hexadecimal string. (this is can be done by getting the hexadecimal value of each character in the string and putting them together to get the hexadecimal string)

 

While imperfect, this should get you what you're looking for!

Please let me know if you have further questions!

Daniel

steiner
2,606 Views

The serial_number property returned by the GET /storage/luns/{uuid} can be converted to hex. That ASCII and the hex are the same thing. 

 

For example:

 

[root@jfs0 current]# echo -n '80A2z+UglTqg' | od -A n -t x1
38 30 41 32 7a 2b 55 67 6c 54 71 67

Public