Unsolved

This post is more than 5 years old

2 Posts

9275

November 27th, 2012 08:00

VNX RESTful access & examples location?

VNX RESTful access & examples location?

Hello community,

I'm trying to access the restful XML API for "EMC VNX Control Station Linux release 3.0 (NAS 7.0.53)". According to the "XML API Programmer Guide for VNX™ for File", page 181:

     Note: In this release, EMC does not supply libraries that implement the session protocol. However, it provides Java and C++ source-level implementations. If you intend to use either of these implementations, you can skip this chapter.

I would really like to take a look at those as I'm running into some difficulty with the information returned from Celerra vs what is in the API guide. For example, if I:

# Connect to the server and get a cookie

[user@xxx ~]$ curl --insecure -X POST https://[my.ip]/Login -d user=[my.user] -d password=[my.password] -d Login=Login -D temp.file

# Then I can see the cookie that is set by the server. (sanitized, for brevity)

[user@xxx ~]$ cat temp.file

HTTP/1.1 200 OK

Date: Tue, 27 Nov 2012 14:39:56 GMT

Server: Apache

Refresh: 1; URL=/

Set-Cookie: Ticket=time&---&ip&---&last&---&idle&&hash&----&user&---&useraccess&&type&User&persists&&expires&480; path=/

Accept-Ranges: none

Pragma: no-cache

Transfer-Encoding: chunked

Content-Type: text/html; charset=ISO-8859-1

# Then I can test the cookie...

[user@xxx ~]$ curl --insecure -X POST https://[my.ip]/servlets/CelerraManagementServices --cookie 'Ticket=time&---&ip&---&last&---&idle&&hash&----&user&---&useraccess&&type&User&persists&&expires&480;path=/;' -d ' http://www.emc.com/schemas/celerra/xml_api "/>'

# Which responds with:

http://www.emc.com/schemas/celerra/xml_api " time="---"/>

This is all well and good except that I don't get back the CelerraConnector-Sess or JSESSIONID cookies needed, as far as I can tell, by the server for 'real' transactions. I am hoping that with vetted example code I can get arround this, seemingly, small problem. As an FYI, yes I will ultimately be interacting with the console via Java. I'm using command line above for simplicity of the example.

I assume that I'm missing some rather mundane detail but I've been spinning on this for too long. Any thougths you might have on this would be most apperciated.

Thanks!

-Kevin

Refs: https://community.emc.com/message/596754#596754

2 Posts

November 28th, 2012 09:00

Update: I was just missing the the session id, of course I noticed this about 3 seconds after sending the above message :-/   I still can't find the examples though. Any thoughts?

6 Operator

 • 

8.6K Posts

November 29th, 2012 08:00

Take a look at the developers corner here on the forum – it has Java examples for using the XML API

What programming language are you using ?

10 Posts

March 6th, 2013 01:00

Hi there,

Glad that you figured that out.

I'm trying to do the same thing but with Wget right now (against VNX File Simulator). After sending the empty request packet I do get login session cookie, tomcat session cookie and celerra connector session.

But, when I then send a simple query like CheckpointQueryParams, I am getting a 503 Service Unavailable error. I tried searching but could not find any log files within the simulator with relevant information.

Do you have any clue why I am getting this error ? Am I supposed to do anything to enable XML API access  in the VNX Simulator !!

6 Operator

 • 

8.6K Posts

March 6th, 2013 04:00

Yes, you might have to enable it – see the XML API Programmers guide in the section “Starting the XML API Server”

6 Operator

 • 

8.6K Posts

March 6th, 2013 04:00

sorry, I'm not really a programmer

you can find some sample code on the developer network here

https://community.emc.com/community/edn/unified/content?filterID=contentstatus[published]~objecttype~objecttype[document]#start=20

Rainer

10 Posts

March 6th, 2013 04:00

Hi Rainer,

Thanks for the reply. I checked the VNX Simulator and it looks like the XML API Server was already enabled and running. I restarted 'nas' service and still get the same error. Maybe I am using Wget in wrong way.

I see that you are an expert in this matter. Would you be kind enough to share any shell script or C++/Java code that can demonstrate the usage of XML API ? Any help would be great !!

Thanks a lot,

Jinesh.

6 Operator

 • 

8.6K Posts

March 6th, 2013 05:00

I found this snippet - might be useful for debugging

for real work I would suggest a real programming language and not wget though

Rainer

---------

[root@vnx5700cse xml]# cat dump.sh
wget --keep-session-cookies --save-cookies cookie -O /dev/null --no-check-certificate "https://$1/Login?user=nasadmin&password=nasadmin&Login=Login"
wget --keep-session-cookies --load-cookies cookie -O $2.out --no-check-certificate --post-file=$2 "https://$1/servlets/CelerraManagementServices"
cat $2.out

[root@vnx5700cse xml]# cat serial.xml

http://www.emc.com/schemas/celerra/xml_api " xmlns:xsi=' http://www.w3.org/2001/XMLSchema-instance '>
       
               
                       
               
       

