Source code for netapp.santricity.api.symbol.l_api

#!/usr/bin/env python
# coding: utf-8

"""
LApi.py

  The Clear BSD License

  Copyright (c) – 2016, NetApp, Inc. All rights reserved.

  Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  * Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

  NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
from __future__ import absolute_import

import sys
import os

# python 2 and python 3 compatibility library
from six import iteritems

from ....santricity.configuration import Configuration
from ....santricity.api_client import ApiClient


[docs]class LApi(object): def __init__(self, api_client=None): config = Configuration() if api_client: self.api_client = api_client else: if not config.api_client: config.api_client = ApiClient(context_path='/devmgr/v2') self.api_client = config.api_client
[docs] def symbol_load_controller_firmware(self, system_id, body, **kwargs): """ To indicate the end of the iterative download sequence, call this procedure with a zero-length segment size. When the controller receives this end indicator, the controller writes the accumulated firmware image to stable storage (typically flash memory). The controller responds to this procedure call with the appropriate return code, delays for a short period, and then reboots to load and execute the new firmware. Documented return codes: ok, error, busy, illegalParam, noHeap, invalidFile, imageTransferred, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, downloadNotPermitted, spawnError, voltransferError, invalidDlstate, cacheconfigError, downloadInProgress, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_controller_firmware(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FirmwareUpdateDescriptor body: A FirmwareUpdateDescriptor object that indicates, among other things, the offset and size of the firmware segment being transferred. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_controller_firmware" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_controller_firmware`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_controller_firmware`") resource_path = '/storage-systems/{system-id}/symbol/loadControllerFirmware'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_controller_firmware_no_password(self, system_id, body, **kwargs): """ Used to download some or all of a new firmware image file to a controller when the authentication password is unavailable. Documented return codes: ok, error, busy, illegalParam, noHeap, invalidFile, imageTransferred, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, downloadNotPermitted, spawnError, voltransferError, invalidDlstate, cacheconfigError, downloadInProgress, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_controller_firmware_no_password(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FirmwareUpdateDescriptor body: (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_controller_firmware_no_password" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_controller_firmware_no_password`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_controller_firmware_no_password`") resource_path = '/storage-systems/{system-id}/symbol/loadControllerFirmwareNoPassword'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_controller_firmware_on_lockdown(self, system_id, body, **kwargs): """ To indicate the end of the iterative download sequence, call this procedure with a zero-length segment size. When the controller receives this end indicator, the controller writes the accumulated firmware image to stable storage (typically flash memory). The controller responds to this procedure call with the appropriate return code, delays for a short period, and then reboots to load and execute the new firmware. Documented return codes: ok, error, busy, illegalParam, noHeap, invalidFile, imageTransferred, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, downloadNotPermitted, spawnError, voltransferError, invalidDlstate, cacheconfigError, downloadInProgress, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_controller_firmware_on_lockdown(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FirmwareUpdateDescriptor body: A FirmwareUpdateDescriptor object that indicates, among other things, the offset and size of the firmware segment being transferred. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_controller_firmware_on_lockdown" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_controller_firmware_on_lockdown`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_controller_firmware_on_lockdown`") resource_path = '/storage-systems/{system-id}/symbol/loadControllerFirmwareOnLockdown'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_controller_nvsram(self, system_id, body, **kwargs): """ To indicate the end of the iterative download sequence, call this procedure with a zero-length segment size. When the controller receives this end indicator, the controller writes the accumulated NVSRAM image to stable storage (typically flash memory). The controller responds to this procedure call with the appropriate return code, delays for a short period, and then reboots to load and execute the new NVSRAM. Documented return codes: ok, error, busy, illegalParam, noHeap, invalidFile, flashError, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, downloadNotPermitted, spawnError, downloadInProgress, utmConflict, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_controller_nvsram(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FirmwareUpdateDescriptor body: A FirmwareUpdateDescriptor object that specifies the size and content of the NVSRAM data to be loaded by the controller. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_controller_nvsram" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_controller_nvsram`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_controller_nvsram`") resource_path = '/storage-systems/{system-id}/symbol/loadControllerNVSRAM'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_controller_nvsram_no_password(self, system_id, body, **kwargs): """ This procedure is used to download a NVSRAM image file to a controller when the duplex setting gets erroneously inserted into a Native SATA array. In such a situation, none of the native SATA drives will be recognized by the firmware since the IOC will be set to enable the STP (SATA) layer only if the setting is Simplex. The Recovery Action in such a scenario is to download new NVSRAM using this command and boot with it. Documented return codes: ok, error, illegalParam, imageTransferred, fileTooLarge, invalidChunksize, downloadInProgress, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_controller_nvsram_no_password(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FirmwareUpdateDescriptor body: (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_controller_nvsram_no_password" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_controller_nvsram_no_password`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_controller_nvsram_no_password`") resource_path = '/storage-systems/{system-id}/symbol/loadControllerNVSRAMNoPassword'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_drive_firmware(self, system_id, body, **kwargs): """ Downloads a portion of a new firmware image to a drive in the SYMbol Server. loadDriveFirmware OBSOLETED by implementation of parallel drive firmware download Documented return codes: ok. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_drive_firmware(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param DriveFirmwareUpdateDescriptor body: (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_drive_firmware" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_drive_firmware`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_drive_firmware`") resource_path = '/storage-systems/{system-id}/symbol/loadDriveFirmware'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_esm_firmware(self, system_id, body, **kwargs): """ This procedure is used to download some or all of a new firmware image to the ESM cards in a tray. The argument object specifies tray where the ESMs are located, the size of the firmware segment being downloaded, and the offset of the segment within the overall firmware image. Downloads are accomplished using an iterative approach, where the overall image is segmented and each segment transferred to the controller via a call to this procedure. To indicate the end of the iterative download sequence, this procedure should be called with a zero-length segment size. When this end indicator is received by the controller, the accumulated firmware image will be written to the ESM cards. Documented return codes: ok, error, busy, noHeap, tryAlternate, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, spawnError, cacheconfigError, downloadInProgress, esmDownloadFailed, esmPartialUpdate, controllerInServiceMode. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_esm_firmware(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param ESMFirmwareUpdateDescriptor body: An ESMFirmwareUpdateDescriptor object that indicates the tray to receive the firmware, the offset and size of the firmware segment being transferred. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_esm_firmware" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_esm_firmware`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_esm_firmware`") resource_path = '/storage-systems/{system-id}/symbol/loadESMFirmware'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_esm_firmware_on_mismatch(self, system_id, body, **kwargs): """ This procedure is used to download a new firmware image to the ESM cards in a tray. This procedure is identical in behavior to loadESMFirmware. with respect to interpretation of the argument and performing the download process. It differs from that command with respect to certain pre-validation checks it performs. In particular, it requires that an ESM firmware mismatch condition exist on the indicated tray before it will proceed with the download. Documented return codes: ok, error, busy, noHeap, tryAlternate, fileTooLarge, invalidOffset, overrun, invalidChunksize, invalidTotalsize, spawnError, cacheconfigError, downloadInProgress, esmDownloadFailed, esmPartialUpdate, controllerInServiceMode, requiredConditionNotPresent. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_esm_firmware_on_mismatch(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param ESMFirmwareUpdateDescriptor body: An ESMFirmwareUpdateDescriptor object that indicates the tray to receive the firmware, the offset and size of the firmware segment being transferred. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_esm_firmware_on_mismatch" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_esm_firmware_on_mismatch`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_esm_firmware_on_mismatch`") resource_path = '/storage-systems/{system-id}/symbol/loadEsmFirmwareOnMismatch'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response
[docs] def symbol_load_factory_defaults(self, system_id, body, **kwargs): """ This procedure is used to download factory default information to a controller or expansion enclosure. Documented return codes: ok, error, factoryDefaultDownloadFailed, errorWritingToEeprom, factoryDefaultPartialUpdate. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api.symbol_load_factory_defaults(system_id, body, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) :param str system_id: (required) :param FactoryDefaultsDescriptor body: The factory default data. (required) :param str controller: Controller selection :param bool verbose_error_response: :return: str If the method is called asynchronously, returns the request thread. :raises: ValueError If the required params are not provided or if the response data format is unknown. TypeError: When the data type of response data is different from what we are expecting ApiException: Occurs when we get a HTTP error code (422 and above). """ all_params = ['system_id', 'body', 'controller', 'verbose_error_response'] all_params.append('callback') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method symbol_load_factory_defaults" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'system_id' is set if ('system_id' not in params) or (params['system_id'] is None): raise ValueError("Missing the required parameter `system_id` when calling `symbol_load_factory_defaults`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `symbol_load_factory_defaults`") resource_path = '/storage-systems/{system-id}/symbol/loadFactoryDefaults'.replace('{format}', 'json') path_params = {} if 'system_id' in params: path_params['system-id'] = params['system_id'] query_params = {} if 'controller' in params: query_params['controller'] = params['controller'] if 'verbose_error_response' in params: query_params['verboseErrorResponse'] = params['verbose_error_response'] header_params = {} form_params = [] local_var_files = {} body_params = None if 'body' in params: body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json']) if not header_params['Accept']: del header_params['Accept'] # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.\ select_header_content_type(['application/json']) # Authentication setting auth_settings = ['basicAuth'] response = self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) return response