ONTAP Discussions

SDK calls DFM "host-add-ossv" failed

BRIANLIU11
1,907 Views

Hi there, I was coding ontap-SDK and got something wrong with "host-add-ossv" while interacting with dfm server. Please see the sample  below,

$dfmServer = "xxx";

$user = "xxx";

$pwd = "xxx";

$s = New-Object NetApp.Manage.NaServer ($dfmServer,"1","0");

$s.ServerType = "DFM";

$s.Style = "LOGIN_PASSWORD";

$s.TransportType = "HTTP";

$s.Port = "8088";

$s.SetAdminUser($user, $pwd);

$in = New-Object NetApp.Manage.NaElement("host-add-ossv");

$in.AddNewChild("host-name-or-id","192.168.1.2");

$Credentials = New-object NetApp.Manage.NaElement("full-ndmp-credentials");   

$Credentials.AddNewEncryptedChild("ndmp-password","ndmp");

$Credentials.AddNewChild("ndmp-username","ndmp");

$Credentials.AddNewChild("ndmp-port",10000);

$in.AddChildElement($Credentials);   

$s.InvokeElem($in);

$hostAddr = $out.getChildContent("host-address");

$ossvId = $out.getChildContent("ossv-id");

The system output is

Exception calling "InvokeElem" with "1" argument(s): "Extra input(s) - full-ndmp-credentials"

At C:\__brian\dfm\det\dfm_provision.ps1:48 char:14

+ $s.InvokeElem <<<< ($in);

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : DotNetMethodException

I really appreciate that any one could have a look on this.

1 REPLY 1

BRIANLIU11
1,907 Views

Solved.

Public