Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

2626

February 20th, 2017 13:00

Provisioned and allocated capacity of a volume query via REST API

Untitled.png

I am attempting to make a couple of calls - to find out how much capacity is consumed per LUN. However, that info does not seem to be provided via the call. Could you please help me with identifying if I am missing anything here ?

Upon a quick search within the community - I have found few already implemented solutions by parsing xml data - but wanted to see if I can obtain the same info via Rest API calls

Thank you !

419 Posts

February 21st, 2017 01:00

allocation.pngRay,

the information is actually on this call it's the "allocated_percent" key on the returned JSON.

6 Posts

March 3rd, 2017 08:00

Hello Paul,

I have one more issue at the moment, and I am seeking help to understand how could one re-use the JSESSIONid while making recursive requests to Unisphere for VMAX. I am attempting to somehow loop though all existing devices and obtain their size, allocated capacity,wwn etc.

Here is how I am attempting to do it.

Step 1 : Run a "pilot" request, and from the response of the header obtain the "set-cookie" information.

ex : 'set-cookie' : 'JSESSIONID=xyxyxyxyxyxxyxyxyxyxxy;

Step 2 : Attempt to re-use the session-id. Based on what I have understood, from reading here and there, re-using the session id could help reduce load on the unisphere vmax resources.

'GET', Unisphere-for-vmax:8443/univmax/restapi/provisioning/symmetrix, headers={'Authorization':'base64encodedinfo', 'Set-cookie':'JESSIONID obtained  from Step 1'

For some reason, when I parse the request header from Step 2, it does not - seem to re-use the JSESSIONid.

Any information on this would be of much help.

Thanks !

419 Posts

March 6th, 2017 03:00

Ray,

if you look at the sample code,  we have up on Git hub, the file rest_requests.py does all the session handling for us/ 

PyU4V/rest_requests.py at master · ciarams87/PyU4V · GitHub


If another process came in at the same time in some sort of threaded environment, then the second process would get a new session ID


http://docs.python-requests.org/en/master/user/advanced/#session-objects


Can't take credit for this, Ciara and Michael did all the hard work here.  We've a few examples up there too, might be of use to you.



6 Posts

March 8th, 2017 10:00

Thanks much for the helpful resources. I had a chance to look at the rest_requests.py file, as well as the Pyvmax related files.

Based on what I understood ( please correct me if I am wrong ) there does not seem to be any process that is somehow "extracting" the JSESSION id - and re using it. Is this an accurate statement ?

I am borrowing what I learnt from the VPLEX world about re-using the session ids, and was wondering if the same applies in the VMAX world -

From the VPLEX documentation :

=======

If an API request does not specify a valid JSESSIONID cookie, the VPLEX REST API
allocates resources to a new session. The API response will include a header with the
new session ID associated with those resources. The following is a sample JSESSIONID
response header:
JSESSIONID=4937CB7C$EFBD10EE7776B53B5259F1A
Note
Each session that is opened expires after 30 minutes of the last usage.
When an API response includes a new session ID, use that ID until it expires. This
eliminates wasting of resources for sessions that have been opened for a single request
and then held unnecessarily until the session expires.
The same session ID can be used until the ID has expired. However, the outcome of an
API request with an expired session ID is the creation of a new session with a response,
which includes the new session ID.

No Events found!

Top