def rolling_restart(self, slave_batch_size=None,
                      slave_fail_count_threshold=None,
                      sleep_seconds=None,
                      stale_configs_only=None,
                      unupgraded_only=None,
                      restart_role_types=None,
                      restart_role_names=None):
    """
    Rolling restart the roles of a service. The sequence is:
      1. Restart all the non-slave roles
      2. If slaves are present restart them in batches of size specified
      3. Perform any post-command needed after rolling restart

    @param slave_batch_size: Number of slave roles to restart at a time
           Must be greater than 0. Default is 1.
           For HDFS, this number should be less than the replication factor (default 3)
           to ensure data availability during rolling restart.
    @param slave_fail_count_threshold: The threshold for number of slave batches that
           are allowed to fail to restart before the entire command is considered failed.
           Must be >= 0. Default is 0.
    @param sleep_seconds: Number of seconds to sleep between restarts of slave role batches.
            Must be >=0. Default is 0.
    @param stale_configs_only: Restart roles with stale configs only. Default is false.
    @param unupgraded_only: Restart roles that haven't been upgraded yet. Default is false.
    @param restart_role_types: Role types to restart. If not specified, all startable roles are restarted.
    @param restart_role_names: List of specific roles to restart.
            If none are specified, then all roles of specified role types are restarted.
    @return: Reference to the submitted command.
    @since: API v3
    """
    args = dict()
    if slave_batch_size:
      args['slaveBatchSize'] = slave_batch_size
    if slave_fail_count_threshold:
      args['slaveFailCountThreshold'] = slave_fail_count_threshold
    if sleep_seconds:
      args['sleepSeconds'] = sleep_seconds
    if stale_configs_only:
      args['staleConfigsOnly'] = stale_configs_only
    if unupgraded_only:
      args['unUpgradedOnly'] = unupgraded_only
    if restart_role_types:
      args['restartRoleTypes'] = restart_role_types
    if restart_role_names:
      args['restartRoleNames'] = restart_role_names

    return self._cmd('rollingRestart', data=args)
Rolling restart the roles of a service. The sequence is:
      1. Restart all the non-slave roles
      2. If slaves are present restart them in batches of size specified
      3. Perform any post-command needed after rolling restart

    @param slave_batch_size: Number of slave roles to restart at a time
           Must be greater than 0. Default is 1.
           For HDFS, this number should be less than the replication factor (default 3)
           to ensure data availability during rolling restart.
    @param slave_fail_count_threshold: The threshold for number of slave batches that
           are allowed to fail to restart before the entire command is considered failed.
           Must be >= 0. Default is 0.
    @param sleep_seconds: Number of seconds to sleep between restarts of slave role batches.
            Must be >=0. Default is 0.
    @param stale_configs_only: Restart roles with stale configs only. Default is false.
    @param unupgraded_only: Restart roles that haven't been upgraded yet. Default is false.
    @param restart_role_types: Role types to restart. If not specified, all startable roles are restarted.
    @param restart_role_names: List of specific roles to restart.
            If none are specified, then all roles of specified role types are restarted.
    @return: Reference to the submitted command.
    @since: API v3