# coding: utf-8

"""
    GraphDB Workbench API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    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 graphdb.graphdb_workbench.api_client import ApiClient


class ClusterManagementControllerApi(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 clone_worker_using_post(self, bean, **kwargs):  # noqa: E501
        """Clone a worker  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.clone_worker_using_post(bean, async_req=True)
        >>> result = thread.get()

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

    def clone_worker_using_post_with_http_info(self, bean, **kwargs):  # noqa: E501
        """Clone a worker  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.clone_worker_using_post_with_http_info(bean, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bean' in params:
            body_params = params['bean']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/nodes/clone', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 connect_masters_using_post(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Connect two masters  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.connect_masters_using_post(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param MasterConnectBean bean: bean (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.connect_masters_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
        else:
            (data) = self.connect_masters_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
            return data

    def connect_masters_using_post_with_http_info(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Connect two masters  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.connect_masters_using_post_with_http_info(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param MasterConnectBean bean: bean (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bean' in params:
            body_params = params['bean']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/peers', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 connect_worker_using_post(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Connect a worker to a master  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.connect_worker_using_post(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param WorkerConnectBean bean: bean (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.connect_worker_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
        else:
            (data) = self.connect_worker_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
            return data

    def connect_worker_using_post_with_http_info(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Connect a worker to a master  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.connect_worker_using_post_with_http_info(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param WorkerConnectBean bean: bean (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bean' in params:
            body_params = params['bean']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/workers', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 disconnect_masters_using_delete(self, master_repository_id, **kwargs):  # noqa: E501
        """Disconnect two masters  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disconnect_masters_using_delete(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param bool bidirectional: whether to connect the masters in both directions (default)
        :param str master_location: master repository location
        :param str master_node_id: master node id
        :param str peer_location: the peer repository location
        :param str peer_node_id: the peer node ID
        :param str peer_repository_id: the peer repository ID
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.disconnect_masters_using_delete_with_http_info(master_repository_id, **kwargs)  # noqa: E501
        else:
            (data) = self.disconnect_masters_using_delete_with_http_info(master_repository_id, **kwargs)  # noqa: E501
            return data

    def disconnect_masters_using_delete_with_http_info(self, master_repository_id, **kwargs):  # noqa: E501
        """Disconnect two masters  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disconnect_masters_using_delete_with_http_info(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param bool bidirectional: whether to connect the masters in both directions (default)
        :param str master_location: master repository location
        :param str master_node_id: master node id
        :param str peer_location: the peer repository location
        :param str peer_node_id: the peer node ID
        :param str peer_repository_id: the peer repository ID
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['master_repository_id', 'bidirectional', 'master_location', 'master_node_id', 'peer_location', 'peer_node_id', 'peer_repository_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []
        if 'bidirectional' in params:
            query_params.append(('bidirectional', params['bidirectional']))  # noqa: E501
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # noqa: E501
        if 'master_node_id' in params:
            query_params.append(('masterNodeID', params['master_node_id']))  # noqa: E501
        if 'peer_location' in params:
            query_params.append(('peerLocation', params['peer_location']))  # noqa: E501
        if 'peer_node_id' in params:
            query_params.append(('peerNodeID', params['peer_node_id']))  # noqa: E501
        if 'peer_repository_id' in params:
            query_params.append(('peerRepositoryID', params['peer_repository_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/peers', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 disconnect_worker_using_delete(self, master_repository_id, **kwargs):  # noqa: E501
        """Disconnect a worker from a master  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disconnect_worker_using_delete(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str master_location: worker repository URL
        :param str worker_url: master repository location
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.disconnect_worker_using_delete_with_http_info(master_repository_id, **kwargs)  # noqa: E501
        else:
            (data) = self.disconnect_worker_using_delete_with_http_info(master_repository_id, **kwargs)  # noqa: E501
            return data

    def disconnect_worker_using_delete_with_http_info(self, master_repository_id, **kwargs):  # noqa: E501
        """Disconnect a worker from a master  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.disconnect_worker_using_delete_with_http_info(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str master_location: worker repository URL
        :param str worker_url: master repository location
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # noqa: E501
        if 'worker_url' in params:
            query_params.append(('workerURL', params['worker_url']))  # 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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/workers', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 do_backup_using_get(self, master_repository_id, backup_name, **kwargs):  # noqa: E501
        """Initiate a cluster backup  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.do_backup_using_get(master_repository_id, backup_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str backup_name: backupName (required)
        :param str master_location: masterLocation
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.do_backup_using_get_with_http_info(master_repository_id, backup_name, **kwargs)  # noqa: E501
        else:
            (data) = self.do_backup_using_get_with_http_info(master_repository_id, backup_name, **kwargs)  # noqa: E501
            return data

    def do_backup_using_get_with_http_info(self, master_repository_id, backup_name, **kwargs):  # noqa: E501
        """Initiate a cluster backup  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.do_backup_using_get_with_http_info(master_repository_id, backup_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str backup_name: backupName (required)
        :param str master_location: masterLocation
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'backup_name' in params:
            query_params.append(('backupName', params['backup_name']))  # noqa: E501
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # 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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/backup', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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 do_restore_using_get(self, master_repository_id, backup_name, **kwargs):  # noqa: E501
        """Initiate a cluster restore  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.do_restore_using_get(master_repository_id, backup_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str backup_name: backupName (required)
        :param str master_location: masterLocation
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.do_restore_using_get_with_http_info(master_repository_id, backup_name, **kwargs)  # noqa: E501
        else:
            (data) = self.do_restore_using_get_with_http_info(master_repository_id, backup_name, **kwargs)  # noqa: E501
            return data

    def do_restore_using_get_with_http_info(self, master_repository_id, backup_name, **kwargs):  # noqa: E501
        """Initiate a cluster restore  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.do_restore_using_get_with_http_info(master_repository_id, backup_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str backup_name: backupName (required)
        :param str master_location: masterLocation
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'backup_name' in params:
            query_params.append(('backupName', params['backup_name']))  # noqa: E501
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # 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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/restore', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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_master_using_get(self, master_repository_id, **kwargs):  # noqa: E501
        """Get information about a master  # 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_master_using_get(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str master_location: master repository location
        :return: MasterNode
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_master_using_get_with_http_info(master_repository_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_master_using_get_with_http_info(master_repository_id, **kwargs)  # noqa: E501
            return data

    def get_master_using_get_with_http_info(self, master_repository_id, **kwargs):  # noqa: E501
        """Get information about a master  # 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_master_using_get_with_http_info(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param str master_location: master repository location
        :return: MasterNode
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MasterNode',  # 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_workers_for_master_using_get(self, master_repository_id, **kwargs):  # noqa: E501
        """Get workers connected to a master  # 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_workers_for_master_using_get(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository id (required)
        :param str master_location: master repository location
        :return: list[WorkerNode]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_workers_for_master_using_get_with_http_info(master_repository_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_workers_for_master_using_get_with_http_info(master_repository_id, **kwargs)  # noqa: E501
            return data

    def get_workers_for_master_using_get_with_http_info(self, master_repository_id, **kwargs):  # noqa: E501
        """Get workers connected to a master  # 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_workers_for_master_using_get_with_http_info(master_repository_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository id (required)
        :param str master_location: master repository location
        :return: list[WorkerNode]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}/workers', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[WorkerNode]',  # 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_master_using_post(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Set master attribute  # 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_master_using_post(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param object bean: bean (required)
        :param str master_location: master repository location
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.set_master_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
        else:
            (data) = self.set_master_using_post_with_http_info(master_repository_id, bean, **kwargs)  # noqa: E501
            return data

    def set_master_using_post_with_http_info(self, master_repository_id, bean, **kwargs):  # noqa: E501
        """Set master attribute  # 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_master_using_post_with_http_info(master_repository_id, bean, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str master_repository_id: master repository ID (required)
        :param object bean: bean (required)
        :param str master_location: master repository location
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []
        if 'master_location' in params:
            query_params.append(('masterLocation', params['master_location']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bean' in params:
            body_params = params['bean']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/rest/cluster/masters/{masterRepositoryId}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='str',  # 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)
