Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Is there a way to send a single XML request that will login, retrieve a metric (or really anything allowed by the API), and then optionally logout?  What would that single XML doc look like?  Or does the login always have to be a standalone request?
 
I've skimmed through the docs, blogs, and forums... and it's not clear to me if that can be done.  I haven't done any actual experimenting, though.  Just hoping for a quick answer... and possibly a code snippet.

Hi Tom - Absolutely, we can write a script for e.g perl script which would login, does the stuff and logout. There are snippets you can find in Resources/Scripts folder
 
http://developer.cisco.com/web/unifiedcomputing/resources?p_p_id=20&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_20_struts_action=%2Fdocument_library%2Fview&_20_folderId=2144116

I'm getting a page not found for that link.
 
That response, though, makes me think we can't do what I'm asking.  There'd still be three distinct XML request/responses running over the network from that perl script: login, something useful, and logout.  Even though you'd just call the perl script once.
 
The reason I'm asking is we have some monitoring software that can send HTTP requests, look for certain patterns in the response, and then either trend some metrics or initiate some alerts based on that data.  But it can only send a single HTTP request... it can't internally handle the login and cookie management required between multiple requests.
 
But yes, there could certainly be a perl script or some other intermediate program written to manage the login state.
 
 
 
 

I'm getting a page not found for that link.
 
That response, though, makes me think we can't do what I'm asking.  There'd still be three distinct XML request/responses running over the network from that perl script: login, something useful, and logout.  Even though you'd just call the perl script once.
 
The reason I'm asking is we have some monitoring software that can send HTTP requests, look for certain patterns in the response, and then either trend some metrics or initiate some alerts based on that data.  But it can only send a single HTTP request... it can't internally handle the login and cookie management required between multiple requests.
 
But yes, there could certainly be a perl script or some other intermediate program written to manage the login state.
 
 
 
 

 
Try this link, http://developer.cisco.com/web/unifiedcomputing/resources


You are correct it is three distinct XML docs in three different html posts. You would need a <aaaLogin> then a query method like <configResolveDn> finally to logout you would send a <aaaLogout>
 
Perhaps the solution for you would be an intermediary process that can understand the single http request coming in and in turn interacts with the UCS.  Providing a response in a format that your monitoring software can understand.