# coding: utf-8

"""
    Zadara VPSA Object Storage REST API

    # Overview  This document outlines the methods available for administrating your VPSA&#174; Object Storage. The 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. Alternately, you can use the username and password parameters for authentication, but we do not recommend this method for anything other than possibly retrieving an API key.  By default , all operations are allowed only to VPSA Object Storage admin. Some actions are allowed by an account admin and they will be marked on the action's 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 adding drives to storage policy, 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.  ## Metering API  Metering information can be retrieved using the VPSA Object Storage API for the following components:  - Accounts - Users - Drives - Virtual Controllers - Load Balancer Groups - Storage Policies  Metering information returned by the API is subject to the following constraints:  - 10 seconds interval - 1 hour range - 1 minute interval - 1 day range - 1 hour interval - 30 days range  Values outside the accepted range will be returned as 0.  ## Questions  If you have any questions or need support involving the REST API, please contact for assistance.   # noqa: E501

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


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from Zios.api_client import ApiClient


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

        Retrieves details of storage policy capacity over time.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.capacity_over_time(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies (required)
        :param int interval: The interval between data points, in seconds
        :param str name: The policy display name 'name' value as returned by get_all_policies, for example '2-Way-Protection'
        :return: InlineResponse20039
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.capacity_over_time_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.capacity_over_time_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def capacity_over_time_with_http_info(self, id, **kwargs):  # noqa: E501
        """capacity_over_time  # noqa: E501

        Retrieves details of storage policy capacity over time.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.capacity_over_time_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies (required)
        :param int interval: The interval between data points, in seconds
        :param str name: The policy display name 'name' value as returned by get_all_policies, for example '2-Way-Protection'
        :return: InlineResponse20039
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'interval', 'name']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method capacity_over_time" % 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 `capacity_over_time`")  # noqa: E501

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^storage_policy-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `capacity_over_time`, must conform to the pattern `/^storage_policy-[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 `capacity_over_time`, 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
        if 'name' in params:
            query_params.append(('name', params['name']))  # 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(
            '/zios/policies/{id}/capacity_over_time.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20039',  # 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_drives_from_policy(self, name, delete_drives_from_policy, **kwargs):  # noqa: E501
        """delete_drives_from_policy  # noqa: E501

        Remove drives from storage policy  # 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_drives_from_policy(name, delete_drives_from_policy, async_req=True)
        >>> result = thread.get()

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

    def delete_drives_from_policy_with_http_info(self, name, delete_drives_from_policy, **kwargs):  # noqa: E501
        """delete_drives_from_policy  # noqa: E501

        Remove drives from storage policy  # 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_drives_from_policy_with_http_info(name, delete_drives_from_policy, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'delete_drives_from_policy' in params:
            body_params = params['delete_drives_from_policy']
        # 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(
            '/zios/policies/{name}/drives.json', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20038',  # 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_policies(self, **kwargs):  # noqa: E501
        """get_all_policies  # noqa: E501

        Get a list of Storage policies.  # 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_policies(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: InlineResponse20034
                 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_policies_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_all_policies_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_all_policies_with_http_info(self, **kwargs):  # noqa: E501
        """get_all_policies  # noqa: E501

        Get a list of Storage policies.  # 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_policies_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: InlineResponse20034
                 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_policies" % 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_policies`, 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(
            '/zios/policies.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20034',  # 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_policy(self, name, **kwargs):  # noqa: E501
        """get_policy  # noqa: E501

        Get one storage policy.  # 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_policy(name, async_req=True)
        >>> result = thread.get()

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

    def get_policy_with_http_info(self, name, **kwargs):  # noqa: E501
        """get_policy  # noqa: E501

        Get one storage policy.  # 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_policy_with_http_info(name, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/zios/policies/{name}.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20035',  # 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 iops(self, id, **kwargs):  # noqa: E501
        """iops  # noqa: E501

        Shows IOPs metering of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.iops(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20012
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.iops_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.iops_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def iops_with_http_info(self, id, **kwargs):  # noqa: E501
        """iops  # noqa: E501

        Shows IOPs metering of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.iops_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20012
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'interval', 'count', 'service']  # 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 iops" % 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 `iops`")  # noqa: E501

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^storage_policy-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `iops`, must conform to the pattern `/^storage_policy-[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 `iops`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and ('count' in params and params['count'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `count` when calling `iops`, 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
        if 'count' in params:
            query_params.append(('count', params['count']))  # noqa: E501
        if 'service' in params:
            query_params.append(('service', params['service']))  # 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(
            '/zios/policies/{id}/iops.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20012',  # 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 latency(self, id, **kwargs):  # noqa: E501
        """latency  # noqa: E501

        Shows latency metering (ms) of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.latency(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20013
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.latency_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.latency_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def latency_with_http_info(self, id, **kwargs):  # noqa: E501
        """latency  # noqa: E501

        Shows latency metering (ms) of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.latency_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20013
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'interval', 'count', 'service']  # 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 latency" % 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 `latency`")  # noqa: E501

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^storage_policy-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `latency`, must conform to the pattern `/^storage_policy-[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 `latency`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and ('count' in params and params['count'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `count` when calling `latency`, 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
        if 'count' in params:
            query_params.append(('count', params['count']))  # noqa: E501
        if 'service' in params:
            query_params.append(('service', params['service']))  # 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(
            '/zios/policies/{id}/latency.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20013',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        Set a default storage policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_default_policy(name, async_req=True)
        >>> result = thread.get()

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

    def set_default_policy_with_http_info(self, name, **kwargs):  # noqa: E501
        """set_default_policy  # noqa: E501

        Set a default storage policy  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_default_policy_with_http_info(name, async_req=True)
        >>> result = thread.get()

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

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/zios/policies/{name}/set_default.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20037',  # 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 throughput(self, id, **kwargs):  # noqa: E501
        """throughput  # noqa: E501

        Shows bandwidth throughput metering (B/s) of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.throughput(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20014
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.throughput_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.throughput_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def throughput_with_http_info(self, id, **kwargs):  # noqa: E501
        """throughput  # noqa: E501

        Shows bandwidth throughput metering (B/s) of a storage policy.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.throughput_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The policy name 'name' value as returned by get_all_policies. (required)
        :param int interval: The interval between data points, in seconds
        :param int count: The number of data points
        :param str service:
        :return: InlineResponse20014
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'interval', 'count', 'service']  # 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 throughput" % 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 `throughput`")  # noqa: E501

        if self.api_client.client_side_validation and ('id' in params and not re.search(r'^storage_policy-[0-9a-f]{8}$', params['id'])):  # noqa: E501
            raise ValueError("Invalid value for parameter `id` when calling `throughput`, must conform to the pattern `/^storage_policy-[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 `throughput`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and ('count' in params and params['count'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `count` when calling `throughput`, 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
        if 'count' in params:
            query_params.append(('count', params['count']))  # noqa: E501
        if 'service' in params:
            query_params.append(('service', params['service']))  # 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(
            '/zios/policies/{id}/throughput.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20014',  # 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_storage_policy(self, name, update_storage_policy, **kwargs):  # noqa: E501
        """update_storage_policy  # noqa: E501

        Update a storage policy  # 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_storage_policy(name, update_storage_policy, async_req=True)
        >>> result = thread.get()

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

    def update_storage_policy_with_http_info(self, name, update_storage_policy, **kwargs):  # noqa: E501
        """update_storage_policy  # noqa: E501

        Update a storage policy  # 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_storage_policy_with_http_info(name, update_storage_policy, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'update_storage_policy' in params:
            body_params = params['update_storage_policy']
        # 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(
            '/zios/policies/{name}.json', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20036',  # 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)
