MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / delete_project

Function delete_project

app/api/agentops/opsboard/views/projects.py:143–164  ·  view source on GitHub ↗

Delete a project. User must be an owner of the organization.

(
    *,
    request: Request,
    project_id: str,
    orm: Session = Depends(get_orm_session),
)

Source from the content-addressed store, hash-verified

141
142
143def delete_project(
144 *,
145 request: Request,
146 project_id: str,
147 orm: Session = Depends(get_orm_session),
148) -> StatusResponse:
149 """
150 Delete a project.
151 User must be an owner of the organization.
152 """
153 project = ProjectModel.get_by_id(orm, project_id)
154
155 if not project:
156 raise HTTPException(status_code=404, detail="Project not found")
157
158 if not project.org.is_user_owner(request.state.session.user_id):
159 raise HTTPException(status_code=403, detail="Only organization owners can delete projects")
160
161 orm.delete(project)
162 orm.commit()
163
164 return StatusResponse(message="Project deleted successfully")
165
166
167def regenerate_api_key(

Callers 2

test_delete_projectFunction · 0.90

Calls 4

is_user_ownerMethod · 0.80
StatusResponseClass · 0.50
get_by_idMethod · 0.45
deleteMethod · 0.45

Tested by 2

test_delete_projectFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…