Start a Conversation

Unsolved

This post is more than 5 years old

1278

October 13th, 2012 17:00

Celerra XMLAPI - Posting XML Requests

I was given a bunch of new storage by our IT people to replace some fairly old storage equipment and I have run into a problem when trying to convert some code to handle our new EMC Celerra storage.  The issue fairly lies in trying to implement (using .NET) the XMLAPI provided by EMC to automate the creation of Celerra "File Systems" and an associated "CIFS Share" on an ad-hoc / demand basis.  We have an isolated network (no Internet access) for our EMC equipment and  the application does a number of tasks.  Those with sad faces are where everything is falling down.

(1) Create AD Security Group -

(2) Add AD Users to Security Group -

(3) Create File System on EMC using the XMLAPI -

(4) Create CIFS Share on EMC using the XMLAPI -

(5) Set CIFS Share permissions to remove Everyone and add the newly created AD Security group using ?? -

(6) Create a folder structure on the newly created EMC File System -

(7) Permission NTFS permissions on EMC File System just created using the AD Security group -

(8) Create a DFS target folder to the CIFS share and add it to the DFS Namespace -

I have been able to submit a login request and receive an OK response with a valid cookie; however I am unable to "post" an XML request using the same process (the initial request I am sending is just a confirmation of whether the API URL works); I have formulated proper XML Requests for creating File Systems using the XML API user guide (however these can't be posted in the same manner as below)

I converted some code I found "CelerraAPIVBScriptExample.vbs" to VB.NET as I have to reference this function from my C# .NET application and it is below (anything in <> is organisation specific so I have removed it for the purposes of this post)

...

Const EMC_API_URL as String = "https:// /servlets/CelerraManagementServices "

Const EMC_LOGIN_URL as String = "http:// /Login?user= &password= &Login=Login "

...

Try

     Dim strNoOp as String = " http://www.emc.com/schemas/celerra/xml_api ""/>"

    

     Dim httpRequest as Object = CreateObject("Msxml2.ServerXMLHTTP.4.0")

     Dim strResponse, strResponseHeaders as String    

     ' Login to EMC Celerra

     httpRequest.setOption(2, 13056)  'Ignores all TLS/SSL server certificate errors

     httpRequest.Open("POST", EMC_LOGIN_URL, false)

     httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded")

     httpRequest.Send()

     strResponse = httpRequest.responseText

     strResponseHeaders = httpRequest.getAllResponseHeaders

...

     'Post NoOp request

     httpRequest.Open("POST", EMC_API_URL, false)

     httpRequest.setRequestHeader("Content-Type", "text/xml")

     httpRequest.Send(strNoOp)           <------ FAILS here with Exception or invalid parameters

     strResponse = httpRequest.responseText

...

Catch ex as Exception

    

     Dim response = MsgBox(ex.Message. MsgBoxStyle.OKOnly, "Error")

End Try

8.6K Posts

October 15th, 2012 04:00

Hi,

welcome to the forum.

(3) and (4) should be possible using the XMLAPI

(4) creating a share you can also do through Win32 APIs

(5) manipulating share ACLs isnt in the API and you need to do it via Windows function (Win32 - not WMI).

Make sure you have the proper permissions - i.e. being in the VNX CIFS servers local admin group

I'm not a .NET programmer but I know customers who have been using it.

Most work directly with EMC so they probably wont show here on the forum.

There is actually as developer section that you might try

here  https://community.emc.com/community/edn/unified?view=discussions - but there isnt much action there

I would first look at the XMLAPI log file on the control station - like a tail -f /nas/log/cel_api.log

If your requests dont appear there then you have a problem earlier on with the web server

You could also consider using a ssh to the control station and using the CLI there like nas_fs, server_mountpoint, server_mount

You can also look at the PowerShell cmdlets (not supported by EMC)

http://nickapedia.com/2010/11/01/ubershell-ninja-scripting/

I think they do use ssh to do their work though.

hope it helps

Rainer

P.S.: make sure that you dont just have the PDF XMLAPI guide but also the Windows help file - its better

3 Posts

October 18th, 2012 21:00

Thanks Rainer for your reply.

I have been able to implement the XMLAPI (written in Java and provided on this support forum) and adapted it to provide functionality to the .NET application that I require (rather than write the XMLAPI in .NET - I may get around to this at some point).

Basically I pass a bunch of arguments to the Java application and it requests them through the XMLAPI.

As far as the Share permissions - well this is a battle as I tried WMI and it didn't work; so I will try via Win32 (I definitely need to automate this process in .NET).

Everything else works a treat.


Cheers

S

8.6K Posts

November 9th, 2012 08:00

Any progress to report ?

Rainer

3 Posts

June 28th, 2014 23:00

Rainer...

Sorry for the delayed response ... No luck on the .NET implementation.  I have had to code it via Java and pass values between the .NET app and Java (which is inefficient but works).

As a side project, I am slowly building a .NET class for the CelerraConnector (similar to the Java version) and will post here when I have it working.

Cheers

S

No Events found!

Top