# coding: utf-8

"""
    Command Center operations

    Command Center operations  # noqa: E501

    OpenAPI spec version: 23.03-sp1
    Contact: support@zadarastorage.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from CommandCenter.api_client import ApiClient


class SoftwareInstallApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def abort_last_action(self, cloud_name, **kwargs):  # noqa: E501
        """abort_last_action  # noqa: E501

        Abort last Install action.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.abort_last_action(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20081
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.abort_last_action_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.abort_last_action_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def abort_last_action_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """abort_last_action  # noqa: E501

        Abort last Install action.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.abort_last_action_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20081
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method abort_last_action" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `abort_last_action`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/abort_last_action.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20081',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def cloud_upgrade(self, cloud_name, cloud_upgrade, **kwargs):  # noqa: E501
        """cloud_upgrade  # noqa: E501

        Upgrade the selected compoments (SN\\VPSA\\CCVM) in the Zadara Cloud to the specified software package. If no components are passed, all components will be upgraded.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cloud_upgrade(cloud_name, cloud_upgrade, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param CloudUpgrade cloud_upgrade: (required)
        :return: InlineResponse20079
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.cloud_upgrade_with_http_info(cloud_name, cloud_upgrade, **kwargs)  # noqa: E501
        else:
            (data) = self.cloud_upgrade_with_http_info(cloud_name, cloud_upgrade, **kwargs)  # noqa: E501
            return data

    def cloud_upgrade_with_http_info(self, cloud_name, cloud_upgrade, **kwargs):  # noqa: E501
        """cloud_upgrade  # noqa: E501

        Upgrade the selected compoments (SN\\VPSA\\CCVM) in the Zadara Cloud to the specified software package. If no components are passed, all components will be upgraded.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cloud_upgrade_with_http_info(cloud_name, cloud_upgrade, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param CloudUpgrade cloud_upgrade: (required)
        :return: InlineResponse20079
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'cloud_upgrade']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method cloud_upgrade" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `cloud_upgrade`")  # noqa: E501
        # verify the required parameter 'cloud_upgrade' is set
        if self.api_client.client_side_validation and ('cloud_upgrade' not in params or
                                                       params['cloud_upgrade'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_upgrade` when calling `cloud_upgrade`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'cloud_upgrade' in params:
            body_params = params['cloud_upgrade']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/cloud_upgrade.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20079',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def download_package(self, cloud_name, download_package, **kwargs):  # noqa: E501
        """download_package  # noqa: E501

        Download and Install package from a remote repository. If remote_repo is not defined, the default Zadara repo is used.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.download_package(cloud_name, download_package, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param DownloadPackage download_package: (required)
        :return: InlineResponse20077
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.download_package_with_http_info(cloud_name, download_package, **kwargs)  # noqa: E501
        else:
            (data) = self.download_package_with_http_info(cloud_name, download_package, **kwargs)  # noqa: E501
            return data

    def download_package_with_http_info(self, cloud_name, download_package, **kwargs):  # noqa: E501
        """download_package  # noqa: E501

        Download and Install package from a remote repository. If remote_repo is not defined, the default Zadara repo is used.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.download_package_with_http_info(cloud_name, download_package, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param DownloadPackage download_package: (required)
        :return: InlineResponse20077
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'download_package']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method download_package" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `download_package`")  # noqa: E501
        # verify the required parameter 'download_package' is set
        if self.api_client.client_side_validation and ('download_package' not in params or
                                                       params['download_package'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `download_package` when calling `download_package`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'download_package' in params:
            body_params = params['download_package']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/download_package.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20077',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def erase_package(self, cloud_name, erase_package, **kwargs):  # noqa: E501
        """erase_package  # noqa: E501

        Erase package from the local repository.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.erase_package(cloud_name, erase_package, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param ErasePackage erase_package: (required)
        :return: InlineResponse20078
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.erase_package_with_http_info(cloud_name, erase_package, **kwargs)  # noqa: E501
        else:
            (data) = self.erase_package_with_http_info(cloud_name, erase_package, **kwargs)  # noqa: E501
            return data

    def erase_package_with_http_info(self, cloud_name, erase_package, **kwargs):  # noqa: E501
        """erase_package  # noqa: E501

        Erase package from the local repository.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.erase_package_with_http_info(cloud_name, erase_package, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param ErasePackage erase_package: (required)
        :return: InlineResponse20078
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'erase_package']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method erase_package" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `erase_package`")  # noqa: E501
        # verify the required parameter 'erase_package' is set
        if self.api_client.client_side_validation and ('erase_package' not in params or
                                                       params['erase_package'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `erase_package` when calling `erase_package`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'erase_package' in params:
            body_params = params['erase_package']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/erase_package.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20078',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_packages(self, cloud_name, **kwargs):  # noqa: E501
        """list_packages  # noqa: E501

        Lists Install packages. Shows packages from local and renote repository. If remote_repo is not defined, the default Zadara repo is used.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_packages(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str remote_repo: Remote repository
        :return: InlineResponse20076
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_packages_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.list_packages_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def list_packages_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """list_packages  # noqa: E501

        Lists Install packages. Shows packages from local and renote repository. If remote_repo is not defined, the default Zadara repo is used.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_packages_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str remote_repo: Remote repository
        :return: InlineResponse20076
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'remote_repo']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_packages" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `list_packages`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []
        if 'remote_repo' in params:
            query_params.append(('remote_repo', params['remote_repo']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/list_packages.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20076',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_sns(self, cloud_name, **kwargs):  # noqa: E501
        """list_sns  # noqa: E501

        Lists Storage Nodes.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_sns(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20075
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_sns_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.list_sns_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def list_sns_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """list_sns  # noqa: E501

        Lists Storage Nodes.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_sns_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20075
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_sns" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `list_sns`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/list_sns.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20075',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def register_images(self, cloud_name, register_images, **kwargs):  # noqa: E501
        """register_images  # noqa: E501

        Register image in the local repository.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.register_images(cloud_name, register_images, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param RegisterImages register_images: (required)
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_images_with_http_info(cloud_name, register_images, **kwargs)  # noqa: E501
        else:
            (data) = self.register_images_with_http_info(cloud_name, register_images, **kwargs)  # noqa: E501
            return data

    def register_images_with_http_info(self, cloud_name, register_images, **kwargs):  # noqa: E501
        """register_images  # noqa: E501

        Register image in the local repository.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.register_images_with_http_info(cloud_name, register_images, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param RegisterImages register_images: (required)
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'register_images']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method register_images" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `register_images`")  # noqa: E501
        # verify the required parameter 'register_images' is set
        if self.api_client.client_side_validation and ('register_images' not in params or
                                                       params['register_images'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `register_images` when calling `register_images`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'register_images' in params:
            body_params = params['register_images']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/register_images.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2004',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def restart_last_action(self, cloud_name, **kwargs):  # noqa: E501
        """restart_last_action  # noqa: E501

        Restart last failing Install action.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.restart_last_action(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20082
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.restart_last_action_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.restart_last_action_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def restart_last_action_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """restart_last_action  # noqa: E501

        Restart last failing Install action.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.restart_last_action_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20082
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method restart_last_action" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `restart_last_action`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/restart_last_action.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20082',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def show_all(self, cloud_name, **kwargs):  # noqa: E501
        """show_all  # noqa: E501

        Show history of Install actions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.show_all(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20080
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.show_all_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.show_all_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def show_all_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """show_all  # noqa: E501

        Show history of Install actions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.show_all_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse20080
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method show_all" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `show_all`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/show_all.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20080',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def sn_install(self, cloud_name, sn_install, **kwargs):  # noqa: E501
        """sn_install  # noqa: E501

        Install a new Storage Node.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.sn_install(cloud_name, sn_install, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param SnInstall sn_install: (required)
        :return: InlineResponse20079
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sn_install_with_http_info(cloud_name, sn_install, **kwargs)  # noqa: E501
        else:
            (data) = self.sn_install_with_http_info(cloud_name, sn_install, **kwargs)  # noqa: E501
            return data

    def sn_install_with_http_info(self, cloud_name, sn_install, **kwargs):  # noqa: E501
        """sn_install  # noqa: E501

        Install a new Storage Node.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.sn_install_with_http_info(cloud_name, sn_install, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param SnInstall sn_install: (required)
        :return: InlineResponse20079
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'sn_install']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method sn_install" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `sn_install`")  # noqa: E501
        # verify the required parameter 'sn_install' is set
        if self.api_client.client_side_validation and ('sn_install' not in params or
                                                       params['sn_install'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `sn_install` when calling `sn_install`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'sn_install' in params:
            body_params = params['sn_install']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/sn_install.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20079',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def upload_settings(self, cloud_name, file, **kwargs):  # noqa: E501
        """upload_settings  # noqa: E501

        Upload deb settings file.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_settings(cloud_name, file, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param file file: .deb file upload (required)
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.upload_settings_with_http_info(cloud_name, file, **kwargs)  # noqa: E501
        else:
            (data) = self.upload_settings_with_http_info(cloud_name, file, **kwargs)  # noqa: E501
            return data

    def upload_settings_with_http_info(self, cloud_name, file, **kwargs):  # noqa: E501
        """upload_settings  # noqa: E501

        Upload deb settings file.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_settings_with_http_info(cloud_name, file, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param file file: .deb file upload (required)
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'file']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method upload_settings" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `upload_settings`")  # noqa: E501
        # verify the required parameter 'file' is set
        if self.api_client.client_side_validation and ('file' not in params or
                                                       params['file'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `file` when calling `upload_settings`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'application/xml'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/software_install/upload_settings.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2004',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
