# 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 PoolsApi(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 add_osds_to_pool(self, pool_id, body, **kwargs):  # noqa: E501
        """add_osds_to_pool  # noqa: E501

        Add osds to pool  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_osds_to_pool(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param OsdsAddReq body: osd infos (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.add_osds_to_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.add_osds_to_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
            return data

    def add_osds_to_pool_with_http_info(self, pool_id, body, **kwargs):  # noqa: E501
        """add_osds_to_pool  # noqa: E501

        Add osds to pool  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.add_osds_to_pool_with_http_info(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param OsdsAddReq body: osd infos (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        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(
            '/pools/{pool_id}/osds', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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 create_pool(self, body, **kwargs):  # noqa: E501
        """create_pool  # noqa: E501

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

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

    def create_pool_with_http_info(self, body, **kwargs):  # noqa: E501
        """create_pool  # noqa: E501

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

        :param async bool
        :param PoolCreateReq body: the pool info (required)
        :return: PoolResp
                 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_pool" % 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_pool`")  # 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(
            '/pools/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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_pool(self, pool_id, **kwargs):  # noqa: E501
        """delete_pool  # noqa: E501

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

        :param async bool
        :param int pool_id: pool id (required)
        :param bool force: force delete or not
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_pool_with_http_info(pool_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_pool_with_http_info(pool_id, **kwargs)  # noqa: E501
            return data

    def delete_pool_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """delete_pool  # noqa: E501

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

        :param async bool
        :param int pool_id: pool id (required)
        :param bool force: force delete or not
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'force' in params:
            query_params.append(('force', params['force']))  # 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(
            '/pools/{pool_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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_pool(self, pool_id, **kwargs):  # noqa: E501
        """get_pool  # noqa: E501

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

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

    def get_pool_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """get_pool  # noqa: E501

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

        :param async bool
        :param int pool_id: pool id (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'pool_id' in params:
            path_params['pool_id'] = params['pool_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(
            '/pools/{pool_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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_pool_predictions(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_predictions  # noqa: E501

        get a pool'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_pool_predictions(pool_id, async=True)
        >>> result = thread.get()

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

    def get_pool_predictions_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_predictions  # noqa: E501

        get a pool'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_pool_predictions_with_http_info(pool_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :return: PoolPredictionsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'pool_id' in params:
            path_params['pool_id'] = params['pool_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(
            '/pools/{pool_id}/predictions', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolPredictionsResp',  # 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_pool_samples(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_samples  # noqa: E501

        get pool'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_pool_samples(pool_id, async=True)
        >>> result = thread.get()

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

    def get_pool_samples_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_samples  # noqa: E501

        get pool'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_pool_samples_with_http_info(pool_id, async=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'pool_id' in params:
            path_params['pool_id'] = params['pool_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(
            '/pools/{pool_id}/samples', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolSamplesResp',  # 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_pool_topology(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_topology  # noqa: E501

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

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

    def get_pool_topology_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """get_pool_topology  # noqa: E501

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

        :param async bool
        :param int pool_id: pool id (required)
        :return: PoolTopologyResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'pool_id' in params:
            path_params['pool_id'] = params['pool_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(
            '/pools/{pool_id}/topology', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolTopologyResp',  # 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_pools(self, **kwargs):  # noqa: E501
        """list_pools  # noqa: E501

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

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param bool all: show all pools
        :param bool is_archive: filter archive pool
        :param int protection_domain_id: protection domain id
        :param str pool_role: filter pool by role
        :param int os_policy_id: filter data pool by object storage policy id
        :param str q: query param of search
        :param str sort: sort param of search
        :return: PoolsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.list_pools_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_pools_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_pools_with_http_info(self, **kwargs):  # noqa: E501
        """list_pools  # noqa: E501

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

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param bool all: show all pools
        :param bool is_archive: filter archive pool
        :param int protection_domain_id: protection domain id
        :param str pool_role: filter pool by role
        :param int os_policy_id: filter data pool by object storage policy id
        :param str q: query param of search
        :param str sort: sort param of search
        :return: PoolsResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['limit', 'offset', 'all', 'is_archive', 'protection_domain_id', 'pool_role', 'os_policy_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_pools" % 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 'all' in params:
            query_params.append(('all', params['all']))  # noqa: E501
        if 'is_archive' in params:
            query_params.append(('is_archive', params['is_archive']))  # noqa: E501
        if 'protection_domain_id' in params:
            query_params.append(('protection_domain_id', params['protection_domain_id']))  # noqa: E501
        if 'pool_role' in params:
            query_params.append(('pool_role', params['pool_role']))  # noqa: E501
        if 'os_policy_id' in params:
            query_params.append(('os_policy_id', params['os_policy_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(
            '/pools/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolsResp',  # 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 remove_osds_from_pool(self, pool_id, body, **kwargs):  # noqa: E501
        """remove_osds_from_pool  # noqa: E501

        Remove multiple osds from a pool  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.remove_osds_from_pool(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param OsdsRemoveReq body: osd infos (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.remove_osds_from_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.remove_osds_from_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
            return data

    def remove_osds_from_pool_with_http_info(self, pool_id, body, **kwargs):  # noqa: E501
        """remove_osds_from_pool  # noqa: E501

        Remove multiple osds from a pool  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.remove_osds_from_pool_with_http_info(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param OsdsRemoveReq body: osd infos (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        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(
            '/pools/{pool_id}/osds', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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 reweight_pool(self, pool_id, **kwargs):  # noqa: E501
        """reweight_pool  # noqa: E501

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

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

    def reweight_pool_with_http_info(self, pool_id, **kwargs):  # noqa: E501
        """reweight_pool  # noqa: E501

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

        :param async bool
        :param int pool_id: pool id (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'pool_id' in params:
            path_params['pool_id'] = params['pool_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(
            '/pools/{pool_id}:reweight', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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_pool(self, pool_id, body, **kwargs):  # noqa: E501
        """update_pool  # noqa: E501

        update pool 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_pool(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param PoolUpdateReq body: pool info (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.update_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.update_pool_with_http_info(pool_id, body, **kwargs)  # noqa: E501
            return data

    def update_pool_with_http_info(self, pool_id, body, **kwargs):  # noqa: E501
        """update_pool  # noqa: E501

        update pool 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_pool_with_http_info(pool_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int pool_id: pool id (required)
        :param PoolUpdateReq body: pool info (required)
        :return: PoolResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        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(
            '/pools/{pool_id}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolResp',  # 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)
