Skip to content

Commit

Permalink
Final PR comment requests. Align endpoint name to /datasets/<id>/prov…
Browse files Browse the repository at this point in the history
…-metadata. Prefix new files as dev_ until generally available for developers working on entity-api.
  • Loading branch information
kburke committed Jan 16, 2025
1 parent 476bce8 commit b16a7ca
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
49 changes: 25 additions & 24 deletions entity-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1330,29 +1330,6 @@ components:
description: "True of False depending on whether the Entity id is an instance of the type"

paths:
'/prov-metadata/{id}':
get:
summary: 'Returns full provenance metadata for a Dataset, which can be used when publishing the Dataset.'
parameters:
- name: id
in: path
description: The unique identifier of entity. This identifier can be either an HuBMAP ID (e.g. HBM123.ABCD.456) or UUID (32 digit hexadecimal number)
required: true
schema:
type: string
responses:
'200':
description: Full provenance information for the given dataset as JSON in the Response body.
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetProvMetadata'
'401':
description: The user's token has expired or the user did not supply a valid token
'403':
description: THe user is not authorized to use this method
'500':
description: Internal error
'/entities/{id}':
get:
summary: Retrieve a provenance entity by id. Entity types of Donor, Sample and Datasets.
Expand Down Expand Up @@ -1971,7 +1948,31 @@ paths:
description: The target entity could not be found
'500':
description: Internal error
'/datasets/{id}/latest-revision':
'/datasets/{id}/prov-metadata':
get:
summary: 'Returns full provenance metadata for a Dataset, which can be used when publishing the Dataset.'
parameters:
- name: id
in: path
description: The unique identifier of entity. This identifier can be either an HuBMAP ID (e.g. HBM123.ABCD.456) or UUID (32 digit hexadecimal number)
required: true
schema:
type: string
responses:
'200':
description: Full provenance information for the given dataset as JSON in the Response body.
content:
application/json:
schema:
$ref: '#/components/schemas/DatasetProvMetadata'
'401':
description: The user's token has expired or the user did not supply a valid token
'403':
description: THe user is not authorized to use this method
'500':
description:
Internal error
'/datasets/{id}/latest-revision':
get:
summary: 'Retrive the latest (newest) revision of a given Dataset. Public/Consortium access rules apply - if no token/consortium access then must be for a public dataset and the returned Dataset must be the latest public version. If the given dataset itself is the latest revision, meaning it has no next revisions, this dataset gets returned.'
parameters:
Expand Down
6 changes: 3 additions & 3 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
from schema.schema_constants import TriggerTypeEnum
from metadata_constraints import get_constraints, constraints_json_is_valid
# from lib.ontology import initialize_ubkg, init_ontology, Ontology, UbkgSDK
from entity_worker import EntityWorker
import entity_exceptions as entityEx
from dev_entity_worker import EntityWorker
import dev_entity_exceptions as entityEx

# HuBMAP commons
from hubmap_commons import string_helper
Expand Down Expand Up @@ -661,7 +661,7 @@ def _get_entity_visibility(normalized_entity_type, entity_dict):
json
Valid JSON for the full provenance metadata of the requested Dataset
'''
@app.route('/prov-metadata/<id>', methods = ['GET'])
@app.route('/datasets/<id>/prov-metadata', methods = ['GET'])
def get_provenance_metadata_by_id_for_auth_level(id:Annotated[str, 32]) -> str:

try:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/entity_worker.py → src/dev_entity_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from hubmap_commons.hm_auth import AuthHelper
from hubmap_commons.S3_worker import S3Worker

import entity_exceptions as entityEx
import dev_entity_exceptions as entityEx

COMMA_SEPARATOR = ','

Expand Down

0 comments on commit b16a7ca

Please sign in to comment.