'Return the name of the specified element from a masking view.
:param array: the array serial number
:param maskingview_name: the masking view name
:param portgroup: the port group name - optional
:param host: the host name - optional
:param storagegroup: the storage group name - optional
:returns: name of the specified element -- string
:raises: VolumeBackendAPIException'

def get_element_from_masking_view(self, array, maskingview_name, portgroup=False, host=False, storagegroup=False):

    element = None
    masking_view_details = self.get_masking_view(array, maskingview_name)
    if masking_view_details:
        if portgroup:
            element = masking_view_details['portGroupId']
        elif host:
            element = masking_view_details['hostId']
        elif storagegroup:
            element = masking_view_details['storageGroupId']
    else:
        exception_message = _('Error    retrieving    masking    group.')
        LOG.error(exception_message)
        raise exception.VolumeBackendAPIException(data=exception_message)
    return element
