def METHOD_NAME(user, t_id):
    # get If-Match header
    if_match_etag = utils.check_and_get_etag(flask.request.headers)
    base.get_resource_orm(models2.Team, t_id)
    if user.is_not_super_admin():
        raise dci_exc.Unauthorized()
    deleted_team = (
        flask.g.session.query(models2.Team)
        .filter(models2.Team.id == t_id)
        .filter(models2.Team.etag == if_match_etag)
        .update({"state": "archived"})
    )
    flask.g.session.commit()
    if not deleted_team:
        flask.g.session.rollback()
        raise dci_exc.DCIException(
            message="delete failed, either team already deleted or etag not matched",
            status_code=409,
        )
    try:
        for model in [models2.File, models2.Remoteci, models2.Job]:
            flask.g.session.query(model).filter(model.team_id == t_id).update(
                {"state": "archived"}
            )
        flask.g.session.commit()
    except Exception as e:
        flask.g.session.rollback()
        raise dci_exc.DCIException(message=str(e), status_code=409)
    return flask.Response(None, 204, content_type="application/json")