Software Development Kit (SDK) and API Discussions

OnCommand Unified manager unsubscribe API example

MartijnMoretDMP
2,958 Views

Hi,

I am running OnCommand Unified manager 6.1R1.

A storage service has a reference to a volume which has been removed.

The storage service was created with CommVault version 10.

 

It did/does not do a storage service unsubscribe for that volume.

I read in the API that I need to do a unsubscribe.

My question is: Does anyone have an example to do this?

 

Sources I have used: https://library.netapp.com/ecm/ecm_download_file/ECMP1416663

 

 

Thanks!

 

Regards,

Martijn

1 ACCEPTED SOLUTION

francoisbnc
2,893 Views

Hi,

Best is to use zexplore Developpement Interface Utility to have more details.

 

This is an example in Python for retrieve subscriptions items and from  there, you can unubcribe the member you need with api  NaElement("storage-service-unsubscribe")

 

** Iterations subscriptions from storage service key

 

import sys
sys.path.append("<path_to_nmsdk_root>/lib/python/NetApp")
from NaServer import *


s = NaServer("ocum", 1 , 0)
s.set_server_type("DFM")
s.set_transport_type("HTTPS")
s.set_port(443)
s.set_style("LOGIN")
s.set_admin_user("admin", "<password>")


api = NaElement("storage-service-subscription-iter")
api.child_add_string("storage-service-resource-key","0ce429fe-4d45-4b3d-b9d7-4f9c27d1cc55:app_type=OCUM,type=storage_service,uuid=6adf153f-3702-4d8f-9df2-ade6f12bf4dc")

xo = s.invoke_elem(api)
if (xo.results_status() == "failed") :
   print ("Error:\n")
   print (xo.sprintf())
   sys.exit (1)

 

print ("Received:\n")
print (xo.sprintf())

 

 

 

View solution in original post

2 REPLIES 2

francoisbnc
2,894 Views

Hi,

Best is to use zexplore Developpement Interface Utility to have more details.

 

This is an example in Python for retrieve subscriptions items and from  there, you can unubcribe the member you need with api  NaElement("storage-service-unsubscribe")

 

** Iterations subscriptions from storage service key

 

import sys
sys.path.append("<path_to_nmsdk_root>/lib/python/NetApp")
from NaServer import *


s = NaServer("ocum", 1 , 0)
s.set_server_type("DFM")
s.set_transport_type("HTTPS")
s.set_port(443)
s.set_style("LOGIN")
s.set_admin_user("admin", "<password>")


api = NaElement("storage-service-subscription-iter")
api.child_add_string("storage-service-resource-key","0ce429fe-4d45-4b3d-b9d7-4f9c27d1cc55:app_type=OCUM,type=storage_service,uuid=6adf153f-3702-4d8f-9df2-ade6f12bf4dc")

xo = s.invoke_elem(api)
if (xo.results_status() == "failed") :
   print ("Error:\n")
   print (xo.sprintf())
   sys.exit (1)

 

print ("Received:\n")
print (xo.sprintf())

 

 

 

MartijnMoretDMP
2,872 Views

Thanks!

I was able to unsubcribe my volumes using the ZExplore interface.

As it was only one volume, I used the XML interface.

 

I used three standaard api calls:

storage-service-iter

storage-service-subscription-iter

storage-service-unsubscribe

 

Regards,

Martijn

Public