3 Replies Latest reply: Nov 12, 2013 3:16 AM by mbeattie RSS

How to connect to OCUM6.X using web services?

mbeattie NetApp Employee Sprinter
Currently Being Moderated

Hi All

 

Does anyone know if OnCommand Unified Manager 6.X for Clustered DataONTAP supports WSDL? Previously in DFM 4/5.X you could connect to DFM via web services\SOAP. What i'm looking for is a document like the one below that actually includes example code of how to connect to OCUM6.X from a remote system using web services. I need to this because there is no dfm command line in OCUM6 anymore so i was hoping to write some powershell functions to query it remotely. See document below on web services for DFM 4/5.X

 

https://communities.netapp.com/docs/DOC-17628

 

I checked the "OnCommand Unified Manager 6.0 API Developer's Guide" in the link below and web services\WSDL is not even mentioned...nor is there any example code

 

https://communities.netapp.com/docs/DOC-29357

 

Does anyone have example code of how to connect to OCUM6.X using web services? Is it possible? If not whats the best way to query the OCUM6.X database from a remote windows server?

 

Thanks in advance! Matt

  • Re: How to connect to OCUM6.X using web services?
    adaikkap NetApp Employee Grand Marshal
    Currently Being Moderated

    Hi Matt,

         The OCUM 6.0 provides a user called database user, using which one can access the OCUM database views exposed by it.

    One has to create this user by loging to OCUM. This is the same user that is used by WFA to pull cache from OCUM server for all filtering and resource selection.

     

    This works over port 3306- SQL over SSL using JDBC/ODBC.

     

    Also for OCUM 6.0 there is web services API as of this release.

     

    Regards

    adai

    • Re: How to connect to OCUM6.X using web services?
      mbeattie NetApp Employee Sprinter
      Currently Being Moderated

      Hi Adai,

       

      Thanks for the reply, could you point me to any documentation that has an example of how to connect to OCUM6 via JDBC/ODBC to perform SQL queries from a remote Windows Server? I've also been advised that OCUM6.X does not support web services (WSDL\SOAP) nor is it on the product roadmap? Could you please share any documentation\information on this? Please let me know if this is changed in OCUM6.1?

       

      For everyone else out there who is experiencing pain due to the "dfm command" interface being depreciated in OCUM6.X...

      here is a very basic example in C# of how to list volumes using the "volume-iter" API. Working on developing PowerShell CmdLet's for OCUM6.X

      //---------------------------------------------------------------------------------

      using System;
      using System.Text;
      using System.Collections.Generic;
      using NetApp.Manage;
      using System.Management.Automation;

      namespace NetApp.OnCommand.Unified.Manager
      {
          [System.Management.Automation.Cmdlet(System.Management.Automation.VerbsCommon.Get, "NaOcVol")]
          public class GetNaOcVol : System.Management.Automation.PSCmdlet
          {
              [System.Management.Automation.Parameter(Position = 0, Mandatory = true)]
              public string hostname;
              [System.Management.Automation.Parameter(Position = 1, Mandatory = true)]
              public string username;
              [System.Management.Automation.Parameter(Position = 2, Mandatory = true)]
              public string password;

              protected override void ProcessRecord()
              {
                  try
                  {
                      NaServer ocum6 = new NaServer(this.hostname, 1, 0);
                      ocum6.ServerType = NaServer.SERVER_TYPE.DFM;
                      ocum6.TransportType = NaServer.TRANSPORT_TYPE.HTTPS;
                      ocum6.Port = 443;
                      ocum6.Style = NaServer.AUTH_STYLE.LOGIN_PASSWORD;
                      ocum6.SetAdminUser(this.username, this.password);

                      NaElement api = new NaElement("volume-iter");
                      NaElement xo = ocum6.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);
                  }
              }
          }
      }

      //---------------------------------------------------------------------------------

       

      Hope that helps someone

       

      Cheers Matt

       

      Example Output:

       

      PS C:\> $hostname = "<%fqdn%>"
      PS C:\> Import-Module C:\ocum\ocum6.dll
      PS C:\> Get-Module

      ModuleType Name                      ExportedCommands
      ---------- ----                      ----------------
      Binary     ocum6                     Get-NaOcVol


      PS C:\> Get-NaOcVol -hostname $hostname -username "admin" -password "<%password%>"
      <results status='passed'>
              <num-records>28</num-records>
              <records>
                      <volume-info>
                              <block-type>64_bit</block-type>
                              <flexible-volume-info>
                                      <aggregate-name>dka-ter-01:dka_ter_1_aggr1</aggregate-name>
                                      <aggregate-resource-key>fc79ba5e-145b-11e3-b465-123478563412:type=aggregate,uuid=d7c4ec9
      e-0bc8-4584-8a93-64947870b023</aggregate-resource-key>
                                      <autogrow-increment-size>53686272</autogrow-increment-size>
                                      <is-autosize-enabled>true</is-autosize-enabled>
                                      <is-snapshot-autodelete-enabled>false</is-snapshot-autodelete-enabled>
                                      <maximum-size>17592186060800</maximum-size>
                                      <volume-clone-info>
                                              <is-clone>false</is-clone>
                                              <is-clone-present>false</is-clone-present>
                                      </volume-clone-info>
                              </flexible-volume-info>
                              <is-junction-path-active>true</is-junction-path-active>
                              <junction-parent-name>dka-svm-ter:/dkasvmter_root</junction-parent-name>
                              <junction-parent-resource-key>fc79ba5e-145b-11e3-b465-123478563412:type=volume,uuid=33d3e0b4-c50
      f-4568-90e7-503872e15726</junction-parent-resource-key>
                              <junction-path>/Test</junction-path>
                              <space-guarantee>volume</space-guarantee>
                              <volume-name>dka-svm-ter:/Test</volume-name>
                              <volume-resource-key>fc79ba5e-145b-11e3-b465-123478563412:type=volume,uuid=7ef7b617-ac15-44c1-9c
      3e-bdee9399a655</volume-resource-key>
                              <volume-security-info>
                                      <permissions>0</permissions>
                              </volume-security-info>
                              <volume-size>
                                      <actual-volume-size>1073741824</actual-volume-size>
                                      <afs-avail>1046380544</afs-avail>
                                      <afs-daily-growth-rate>0</afs-daily-growth-rate>
                                      <afs-total>1073741824</afs-total>
                                      <afs-used>27361280</afs-used>
                                      <afs-used-per-day>346</afs-used-per-day>
                                      <is-snapshot-enabled>false</is-snapshot-enabled>
                                      <overwrite-reserve-avail>0</overwrite-reserve-avail>
                                      <overwrite-reserve-total>0</overwrite-reserve-total>
                                      <overwrite-reserve-used>0</overwrite-reserve-used>
                                      <quota-committed-space>0</quota-committed-space>
                                      <snapshot-reserve-avail>0</snapshot-reserve-avail>
                                      <snapshot-reserve-total>0</snapshot-reserve-total>
                                      <snapshot-reserve-used>598016</snapshot-reserve-used>
                                      <total>1073741824</total>
                              </volume-size>
                              <volume-state>online</volume-state>
                              <volume-status>normal</volume-status>
                              <volume-type>dp</volume-type>
                              <vserver-name>dka-svm-ter</vserver-name>
                              <vserver-resource-key>fc79ba5e-145b-11e3-b465-123478563412:type=vserver,uuid=2c78dcd8-146d-11e3-
      b465-123478563412</vserver-resource-key>
                      </volume-info>

  • Re: How to connect to OCUM6.X using web services?
    mbeattie NetApp Employee Sprinter
    Currently Being Moderated

    Hi All,

     

    I've written some example PowerShell CmdLet's and posted them on this link:

     

    https://communities.netapp.com/docs/DOC-31056

     

    Hope that helps.

     

    Cheers Matt

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points