Skip to content

Commit

Permalink
add deprecated notice to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
PeopleMakeCulture committed Feb 14, 2024
1 parent 896d6bd commit 3877c4c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
15 changes: 15 additions & 0 deletions nmdc_runtime/api/endpoints/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 10 additions & 9 deletions nmdc_runtime/api/v1/workflows/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 3877c4c

Please sign in to comment.