ONTAP Rest API Discussions

how to do lun show -path via API

kbhonagiri
925 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
894 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
888 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
895 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