# coding: utf-8

"""
    Zadara VPSA Storage Array REST API

     # Overview  This document outlines the methods available for administrating your Zadara Storage VPSA&#8482;. The Zadara Storage Array REST API   supports form-encoded, JSON, and XML requests, and can return either JSON or XML responses.  ## Usage  The majority of the APIs available require authentication which requires an API token to use. You can retrieve this token through the   Users section of your VPSA, or through the API using the \"Return a user's access key\" API in the Users Section below.  ## Authentication Methods  The authentication token can be passed either through the access_key parameter inside of the body of the REST API request, or   through the X-Access-Key header.  ## Timeouts  By default, all operations that don't complete within five seconds will return a message informing you that the action may take some  time to complete. When using the API, this can cause some actions, such as large volume creation, to be undesirably asynchronous.  You can specify your own timeout with the timeout parameter, in seconds, and a timeout value of -1 specifies an infinite timeout.  ## Specific Fields For Product  Some of the fields/actions used in the API should be used only for a specific product. The following tags are used to mark which   product responds to the fields/actions  VPSA Flash Array - All Flash Array VPSA  VPSA Storage Array - Hybrid VPSA  ## Questions  If you have any questions or need support involving the REST API, please contact for assistance.   # noqa: E501

    OpenAPI spec version: 23.03.1
    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 Vpsa.api_client import ApiClient


class ServersApi(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 attach_servers_to_volume(self, id, attach_servers_to_volume, **kwargs):  # noqa: E501
        """attach_servers_to_volume  # noqa: E501

        Attach Volume to Server(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.attach_servers_to_volume(id, attach_servers_to_volume, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: Comma_separated list of server IDs. (required)
        :param AttachServersToVolume attach_servers_to_volume: (required)
        :return: InlineResponse200166
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.attach_servers_to_volume_with_http_info(id, attach_servers_to_volume, **kwargs)  # noqa: E501
        else:
            (data) = self.attach_servers_to_volume_with_http_info(id, attach_servers_to_volume, **kwargs)  # noqa: E501
            return data

    def attach_servers_to_volume_with_http_info(self, id, attach_servers_to_volume, **kwargs):  # noqa: E501
        """attach_servers_to_volume  # noqa: E501

        Attach Volume to Server(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.attach_servers_to_volume_with_http_info(id, attach_servers_to_volume, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: Comma_separated list of server IDs. (required)
        :param AttachServersToVolume attach_servers_to_volume: (required)
        :return: InlineResponse200166
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'attach_servers_to_volume' in params:
            body_params = params['attach_servers_to_volume']
        # 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(
            '/servers/{id}/volumes.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200166',  # 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 create_server(self, create_server, **kwargs):  # noqa: E501
        """create_server  # noqa: E501

        Create a new Server. IQN or iSCSI ip or FC WWPN must be provided.  # 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_server(create_server, async_req=True)
        >>> result = thread.get()

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

    def create_server_with_http_info(self, create_server, **kwargs):  # noqa: E501
        """create_server  # noqa: E501

        Create a new Server. IQN or iSCSI ip or FC WWPN must be provided.  # 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_server_with_http_info(create_server, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateServer create_server: (required)
        :return: InlineResponse200158
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'create_server' in params:
            body_params = params['create_server']
        # 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(
            '/servers.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200158',  # 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 delete_server(self, id, **kwargs):  # noqa: E501
        """delete_server  # noqa: E501

        Delete a Server.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_server(id, async_req=True)
        >>> result = thread.get()

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

    def delete_server_with_http_info(self, id, **kwargs):  # noqa: E501
        """delete_server  # noqa: E501

        Delete a Server.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_server_with_http_info(id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        Delete server's session.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_server_session(delete_server_session, async_req=True)
        >>> result = thread.get()

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

    def delete_server_session_with_http_info(self, delete_server_session, **kwargs):  # noqa: E501
        """delete_server_session  # noqa: E501

        Delete server's session.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_server_session_with_http_info(delete_server_session, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DeleteServerSession delete_server_session: (required)
        :return: InlineResponse200162
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'delete_server_session' in params:
            body_params = params['delete_server_session']
        # 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(
            '/servers/session.json', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200162',  # 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_servers(self, **kwargs):  # noqa: E501
        """get_all_servers  # noqa: E501

        Show all Servers.  # 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_servers(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200157
                 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_servers_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_all_servers_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_all_servers_with_http_info(self, **kwargs):  # noqa: E501
        """get_all_servers  # noqa: E501

        Show all Servers.  # 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_servers_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200157
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start', 'limit']  # 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_servers" % key
                )
            params[key] = val
        del params['kwargs']

        if self.api_client.client_side_validation and ('start' in params and params['start'] < 0):  # noqa: E501
            raise ValueError("Invalid value for parameter `start` when calling `get_all_servers`, must be a value greater than or equal to `0`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # 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(
            '/servers.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200157',  # 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_server(self, id, **kwargs):  # noqa: E501
        """get_server  # noqa: E501

        Show a single Server.  # 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_server(id, async_req=True)
        >>> result = thread.get()

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

    def get_server_with_http_info(self, id, **kwargs):  # noqa: E501
        """get_server  # noqa: E501

        Show a single Server.  # 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_server_with_http_info(id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        Returns the last 60 data points of performance data for the specified interval.  # 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_server_performance(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param int interval: The interval between data points, in seconds.
        :return: InlineResponse200167
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_server_performance_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_server_performance_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_server_performance_with_http_info(self, id, **kwargs):  # noqa: E501
        """get_server_performance  # noqa: E501

        Returns the last 60 data points of performance data for the specified interval.  # 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_server_performance_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param int interval: The interval between data points, in seconds.
        :return: InlineResponse200167
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^srv-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `get_server_performance`, must conform to the pattern `/^srv-[0-9a-f]{8}$/`")  # noqa: E501
        if self.api_client.client_side_validation and ('interval' in params and params['interval'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `interval` when calling `get_server_performance`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'interval' in params:
            query_params.append(('interval', params['interval']))  # 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(
            '/servers/{id}/performance.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200167',  # 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_volumes_attached_to_server(self, id, **kwargs):  # noqa: E501
        """get_volumes_attached_to_server  # noqa: E501

        Returns a list of Volumes attached to the Server.  # 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_volumes_attached_to_server(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200165
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_volumes_attached_to_server_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_volumes_attached_to_server_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_volumes_attached_to_server_with_http_info(self, id, **kwargs):  # noqa: E501
        """get_volumes_attached_to_server  # noqa: E501

        Returns a list of Volumes attached to the Server.  # 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_volumes_attached_to_server_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param int start: The item number to start from. 0 starts from the beginning.
        :param int limit: The total number of records to return.
        :return: InlineResponse200165
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^srv-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `get_volumes_attached_to_server`, must conform to the pattern `/^srv-[0-9a-f]{8}$/`")  # noqa: E501
        if self.api_client.client_side_validation and ('start' in params and params['start'] < 0):  # noqa: E501
            raise ValueError("Invalid value for parameter `start` when calling `get_volumes_attached_to_server`, must be a value greater than or equal to `0`")  # noqa: E501
        collection_formats = {}

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

        query_params = []
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # 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(
            '/servers/{id}/volumes.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200165',  # 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_server_sessions(self, id, **kwargs):  # noqa: E501
        """list_server_sessions  # noqa: E501

        Lists server's sessions.  # 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_server_sessions(id, async_req=True)
        >>> result = thread.get()

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

    def list_server_sessions_with_http_info(self, id, **kwargs):  # noqa: E501
        """list_server_sessions  # noqa: E501

        Lists server's sessions.  # 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_server_sessions_with_http_info(id, async_req=True)
        >>> result = thread.get()

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

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

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^srv-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `list_server_sessions`, must conform to the pattern `/^srv-[0-9a-f]{8}$/`")  # noqa: E501
        collection_formats = {}

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

        Rename a Server.  # 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_server(id, rename_server, async_req=True)
        >>> result = thread.get()

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

    def rename_server_with_http_info(self, id, rename_server, **kwargs):  # noqa: E501
        """rename_server  # noqa: E501

        Rename a Server.  # 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_server_with_http_info(id, rename_server, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param RenameServer rename_server: (required)
        :return: InlineResponse200163
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^srv-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `rename_server`, must conform to the pattern `/^srv-[0-9a-f]{8}$/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'rename_server' in params:
            body_params = params['rename_server']
        # 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(
            '/servers/{id}/rename.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200163',  # 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 update_server(self, id, update_server, **kwargs):  # noqa: E501
        """update_server  # noqa: E501

        Update a Server configuration.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_server(id, update_server, async_req=True)
        >>> result = thread.get()

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

    def update_server_with_http_info(self, id, update_server, **kwargs):  # noqa: E501
        """update_server  # noqa: E501

        Update a Server configuration.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_server_with_http_info(id, update_server, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: (required)
        :param UpdateServer update_server: (required)
        :return: InlineResponse200164
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^srv-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `update_server`, must conform to the pattern `/^srv-[0-9a-f]{8}$/`")  # noqa: E501
        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'update_server' in params:
            body_params = params['update_server']
        # 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(
            '/servers/{id}/config.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200164',  # 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)
