diff --git a/nmdc_runtime/api/endpoints/workflows.py b/nmdc_runtime/api/endpoints/workflows.py index 594773b7..445153d0 100644 --- a/nmdc_runtime/api/endpoints/workflows.py +++ b/nmdc_runtime/api/endpoints/workflows.py @@ -61,6 +61,21 @@ async def post_activity( site: Site = Depends(get_current_client_site), mdb: MongoDatabase = Depends(get_mongo_db), ): + """ + Please migrate all workflows from `v1/workflows/activities` to this endpoint. + ------- + Post activity set to database and claim job. + + Parameters + ------- + activity_set: dict[str,Any] + Set of activities for specific workflows. + + Returns + ------- + dict[str,str] + + """ _ = site # must be authenticated try: # verify activities in activity_set are nmdc-schema compliant diff --git a/nmdc_runtime/api/v1/workflows/activities.py b/nmdc_runtime/api/v1/workflows/activities.py index 9da9dbd9..c9971c74 100644 --- a/nmdc_runtime/api/v1/workflows/activities.py +++ b/nmdc_runtime/api/v1/workflows/activities.py @@ -21,8 +21,8 @@ ) -# async def job_to_db(job_spec: dict[str, Any], mdb: AsyncIOMotorDatabase) -> None: -# return await mdb["jobs"].insert_one(job_spec) +async def job_to_db(job_spec: dict[str, Any], mdb: AsyncIOMotorDatabase) -> None: + return await mdb["jobs"].insert_one(job_spec) @router.post("", status_code=status.HTTP_201_CREATED) @@ -31,16 +31,17 @@ async def post_activity( site: Site = Depends(get_current_client_site), mdb: MongoDatabase = Depends(get_mongo_db), ) -> dict[str, str]: - """Post activity set to database and claim job. - - Parameters + """ + **NOTE: This endpoint is DEPRECATED. Please migrate to `~/workflows/activities`.** ---------- - activity_set : dict[str,Any] + The `v1/workflows/activities` endpoint will be removed in an upcoming release. + -- + Post activity set to database and claim job. + + Parameters: activity_set: dict[str,Any] Set of activities for specific workflows. - Returns - ------- - dict[str,str] + Returns: dict[str,str] """ _ = site # must be authenticated try: