Software Development Kit (SDK) and API Discussions

Setting timezone with NMSDK

cams
5,681 Views

Hi all,

 

Is it possible to set the timezone of a cluster/vserver with NMSDK?

Looking at the latest manual for 5.5, it appears all you can do is get the timezone (clock-get-timezone)

However if you search the manual, it shows references to 7-mode api calls that suggest setting it was once a thing.

 

"doc/WebHelp/help/guide_to_product_apis/data_ontap_7g_apis/data_ontap_apis/clock/index.html"

 

has

clock-set-clock and clock-set-timezone

 

thanks

Cam

5 REPLIES 5

asulliva
5,637 Views

Hi Cam,

 

Unfortunately there is no ZAPI for changing the timezone of a cluster.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

cams
5,635 Views

I managed to solve this using the NMSDK 5.5 api call

Here is a snippit of how I was able to do it using python.

It is using an undocumented NMSDK call that I was sent by a NetApp employee who grabbed it from this site.

 

https://andyleonard.com/2012/02/27/filling-in-the-missing-parts-of-netapps-api/

 

timezone = 'Australia/Brisbane'

args = NaElement('args')
args.child_add(NaElement('arg', 'cluster'))
args.child_add(NaElement('arg', 'date'))
args.child_add(NaElement('arg', 'modify'))
args.child_add(NaElement('arg', '-timezone'))
args.child_add(NaElement('arg', timezone))

systemCli = NaElement('system-cli')
systemCli.child_add(args)

connection = NaServer(clusterManagementIp, 1, 15)
connection.set_admin_user(username, password)
response = connection.invoke_elem(systemCli)

 

asulliva
5,633 Views

system-cli may work, just be aware it's not a supported API (notice it's not in the documentation).  The usual recommendation is to use an SSH library to connect to the controller to issue CLI commands...for example, the PowerShell Toolkit has the "Invoke-NcSsh" cmdlet for these instances.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

cams
5,631 Views

Do they have an equavilant python and/or unix call for this?

Yeah I could probably write some hack in python to connect to the node using SSH.

 

But for me system-cli is working and until NetApp decide to fix their broken API this will have to do.

oferkes
5,262 Views

hi,

 

is it working for you on a c-mode cluster?

i am running the same command as you but it returns empty.

did you do some configuration on the cluster side to enable the usage of system-cli feature?

 

Thanks,

ofer

Public