'Check whether the host is associated to the hostgroup.'

def _is_host_associate_to_hostgroup(self, hostgroup_id, host_id):

    url = ('/host/associate?TYPE=21&ASSOCIATEOBJTYPE=14&ASSOCIATEOBJID=%s' % hostgroup_id)
    result = self.call(url, None, 'GET')
    self._assert_rest_result(result, _('Check    hostgroup    associate    error.'))
    if self._get_id_from_result(result, host_id, 'ID'):
        return True
    return False
