<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic cluster mode system-cli with SDK in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/cluster-mode-system-cli-with-SDK/m-p/128925#M2309</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to get system-cli from SDK to work in clsuter mode environment, but it doesnt seem to work for me (Perl code):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $server = $_[0];&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $cmd = NaElement-&amp;gt;new("system-cli");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $cmd_args = NaElement-&amp;gt;new("args");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;$cmd_args-&amp;gt;child_add(NaElement-&amp;gt;new("arg", "df"));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;$cmd-&amp;gt;child_add($cmd_args);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $out = $server-&amp;gt;invoke_elem( $cmd );&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;if($out-&amp;gt;results_status() eq "failed")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;print($out-&amp;gt;results_reason() ."\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;exit(-2);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $results = $out-&amp;gt;child_get_string("cli-output");;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;print Dumper(\$results);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;However nothing is returned..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone please advise?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ofer&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 15:20:21 GMT</pubDate>
    <dc:creator>oferkes</dc:creator>
    <dc:date>2025-06-04T15:20:21Z</dc:date>
    <item>
      <title>cluster mode system-cli with SDK</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/cluster-mode-system-cli-with-SDK/m-p/128925#M2309</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm trying to get system-cli from SDK to work in clsuter mode environment, but it doesnt seem to work for me (Perl code):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $server = $_[0];&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $cmd = NaElement-&amp;gt;new("system-cli");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $cmd_args = NaElement-&amp;gt;new("args");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;$cmd_args-&amp;gt;child_add(NaElement-&amp;gt;new("arg", "df"));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;$cmd-&amp;gt;child_add($cmd_args);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $out = $server-&amp;gt;invoke_elem( $cmd );&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;if($out-&amp;gt;results_status() eq "failed")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;print($out-&amp;gt;results_reason() ."\n");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;exit(-2);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;my $results = $out-&amp;gt;child_get_string("cli-output");;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" color="#3366FF"&gt;print Dumper(\$results);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;However nothing is returned..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can anyone please advise?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ofer&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 15:20:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/cluster-mode-system-cli-with-SDK/m-p/128925#M2309</guid>
      <dc:creator>oferkes</dc:creator>
      <dc:date>2025-06-04T15:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: cluster mode system-cli with SDK</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/cluster-mode-system-cli-with-SDK/m-p/129943#M2323</link>
      <description>&lt;P&gt;Yeah.. its almost a month..&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you feel its fun to use perl.. im sure you will be able to figure out what you want from this....&lt;/P&gt;&lt;P&gt;I guess.. no one really use perl anymore..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;A good debugging technique would be to use: print $cmd-&amp;gt;sprintf(); to verify the element structure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/perl
#
use strict;
use warnings;
use lib "/netapp-manageability-sdk-5.6/lib/perl/NetApp";
use NaServer;
use NaElement;

my $s = new NaServer('10.10.10.11', 1 , 31);
    $s-&amp;gt;set_http_version('1.0');
    $s-&amp;gt;set_server_type('FILER');
    $s-&amp;gt;set_transport_type('HTTPS');
    $s-&amp;gt;set_port(443);
    $s-&amp;gt;set_style('LOGIN');
    $s-&amp;gt;set_admin_user('username', 'password');

my $api = new NaElement('system-cli');
    my $xi = new NaElement('args');
    $xi-&amp;gt;child_add_string("arg","version");
    $api-&amp;gt;child_add($xi);

print $api-&amp;gt;sprintf();

my $xo = $s-&amp;gt;invoke_elem($api);
if ($xo-&amp;gt;results_status() eq 'failed') {
    print 'Error:\n';
    print $xo-&amp;gt;sprintf();
    exit 1;
}

print 'Received:\n';
print $xo-&amp;gt;sprintf();&lt;/PRE&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;</description>
      <pubDate>Sun, 09 Apr 2017 07:19:23 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/cluster-mode-system-cli-with-SDK/m-p/129943#M2323</guid>
      <dc:creator>robinpeter</dc:creator>
      <dc:date>2017-04-09T07:19:23Z</dc:date>
    </item>
  </channel>
</rss>

