dell / PyU4V

PyU4V is a Python module that simplifies interaction with the Unisphere for PowerMax REST API. It wraps REST calls with simple APIs that abstracts the HTTP request and response handling.
Apache License 2.0
41 stars 37 forks source link

Hitting The requested resource was not found: Error GET symmetrix. The status code received is 404 and the message is None. #169

Closed ksmitchell01 closed 1 year ago

ksmitchell01 commented 1 year ago

I am fairly new to Python and PyU4V. I am trying to use this tool and am hitting the requested resource not found. I tried using the test script without success.

from PyU4V import U4VConn

conn = U4VConn()

Get the Unisphere version

version = conn.common.get_uni_version()

Retrieve a list of arrays managed by your instance of Unisphere

array_list = conn.common.get_array_list()

Output results to screen

print('Congratulations on your first connection to Unisphere, your ' 'version is: {ver}'.format(ver=version[0])) print('This instance of Unisphere instance manages the following arrays: ' '{arr_list}'.format(arr_list=array_list))

GET those arrays which are local to this instance of Unisphere

local_array_list = list() for array_id in array_list: array_details = conn.common.get_array(array_id) if array_details['local']: local_array_list.append(array_id)

Output results to screen

print('The following arrays are local to this Unisphere instance: ' '{arr_list}'.format(arr_list=local_array_list))

Close the session

conn.close_session()

If I perform a curl I can retrieve the version information just fine however.

~ # curl -k https://X.X.X.X:8443/univmax/restapi/version -u admin Enter host password for user 'admin': {"version":"V9.2.1.2"}%

I am not sure what I am doing wrong with PyU4V.

rawstorage commented 1 year ago

have you filled out your connection values in the connection string or created a PyU4V.conf file in the working directory?, apologies for late response I was on leave.

ksmitchell01 commented 1 year ago

Hello,

So it looks like I had the PyU4V.conf in the incorrect location and have moved it. However now I hit the following.

requests.exceptions.SSLError: The connection to https://x.x.x.x:8443/univmax/restapi has encountered an SSL error. Please check your SSL config or supplied SSL cert inconfiguration. SSL Exception message: HTTPSConnectionPool(host='x.x.x.x', port=8443): Max retries exceeded with url: /univmax/restapi/100/system/symmetrix/000xxxxxxxxx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:992)')))

With this in the conf file.

[setup] ; enter the below details - mandatory ;(can be passed as parameters on initialisation also) username=test password=Test123 server_ip=x.x.x.x port=8443 array=000xxxxxxxxx ; remote_array=00012345679 ; verify=True ; verify=/Users/mitchellk/Documents/PS/unisphere.pem

However if I un-comment the verify= line I get the following.

PyU4V.utils.exception.ResourceNotFoundException: The requested resource was not found: Error GET symmetrix. The status code received is 404 and the message is None.

rawstorage commented 1 year ago

If you uncomment and set verify to False it should work, if you want to use the TLS certificate you will need to download a specify the location as per the example.

Internal Use - Confidential

ksmitchell01 commented 1 year ago

I also tried to uncomment and set verify=False and I hit the following still.

PyU4V.utils.exception.ResourceNotFoundException: The requested resource was not found: Error GET symmetrix. The status code received is 404 and the message is None.

rawstorage commented 1 year ago

This issue is because you are querying an array serial that doesn't exist on this Unisphere. If you want to email me your code @.**@.> I can take a quick look.

Internal Use - Confidential

ksmitchell01 commented 1 year ago

Sure Paul, I can email it to you. What is the email that you would like me to send it to?

On Tue, Jun 20, 2023 at 9:34 AM Paul Martin @.***> wrote:

This issue is because you are querying an array serial that doesn't exist on this Unisphere. If you want to email me your code @.**@.> I can take a quick look.

Internal Use - Confidential

— Reply to this email directly, view it on GitHub https://github.com/dell/PyU4V/issues/169#issuecomment-1598913784, or unsubscribe https://github.com/notifications/unsubscribe-auth/A43QTMIJXKIZCTNCDJG5LBTXMGYHBANCNFSM6AAAAAAYH4IT7U . You are receiving this because you authored the thread.Message ID: @.***>

rawstorage commented 1 year ago

looks like the email address got stripped paule.martin@dell.com