Example #1
0
def remove_share_group_type_access(context, share_group_type_id, project_id):
    """Remove access to share group type for project_id."""
    if share_group_type_id is None:
        msg = _("share_group_type_id cannot be None.")
        raise exception.InvalidShareGroupType(reason=msg)
    return db.share_group_type_access_remove(
        context, share_group_type_id, project_id)
Example #2
0
def destroy(context, type_id):
    """Marks share group types as deleted."""
    if id is None:
        msg = _("Share group type ID cannot be None.")
        raise exception.InvalidShareGroupType(reason=msg)
    else:
        db.share_group_type_destroy(context, type_id)
Example #3
0
def get_by_name(context, name):
    """Retrieves single share group type by name."""
    if name is None:
        msg = _("name cannot be None.")
        raise exception.InvalidShareGroupType(reason=msg)

    return db.share_group_type_get_by_name(context, name)
Example #4
0
def get(ctxt, type_id, expected_fields=None):
    """Retrieves single share group type by id."""
    if type_id is None:
        msg = _("Share type ID cannot be None.")
        raise exception.InvalidShareGroupType(reason=msg)

    if ctxt is None:
        ctxt = context.get_admin_context()

    return db.share_group_type_get(
        ctxt, type_id, expected_fields=expected_fields)