Software Development Kit (SDK) and API Discussions

cant connect to DFM 6.3rc1 using SDK 5.4 c#

stephen2
2,792 Views

All, unable to connect to DFM. Have tried 2 DFM servers, admin user, database user. Connection fails.

Anyone know what I am doing wrong? Code sample below:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NetApp.Manage;

namespace NetApp.NMSDK.Example
{
    class ApiClient
    {
        static void Main(string[] args)
        {
            try
            {
                NaServer s = new NaServer("10.97.94.50", 1, 0);
                s.ServerType = NaServer.SERVER_TYPE.DFM;
                s.TransportType = NaServer.TRANSPORT_TYPE.HTTPS;
                s.Port = 8488;
                s.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
                s.SetAdminUser("admin", "admin123");


                NaElement api = new NaElement("cluster-iter");
                api.AddNewChild("max-records", "20");
                api.AddNewChild("resource-filter", "<resource-filter>");
                api.AddNewChild("tag", "<tag>");

                NaElement xo = s.InvokeElem(api);
                Console.WriteLine(xo.ToPrettyString(""));


            }
            catch (NaAuthException e)
            {
                Console.Error.WriteLine("Authorization Failed: " + e.Message);
            }
            catch (NaApiFailedException e)
            {
                Console.Error.WriteLine("API FAILED: " + e.Message);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }
        }
    }
}

3 REPLIES 3

Navtej
2,505 Views

Use port number 443

stephen2
2,485 Views
I tried using 443 - I was just also trying port 80 to see if it made a difference

John_Roden
2,419 Views

I have been connecting via perl pretty successfully... here is what I set when connecting OCUM.

 

my $s = new NaServer($server, 1 , 0);

$s->set_server_type('OCUM');

$s->set_transport_type('HTTPS');

$s->set_port(443);

 

I had issues in the beginning and played around with set_hostname_verification and got it to work, but I pulled that out recently and everything works fine.

Public