raise_for_status() is a method of the requests.Response object, so it must be called on the response returned by the request; the top-level requests module has no such function, and calling it there raises an AttributeError instead of performing the status check. Retrieving the list of device system IPs from the vManage dataservice/system/device/management/systemip endpoint is a read operation, so the request must use the HTTP GET method rather than PUT. response.raise_for_status() then raises requests.exceptions.HTTPError whenever the response carries a 4xx client-error or 5xx server-error status code.
Community Discussion