# coding: utf-8

"""
    XMS API

    XMS is the controller of distributed storage system  # noqa: E501

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


class OsdsApi(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_osd(self, body, **kwargs):  # noqa: E501
        """create_osd  # noqa: E501

        Create osd service on specific disk  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_osd(body, async=True)
        >>> result = thread.get()

        :param async bool
        :param OsdCreateReq body: osd info (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.create_osd_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.create_osd_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def create_osd_with_http_info(self, body, **kwargs):  # noqa: E501
        """create_osd  # noqa: E501

        Create osd service on specific disk  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_osd_with_http_info(body, async=True)
        >>> result = thread.get()

        :param async bool
        :param OsdCreateReq body: osd info (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osd(self, osd_id, **kwargs):  # noqa: E501
        """delete_osd  # noqa: E501

        remove an osd from cluster  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_osd(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def delete_osd_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """delete_osd  # noqa: E501

        remove an osd from cluster  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_osd_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_chunks(self, osd_id, **kwargs):  # noqa: E501
        """get_chunks  # noqa: E501

        get chunks of and osd  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_chunks(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: The id of the osd (required)
        :return: ChunksResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_chunks_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_chunks_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def get_chunks_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """get_chunks  # noqa: E501

        get chunks of and osd  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_chunks_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: The id of the osd (required)
        :return: ChunksResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}/chunks', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ChunksResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osd(self, osd_id, **kwargs):  # noqa: E501
        """get_osd  # noqa: E501

        get an osd  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def get_osd_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """get_osd  # noqa: E501

        get an osd  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osd_predictions(self, osd_id, **kwargs):  # noqa: E501
        """get_osd_predictions  # noqa: E501

        get a osd's prediction  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd_predictions(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdPredictionsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_osd_predictions_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_osd_predictions_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def get_osd_predictions_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """get_osd_predictions  # noqa: E501

        get a osd's prediction  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd_predictions_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdPredictionsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}/predictions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdPredictionsResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osd_samples(self, osd_id, **kwargs):  # noqa: E501
        """get_osd_samples  # noqa: E501

        get a osd's samples  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd_samples(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :param str duration_begin: duration begin timestamp
        :param str duration_end: duration end timestamp
        :param str period: samples period
        :return: OsdSamplesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_osd_samples_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_osd_samples_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def get_osd_samples_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """get_osd_samples  # noqa: E501

        get a osd's samples  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_osd_samples_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :param str duration_begin: duration begin timestamp
        :param str duration_end: duration end timestamp
        :param str period: samples period
        :return: OsdSamplesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['osd_id', 'duration_begin', 'duration_end', 'period']  # noqa: E501
        all_params.append('async')
        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_osd_samples" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'osd_id' is set
        if ('osd_id' not in params or
                params['osd_id'] is None):
            raise ValueError("Missing the required parameter `osd_id` when calling `get_osd_samples`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'duration_begin' in params:
            query_params.append(('duration_begin', params['duration_begin']))  # noqa: E501
        if 'duration_end' in params:
            query_params.append(('duration_end', params['duration_end']))  # noqa: E501
        if 'period' in params:
            query_params.append(('period', params['period']))  # 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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}/samples', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdSamplesResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osds(self, **kwargs):  # noqa: E501
        """list_osds  # noqa: E501

        List all osds in the cluster  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.list_osds(async=True)
        >>> result = thread.get()

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param int host_id: host id
        :param int pool_id: pool id
        :param str type: osd type: HDD, SSD, Hybrid
        :param str role: osd role: index or data
        :param int cache_disk_id: cache disk id
        :param str q: query param of search
        :param str sort: sort param of search
        :return: OsdsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.list_osds_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_osds_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_osds_with_http_info(self, **kwargs):  # noqa: E501
        """list_osds  # noqa: E501

        List all osds in the cluster  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.list_osds_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param int host_id: host id
        :param int pool_id: pool id
        :param str type: osd type: HDD, SSD, Hybrid
        :param str role: osd role: index or data
        :param int cache_disk_id: cache disk id
        :param str q: query param of search
        :param str sort: sort param of search
        :return: OsdsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['limit', 'offset', 'host_id', 'pool_id', 'type', 'role', 'cache_disk_id', 'q', 'sort']  # noqa: E501
        all_params.append('async')
        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_osds" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'host_id' in params:
            query_params.append(('host_id', params['host_id']))  # noqa: E501
        if 'pool_id' in params:
            query_params.append(('pool_id', params['pool_id']))  # noqa: E501
        if 'type' in params:
            query_params.append(('type', params['type']))  # noqa: E501
        if 'role' in params:
            query_params.append(('role', params['role']))  # noqa: E501
        if 'cache_disk_id' in params:
            query_params.append(('cache_disk_id', params['cache_disk_id']))  # noqa: E501
        if 'q' in params:
            query_params.append(('q', params['q']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # 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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdsResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 maintain_osd(self, osd_id, **kwargs):  # noqa: E501
        """maintain_osd  # noqa: E501

        Put osd in maintained status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.maintain_osd(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.maintain_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.maintain_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def maintain_osd_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """maintain_osd  # noqa: E501

        Put osd in maintained status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.maintain_osd_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}:maintain', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 unmaintain_osd(self, osd_id, **kwargs):  # noqa: E501
        """unmaintain_osd  # noqa: E501

        Put osd out of maintained status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.unmaintain_osd(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.unmaintain_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
        else:
            (data) = self.unmaintain_osd_with_http_info(osd_id, **kwargs)  # noqa: E501
            return data

    def unmaintain_osd_with_http_info(self, osd_id, **kwargs):  # noqa: E501
        """unmaintain_osd  # noqa: E501

        Put osd out of maintained status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.unmaintain_osd_with_http_info(osd_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'osd_id' in params:
            path_params['osd_id'] = params['osd_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'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}:unmaintain', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_osd(self, osd_id, osd, **kwargs):  # noqa: E501
        """update_osd  # noqa: E501

        update osd info  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_osd(osd_id, osd, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :param OsdUpdateReq osd: osd info (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.update_osd_with_http_info(osd_id, osd, **kwargs)  # noqa: E501
        else:
            (data) = self.update_osd_with_http_info(osd_id, osd, **kwargs)  # noqa: E501
            return data

    def update_osd_with_http_info(self, osd_id, osd, **kwargs):  # noqa: E501
        """update_osd  # noqa: E501

        update osd info  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_osd_with_http_info(osd_id, osd, async=True)
        >>> result = thread.get()

        :param async bool
        :param int osd_id: osd id (required)
        :param OsdUpdateReq osd: osd info (required)
        :return: OsdResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['osd_id', 'osd']  # noqa: E501
        all_params.append('async')
        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_osd" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'osd_id' is set
        if ('osd_id' not in params or
                params['osd_id'] is None):
            raise ValueError("Missing the required parameter `osd_id` when calling `update_osd`")  # noqa: E501
        # verify the required parameter 'osd' is set
        if ('osd' not in params or
                params['osd'] is None):
            raise ValueError("Missing the required parameter `osd` when calling `update_osd`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/osds/{osd_id}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OsdResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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)
