'Check whether the port group is associated to the mapping view.'

def is_portgroup_associated_to_view(self, view_id, portgroup_id):

    url = ('/portgroup/associate?ASSOCIATEOBJTYPE=245&ASSOCIATEOBJID=%s&range=[0-8191]' % view_id)
    result = self.call(url, None, 'GET')
    self._assert_rest_result(result, _('Find    portgroup    from    mapping    view    error.'))
    if self._get_id_from_result(result, portgroup_id, 'ID'):
        return True
    return False
