# 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 CloudsApi(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 create_cloud_vms_zsnap(self, create_cloud_vms_zsnap, **kwargs):  # noqa: E501
        """create_cloud_vms_zsnap  # noqa: E501

        Creates a Zsnap for the Command Center's Virtual Machine.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_cloud_vms_zsnap(create_cloud_vms_zsnap, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateCloudVmsZsnap create_cloud_vms_zsnap: (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.create_cloud_vms_zsnap_with_http_info(create_cloud_vms_zsnap, **kwargs)  # noqa: E501
        else:
            (data) = self.create_cloud_vms_zsnap_with_http_info(create_cloud_vms_zsnap, **kwargs)  # noqa: E501
            return data

    def create_cloud_vms_zsnap_with_http_info(self, create_cloud_vms_zsnap, **kwargs):  # noqa: E501
        """create_cloud_vms_zsnap  # noqa: E501

        Creates a Zsnap for the Command Center's Virtual Machine.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_cloud_vms_zsnap_with_http_info(create_cloud_vms_zsnap, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateCloudVmsZsnap create_cloud_vms_zsnap: (required)
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['create_cloud_vms_zsnap']  # 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 create_cloud_vms_zsnap" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'create_cloud_vms_zsnap' is set
        if self.api_client.client_side_validation and ('create_cloud_vms_zsnap' not in params or
                                                       params['create_cloud_vms_zsnap'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `create_cloud_vms_zsnap` when calling `create_cloud_vms_zsnap`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'create_cloud_vms_zsnap' in params:
            body_params = params['create_cloud_vms_zsnap']
        # 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/zsnap.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 get_all_clouds(self, **kwargs):  # noqa: E501
        """get_all_clouds  # noqa: E501

        Returns a list of all Zadara Storage Clouds which are managed by this Command Center.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_all_clouds(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_all_clouds_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_all_clouds_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_all_clouds_with_http_info(self, **kwargs):  # noqa: E501
        """get_all_clouds  # noqa: E501

        Returns a list of all Zadara Storage Clouds which are managed by this Command Center.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_all_clouds_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']  # 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 get_all_clouds" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'per_page' in params:
            query_params.append(('per_page', params['per_page']))  # 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.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2001',  # 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 get_cloud(self, name, **kwargs):  # noqa: E501
        """get_cloud  # noqa: E501

        Returns the details for a single Zadara Storage Cloud.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_cloud(name, async_req=True)
        >>> result = thread.get()

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

    def get_cloud_with_http_info(self, name, **kwargs):  # noqa: E501
        """get_cloud  # noqa: E501

        Returns the details for a single Zadara Storage Cloud.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_cloud_with_http_info(name, async_req=True)
        >>> result = thread.get()

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

        all_params = ['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 get_cloud" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'name' is set
        if self.api_client.client_side_validation and ('name' not in params or
                                                       params['name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `name` when calling `get_cloud`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'name' in params:
            path_params['name'] = params['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/{name}.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2002',  # 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 get_redundancy_level_policies(self, cloud_name, **kwargs):  # noqa: E501
        """get_redundancy_level_policies  # noqa: E501

        Get cloud's zios storage policy types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_redundancy_level_policies(cloud_name, async_req=True)
        >>> result = thread.get()

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

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

        Get cloud's zios storage policy types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_redundancy_level_policies_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse2006
                 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 get_redundancy_level_policies" % 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 `get_redundancy_level_policies`")  # 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}/vpsa_zone_group_storage_policy_types.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2006',  # 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_cloud_public_ips(self, name, list_cloud_public_ips, **kwargs):  # noqa: E501
        """list_cloud_public_ips  # noqa: E501

        Returns a list of all of the cloud public IP's  # 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_cloud_public_ips(name, list_cloud_public_ips, async_req=True)
        >>> result = thread.get()

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

    def list_cloud_public_ips_with_http_info(self, name, list_cloud_public_ips, **kwargs):  # noqa: E501
        """list_cloud_public_ips  # noqa: E501

        Returns a list of all of the cloud public IP's  # 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_cloud_public_ips_with_http_info(name, list_cloud_public_ips, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str name: (required)
        :param ListCloudPublicIps list_cloud_public_ips: (required)
        :return: InlineResponse2003
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['name', 'list_cloud_public_ips']  # 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_cloud_public_ips" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'name' is set
        if self.api_client.client_side_validation and ('name' not in params or
                                                       params['name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `name` when calling `list_cloud_public_ips`")  # noqa: E501
        # verify the required parameter 'list_cloud_public_ips' is set
        if self.api_client.client_side_validation and ('list_cloud_public_ips' not in params or
                                                       params['list_cloud_public_ips'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `list_cloud_public_ips` when calling `list_cloud_public_ips`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'list_cloud_public_ips' in params:
            body_params = params['list_cloud_public_ips']
        # 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/{name}/public_ips.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2003',  # 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 rename_cloud(self, cloud_name, **kwargs):  # noqa: E501
        """rename_cloud  # noqa: E501

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

        :param async_req bool
        :param str cloud_name: (required)
        :param str package:
        :param file settings_file: Settings file
        :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.rename_cloud_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.rename_cloud_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

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

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

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

        all_params = ['cloud_name', 'package', 'settings_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 rename_cloud" % 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 `rename_cloud`")  # 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 'package' in params:
            form_params.append(('package', params['package']))  # noqa: E501
        if 'settings_file' in params:
            local_var_files['settings_file'] = params['settings_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}/rename.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 set_cube_from_local_repo(self, cloud_name, set_cube_from_local_repo, **kwargs):  # noqa: E501
        """set_cube_from_local_repo  # noqa: E501

        Set cube 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.set_cube_from_local_repo(cloud_name, set_cube_from_local_repo, async_req=True)
        >>> result = thread.get()

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

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

        Set cube 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.set_cube_from_local_repo_with_http_info(cloud_name, set_cube_from_local_repo, async_req=True)
        >>> result = thread.get()

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

        all_params = ['cloud_name', 'set_cube_from_local_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 set_cube_from_local_repo" % 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 `set_cube_from_local_repo`")  # noqa: E501
        # verify the required parameter 'set_cube_from_local_repo' is set
        if self.api_client.client_side_validation and ('set_cube_from_local_repo' not in params or
                                                       params['set_cube_from_local_repo'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `set_cube_from_local_repo` when calling `set_cube_from_local_repo`")  # 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 'set_cube_from_local_repo' in params:
            body_params = params['set_cube_from_local_repo']
        # 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}/set_cube.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2005',  # 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 shutdown_cloud(self, cloud_name, **kwargs):  # noqa: E501
        """shutdown_cloud  # noqa: E501

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

        :param async_req bool
        :param str cloud_name: (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.shutdown_cloud_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.shutdown_cloud_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

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

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

        :param async_req bool
        :param str cloud_name: (required)
        :return: InlineResponse2004
                 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 shutdown_cloud" % 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 `shutdown_cloud`")  # 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}/shutdown.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 upgrade_cloud(self, cloud_name, upgrade_cloud, **kwargs):  # noqa: E501
        """upgrade_cloud  # noqa: E501

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

        :param async_req bool
        :param str cloud_name: (required)
        :param UpgradeCloud upgrade_cloud: (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.upgrade_cloud_with_http_info(cloud_name, upgrade_cloud, **kwargs)  # noqa: E501
        else:
            (data) = self.upgrade_cloud_with_http_info(cloud_name, upgrade_cloud, **kwargs)  # noqa: E501
            return data

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

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

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

        all_params = ['cloud_name', 'upgrade_cloud']  # 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 upgrade_cloud" % 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 `upgrade_cloud`")  # noqa: E501
        # verify the required parameter 'upgrade_cloud' is set
        if self.api_client.client_side_validation and ('upgrade_cloud' not in params or
                                                       params['upgrade_cloud'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `upgrade_cloud` when calling `upgrade_cloud`")  # 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 'upgrade_cloud' in params:
            body_params = params['upgrade_cloud']
        # 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}/upgrade.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)