[root@vnx5700cse xml]# ./dump.sh xx.xx.xx.xx serial.xml
--13:22:08--  https://xx.xx.xx.xx/Login?user=nasadmin&password=nasadmin&Login=Login
Connecting to xx.xx.xx.xx:443... connected.
WARNING: cannot verify xx.xx.xx.xx certificate, issued by `/O=VNX Certificate Authority/CN=vnx5700cse':
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/dev/null'

    [ <=>                                                               ] 469         --.-K/s   in 0s

13:22:08 (7.90 MB/s) - `/dev/null' saved [469]

--13:22:08--  https://xx.xx.xx.xx/servlets/CelerraManagementServices
Connecting to xx.xx.xx.xx:443... connected.
WARNING: cannot verify xx.xx.xx.xx certificate, issued by `/O=VNX Certificate Authority/CN=vnx5700cse':
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: 449 [text/xml]
Saving to: `serial.xml.out'

100%[==================================================================>] 449         --.-K/s   in 0s

13:22:15 (5.02 MB/s) - `serial.xml.out' saved [449/449]


http://www.emc.com/schemas/celerra/xml_api">
   
       
       
           
       
   

10 Posts

March 6th, 2013 22:00

Hi Rainer,

You have been great !! . The shell script worked just fine and now I am able to get XML API access to the VNX File Simulator (1 DM). Just one more problem though. I am getting the following error for CheckpointQueryParams when used with the simulator:

http://www.emc.com/schemas/celerra/xml_api ">

   

       

           

                Appliance Layer (APL) subsystem that the XML API server talks to failed to execute a query. This indicates a problem with the APL subsystem in Control Station software.

                If the problem persists, collect support materials by running the /nas/tools/collect_support_materials script or the newer /nas/tools/automaticcollection script. Note any symptoms. If you require more information on the materials collection process, refer to the Problem Resolution Roadmap for Celerra, available on EMC Powerlink, or EMC Knowledgebase Support Solution number emc135846. For more information on this message, use the text from the error message's brief description or the message's ID to search the Knowledgebase on Powerlink. After logging in to Powerlink, go to Support > Knowledgebase Search > Support Solutions Search.

               

Exception tag: 13d459f5803

Exception message: com.emc.nas.ccmd.common.MessageInstanceImpl@50020001

           

       

   

Does this mean that the VNX Simulator does not have support for Checkpoints ? /nas/log/cel_api.log shows the following:

Mar 7, 11:11:42  APL reply is:

http://www.emc.com/schemas/celerra/apl_

1.0">

 

   

     

       

          snapsure

       

     

   

 

Mar 7, 11:11:43  Creating API status -------------->

Mar 7, 11:11:43  Diagnostics tag: 13d459f5803

com.emc.celerra.api.RequestException: com.emc.nas.ccmd.common.MessageInstanceImpl@50020001

        at com.emc.celerra.api.apl.AbstractQuery.makeAplListCall(AbstractQuery.java:144)

        at com.emc.celerra.api.apl.AbstractQuery.makeAplListCall(AbstractQuery.java:300)

        at com.emc.celerra.api.apl.fs.FsQuery.query(FsQuery.java:107)

        at com.emc.celerra.api.apl.AplSession.query(AplSession.java:188)

        at com.emc.celerra.api.Session.doQuery(Session.java:416)

        at com.emc.celerra.api.Session.processRequest(Session.java:343)

        at com.emc.celerra.api.RequestRunner.processUserPacket(RequestRunner.java:303)

        at com.emc.celerra.api.RequestRunner.processOneRequest(RequestRunner.java:173)

        at com.emc.celerra.api.RequestRunner.run(RequestRunner.java:94)

        at org.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)

        at java.lang.Thread.run(Unknown Source)

Mar 7, 11:11:43  Done creating API status ------->

Mar 7, 11:11:43  RequestRunner:8050/57643:Sending Reply ----------->

10 Posts

March 6th, 2013 23:00

It is :

[nasadmin@localhost ~]$ nas_version

7.1.47-5

6 Operator

 • 

8.6K Posts

March 6th, 2013 23:00

Probably a bug

What version is your Simulator ?

See nas_version

10 Posts

March 7th, 2013 01:00

Looks like it was an issue with snapsure license. It started working when I enabled it. Thanks a lot for your help Rainer.

6 Operator

 • 

8.6K Posts

March 7th, 2013 02:00

Make sense even though the error could have been nicer

10 Posts

March 7th, 2013 02:00

Yes, definitely.

6 Operator

 • 

4.5K Posts

March 8th, 2013 14:00

Was your question answered correctly? If so, please remember to mark your question Answered when you get the correct answer and award points to the person providing the answer. This helps others searching for a similar issue.

glen

10 Posts

March 11th, 2013 03:00

Hi Glen, My queries were answered. But the original question was posted by someone else and I don't see an option for me to mark the query as answered. Sorry.

No Events found!

Top