# coding: utf-8

"""
    Cloudera Manager API

    <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>  # noqa: E501

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


class RoleCommandsResourceApi(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 format_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Format HDFS NameNodes.  # noqa: E501

        Format HDFS NameNodes. <p> Submit a format request to a list of NameNodes on a service. Note that trying to format a previously formatted NameNode will fail. <p> Note about high availability: when two NameNodes are working in an HA pair, only one of them should be formatted. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.format_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the NameNodes to format.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.format_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.format_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def format_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Format HDFS NameNodes.  # noqa: E501

        Format HDFS NameNodes. <p> Submit a format request to a list of NameNodes on a service. Note that trying to format a previously formatted NameNode will fail. <p> Note about high availability: when two NameNodes are working in an HA pair, only one of them should be formatted. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.format_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the NameNodes to format.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFormat', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_bootstrap_stand_by_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Bootstrap HDFS stand-by NameNodes.  # noqa: E501

        Bootstrap HDFS stand-by NameNodes. <p> Submit a request to synchronize HDFS NameNodes with their assigned HA partners. The command requires that the target NameNodes are part of existing HA pairs, which can be accomplished by setting the nameservice configuration parameter in the NameNode's configuration. <p> The HA partner must already be formatted and running for this command to run.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_bootstrap_stand_by_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the stand-by NameNodes to bootstrap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_bootstrap_stand_by_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_bootstrap_stand_by_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_bootstrap_stand_by_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Bootstrap HDFS stand-by NameNodes.  # noqa: E501

        Bootstrap HDFS stand-by NameNodes. <p> Submit a request to synchronize HDFS NameNodes with their assigned HA partners. The command requires that the target NameNodes are part of existing HA pairs, which can be accomplished by setting the nameservice configuration parameter in the NameNode's configuration. <p> The HA partner must already be formatted and running for this command to run.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_bootstrap_stand_by_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the stand-by NameNodes to bootstrap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsBootstrapStandBy', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_enter_safemode(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Enter safemode for namenodes.  # noqa: E501

        Enter safemode for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_enter_safemode(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to enter safemode.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_enter_safemode_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_enter_safemode_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_enter_safemode_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Enter safemode for namenodes.  # noqa: E501

        Enter safemode for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_enter_safemode_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to enter safemode.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsEnterSafemode', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_finalize_metadata_upgrade(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Finalize HDFS NameNode metadata upgrade.  # noqa: E501

        Finalize HDFS NameNode metadata upgrade. <p/> Available since API v3.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_finalize_metadata_upgrade(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to finalize the upgrade.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_finalize_metadata_upgrade_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_finalize_metadata_upgrade_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_finalize_metadata_upgrade_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Finalize HDFS NameNode metadata upgrade.  # noqa: E501

        Finalize HDFS NameNode metadata upgrade. <p/> Available since API v3.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_finalize_metadata_upgrade_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to finalize the upgrade.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFinalizeMetadataUpgrade', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_initialize_auto_failover_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize HDFS HA failover controller metadata.  # noqa: E501

        Initialize HDFS HA failover controller metadata. <p> The controllers being initialized must already exist and be properly configured. The command will make sure the needed data is initialized for the controller to work. <p> Only one controller per nameservice needs to be initialized.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_initialize_auto_failover_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the controllers to initialize.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_initialize_auto_failover_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_initialize_auto_failover_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_initialize_auto_failover_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize HDFS HA failover controller metadata.  # noqa: E501

        Initialize HDFS HA failover controller metadata. <p> The controllers being initialized must already exist and be properly configured. The command will make sure the needed data is initialized for the controller to work. <p> Only one controller per nameservice needs to be initialized.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_initialize_auto_failover_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the controllers to initialize.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeAutoFailover', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_initialize_shared_dir_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize HDFS NameNodes' shared edit directory.  # noqa: E501

        Initialize HDFS NameNodes' shared edit directory. <p> Shared edit directories are used when two HDFS NameNodes are operating as a high-availability pair. This command initializes the shared directory to include the necessary metadata. <p> The provided role names should reflect one of the NameNodes in the respective HA pair; the role must be stopped and its data directory must already have been formatted. The shared edits directory must be empty for this command to succeed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_initialize_shared_dir_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the NameNodes.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_initialize_shared_dir_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_initialize_shared_dir_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_initialize_shared_dir_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize HDFS NameNodes' shared edit directory.  # noqa: E501

        Initialize HDFS NameNodes' shared edit directory. <p> Shared edit directories are used when two HDFS NameNodes are operating as a high-availability pair. This command initializes the shared directory to include the necessary metadata. <p> The provided role names should reflect one of the NameNodes in the respective HA pair; the role must be stopped and its data directory must already have been formatted. The shared edits directory must be empty for this command to succeed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_initialize_shared_dir_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the NameNodes.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeSharedDir', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_leave_safemode(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Leave safemode for namenodes.  # noqa: E501

        Leave safemode for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_leave_safemode(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to leave safemode.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_leave_safemode_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_leave_safemode_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_leave_safemode_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Leave safemode for namenodes.  # noqa: E501

        Leave safemode for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_leave_safemode_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to leave safemode.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsLeaveSafemode', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 hdfs_save_namespace(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Save namespace for namenodes.  # noqa: E501

        Save namespace for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_save_namespace(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to save namespace.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hdfs_save_namespace_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.hdfs_save_namespace_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def hdfs_save_namespace_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Save namespace for namenodes.  # noqa: E501

        Save namespace for namenodes <p/> Available since API v4.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hdfs_save_namespace_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: NameNodes for which to save namespace.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsSaveNamespace', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 jmap_dump(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jmapDump diagnostic command.  # noqa: E501

        Run the jmapDump diagnostic command. The command runs the jmap utility to capture a dump of the role's java heap. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jmap_dump(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jmap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.jmap_dump_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.jmap_dump_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def jmap_dump_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jmapDump diagnostic command.  # noqa: E501

        Run the jmapDump diagnostic command. The command runs the jmap utility to capture a dump of the role's java heap. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jmap_dump_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jmap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/jmapDump', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 jmap_histo(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jmapHisto diagnostic command.  # noqa: E501

        Run the jmapHisto diagnostic command. The command runs the jmap utility to capture a histogram of the objects on the role's java heap. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jmap_histo(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jmap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.jmap_histo_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.jmap_histo_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def jmap_histo_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jmapHisto diagnostic command.  # noqa: E501

        Run the jmapHisto diagnostic command. The command runs the jmap utility to capture a histogram of the objects on the role's java heap. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jmap_histo_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jmap.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/jmapHisto', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 jstack(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jstack diagnostic command.  # noqa: E501

        Run the jstack diagnostic command. The command runs the jstack utility to capture a role's java thread stacks. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jstack(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jstack.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.jstack_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.jstack_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def jstack_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the jstack diagnostic command.  # noqa: E501

        Run the jstack diagnostic command. The command runs the jstack utility to capture a role's java thread stacks. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.jstack_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to jstack.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/jstack', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 lsof(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the lsof diagnostic command.  # noqa: E501

        Run the lsof diagnostic command. This command runs the lsof utility to list a role's open files. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.lsof(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to lsof.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.lsof_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.lsof_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def lsof_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Run the lsof diagnostic command.  # noqa: E501

        Run the lsof diagnostic command. This command runs the lsof utility to list a role's open files. <p/> Available since API v8.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.lsof_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the names of the roles to lsof.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/lsof', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 refresh_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Refresh a role's data.  # noqa: E501

        Refresh a role's data. <p> For MapReduce services, this command should be executed on JobTracker roles. It refreshes the role's queue and node information. <p> For HDFS services, this command should be executed on NameNode or DataNode roles. For NameNodes, it refreshes the role's node list. For DataNodes, it refreshes the role's data directory list and other configuration. <p> For YARN services, this command should be executed on ResourceManager roles. It refreshes the role's queue and node information. <p> Available since API v1. DataNode data directories refresh available since API v10.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.refresh_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.refresh_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.refresh_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def refresh_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Refresh a role's data.  # noqa: E501

        Refresh a role's data. <p> For MapReduce services, this command should be executed on JobTracker roles. It refreshes the role's queue and node information. <p> For HDFS services, this command should be executed on NameNode or DataNode roles. For NameNodes, it refreshes the role's node list. For DataNodes, it refreshes the role's data directory list and other configuration. <p> For YARN services, this command should be executed on ResourceManager roles. It refreshes the role's queue and node information. <p> Available since API v1. DataNode data directories refresh available since API v10.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.refresh_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/refresh', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 restart_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Restart a set of role instances.  # noqa: E501

        Restart a set of role instances <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.restart_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The name of the roles to restart.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.restart_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.restart_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def restart_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Restart a set of role instances.  # noqa: E501

        Restart a set of role instances <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.restart_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The name of the roles to restart.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/restart', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 role_command_by_name(self, cluster_name, command_name, service_name, **kwargs):  # noqa: E501
        """Execute a role command by name.  # noqa: E501

        Execute a role command by name. <p/> Available since API v6.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.role_command_by_name(cluster_name, command_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str command_name: the name of command to execute. (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the roles to run this command on.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.role_command_by_name_with_http_info(cluster_name, command_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.role_command_by_name_with_http_info(cluster_name, command_name, service_name, **kwargs)  # noqa: E501
            return data

    def role_command_by_name_with_http_info(self, cluster_name, command_name, service_name, **kwargs):  # noqa: E501
        """Execute a role command by name.  # noqa: E501

        Execute a role command by name. <p/> Available since API v6.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.role_command_by_name_with_http_info(cluster_name, command_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str command_name: the name of command to execute. (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: the roles to run this command on.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'command_name' in params:
            path_params['commandName'] = params['command_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/{commandName}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 start_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Start a set of role instances.  # noqa: E501

        Start a set of role instances. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles to start.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.start_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.start_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def start_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Start a set of role instances.  # noqa: E501

        Start a set of role instances. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles to start.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/start', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 stop_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Stop a set of role instances.  # noqa: E501

        Stop a set of role instances. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.stop_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The role type.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.stop_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.stop_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def stop_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Stop a set of role instances.  # noqa: E501

        Stop a set of role instances. <p> Bulk command operations are not atomic, and may contain partial failures. The returned list will contain references to all successful commands, and a list of error messages identifying the roles on which the command failed.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.stop_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The role type.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/stop', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 sync_hue_db_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Create / update the Hue database schema.  # noqa: E501

        Create / update the Hue database schema. <p> This command is to be run whenever a new database has been specified or, as necessary, after an upgrade. <p> This request should be sent to Hue servers only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.sync_hue_db_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the Hue server roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.sync_hue_db_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.sync_hue_db_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def sync_hue_db_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Create / update the Hue database schema.  # noqa: E501

        Create / update the Hue database schema. <p> This command is to be run whenever a new database has been specified or, as necessary, after an upgrade. <p> This request should be sent to Hue servers only.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.sync_hue_db_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the Hue server roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/hueSyncDb', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 zoo_keeper_cleanup_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Cleanup a list of ZooKeeper server roles.  # noqa: E501

        Cleanup a list of ZooKeeper server roles. <p> This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.zoo_keeper_cleanup_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.zoo_keeper_cleanup_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.zoo_keeper_cleanup_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def zoo_keeper_cleanup_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Cleanup a list of ZooKeeper server roles.  # noqa: E501

        Cleanup a list of ZooKeeper server roles. <p> This command removes snapshots and transaction log files kept by ZooKeeper for backup purposes. Refer to the ZooKeeper documentation for more details.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.zoo_keeper_cleanup_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperCleanup', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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 zoo_keeper_init_command(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize a list of ZooKeeper server roles.  # noqa: E501

        Initialize a list of ZooKeeper server roles. <p> This applies to ZooKeeper services from CDH4. Before ZooKeeper server roles can be used, they need to be initialized.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.zoo_keeper_init_command(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.zoo_keeper_init_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
        else:
            (data) = self.zoo_keeper_init_command_with_http_info(cluster_name, service_name, **kwargs)  # noqa: E501
            return data

    def zoo_keeper_init_command_with_http_info(self, cluster_name, service_name, **kwargs):  # noqa: E501
        """Initialize a list of ZooKeeper server roles.  # noqa: E501

        Initialize a list of ZooKeeper server roles. <p> This applies to ZooKeeper services from CDH4. Before ZooKeeper server roles can be used, they need to be initialized.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.zoo_keeper_init_command_with_http_info(cluster_name, service_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str service_name: (required)
        :param ApiRoleNameList body: The names of the roles.
        :return: ApiBulkCommandList
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'service_name' in params:
            path_params['serviceName'] = params['service_name']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperInit', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiBulkCommandList',  # 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)
