'Call type drivers to reserve a network segment.'

def reserve_network_segment(self, context, segment_data):

    if (not validators.is_attr_set(segment_data[ml2_api.NETWORK_TYPE])):
        msg = _('network_type    required')
        raise exc.InvalidInput(error_message=msg)
    net_type = self._get_attribute(segment_data, ml2_api.NETWORK_TYPE)
    phys_net = self._get_attribute(segment_data, ml2_api.PHYSICAL_NETWORK)
    seg_id = self._get_attribute(segment_data, ml2_api.SEGMENTATION_ID)
    segment = {ml2_api.NETWORK_TYPE: net_type, ml2_api.PHYSICAL_NETWORK: phys_net, ml2_api.SEGMENTATION_ID: seg_id}
    self.validate_provider_segment(segment)
    with db_api.context_manager.writer.using(context):
        return self.reserve_provider_segment(context, segment)
