You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am getting an ApiValueError when attempting to retrieve a list of our server assets. I'm not sure if this is something I'm doing wrong. This is using version 1.0.11.9235 of the module.
Code:
from intersight.api import view_api
api_instance = view_api.ViewApi(api_client)
api_response = api_instance.get_view_server_list(top=1)
Traceback:
Traceback (most recent call last):
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\intersight-test.py", line 58, in <module>
api_response = api_instance.get_view_server_list(top=1)
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\api\view_api.py", line 714, in get_view_server_list
return self.get_view_server_list_endpoint.call_with_http_info(**kwargs)
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\api_client.py", line 887, in call_with_http_info
return self.api_client.call_api(
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\api_client.py", line 422, in call_api
return self.__call_api(resource_path, method,
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\api_client.py", line 227, in __call_api
return_data = self.deserialize(
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\api_client.py", line 333, in deserialize
deserialized_data = validate_and_convert_types(
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 1583, in validate_and_convert_types
converted_instance = attempt_convert_item(
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 1472, in attempt_convert_item
raise conversion_exc
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 1463, in attempt_convert_item
return deserialize_model(input_value, valid_class,
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 1377, in deserialize_model
return model_class._new_from_openapi_data(**kw_args)
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 49, in wrapped_init
return fn(_self, *args, **kwargs)
File "C:\Users\cbarton\Desktop\Experiments\intersight-python\venv\lib\site-packages\intersight\model_utils.py", line 402, in _new_from_openapi_data
raise ApiValueError(
intersight.exceptions.ApiValueError: Cannot deserialize input data due to invalid discriminator value. The OpenAPI document has no mapping for discriminator property 'ObjectType'='compute.Physical.List' at path: ['received_data']
The text was updated successfully, but these errors were encountered:
I ended up implementing an alternate workaround by passing _preload_content=False into get_view_server_list(). This disables the automatic serialization of JSON into objects.
import intersight
from intersight.api import view_api
page_size = 100
page_start = 0
server_list = []
records_available = 0
# Initialize the View API client
view_api_instance = view_api.ViewApi(self.intersight_client)
# Attempt to obtain information on servers in Intersight
while page_start <= records_available:
api_response = view_api_instance.get_view_server_list(
_preload_content=False,
top=page_size,
skip=page_start,
)
intersight_data = json.loads(api_response.read())
server_list += intersight_data['Results']
page_start += page_size
records_available = intersight_data['Count']
Uh oh!
There was an error while loading. Please reload this page.
Hi, I am getting an ApiValueError when attempting to retrieve a list of our server assets. I'm not sure if this is something I'm doing wrong. This is using version 1.0.11.9235 of the module.
Code:
Traceback:
The text was updated successfully, but these errors were encountered: