Skip to content

Commit

Permalink
[A] Remove portal registration API (#6782, PR #6802)
Browse files Browse the repository at this point in the history
  • Loading branch information
achave11-ucsc committed Jan 7, 2025
2 parents c7e5c0e + 51b2e88 commit 34d7ce4
Show file tree
Hide file tree
Showing 19 changed files with 5 additions and 580 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 1 addition & 40 deletions lambdas/service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
from azul.plugins.metadata.hca.indexer.transform import (
value_and_unit,
)
from azul.portal_service import (
PortalService,
)
from azul.service import (
FileUrlFunc,
)
Expand Down Expand Up @@ -231,7 +228,7 @@
# changes and reset the minor version to zero. Otherwise, increment only
# the minor version for backwards compatible changes. A backwards
# compatible change is one that does not require updates to clients.
'version': '9.3'
'version': '10.0'
},
'tags': [
{
Expand Down Expand Up @@ -757,42 +754,6 @@ def fmt_error(err_description, params):
}


@app.route(
'/integrations',
methods=['GET'],
cors=True,
method_spec=deprecated_method_spec
)
def get_integrations():
query_params = app.current_request.query_params or {}
validate_params(query_params,
entity_type=Mandatory(str),
integration_type=Mandatory(str),
entity_ids=str)
try:
entity_ids = query_params['entity_ids']
except KeyError:
# Case where parameter is absent (do not filter using entity_id field)
entity_ids = None
else:
if entity_ids:
# Case where parameter is present and non-empty (filter for matching id value)
entity_ids = {entity_id.strip() for entity_id in entity_ids.split(',')}
else:
# Case where parameter is present but empty (filter for missing entity_id field,
# i.e., there are no acceptable id values)
entity_ids = set()

entity_type = query_params['entity_type']
integration_type = query_params['integration_type']

portal_service = PortalService()
body = portal_service.list_integrations(entity_type, integration_type, entity_ids)
return Response(status_code=200,
headers={'content-type': 'application/json'},
body=json.dumps(body))


@app.route(
'/index/catalogs',
methods=['GET'],
Expand Down
20 changes: 1 addition & 19 deletions lambdas/service/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "azul-service-dev",
"description": "\n# Overview\n\nAzul is a REST web service for querying metadata associated with\nboth experimental and analysis data from a data repository. In order\nto deliver response times that make it suitable for interactive use\ncases, the set of metadata properties that it exposes for sorting,\nfiltering, and aggregation is limited. Azul provides a uniform view\nof the metadata over a range of diverse schemas, effectively\nshielding clients from changes in the schemas as they occur over\ntime. It does so, however, at the expense of detail in the set of\nmetadata properties it exposes and in the accuracy with which it\naggregates them.\n\nAzul denormalizes and aggregates metadata into several different\nindices for selected entity types. Metadata entities can be queried\nusing the [Index](#operations-tag-Index) endpoints.\n\nA set of indices forms a catalog. There is a default catalog called\n`dcp2` which will be used unless a\ndifferent catalog name is specified using the `catalog` query\nparameter. Metadata from different catalogs is completely\nindependent: a response obtained by querying one catalog does not\nnecessarily correlate to a response obtained by querying another\none. Two catalogs can contain metadata from the same sources or\ndifferent sources. It is only guaranteed that the body of a\nresponse by any given endpoint adheres to one schema,\nindependently of which catalog was specified in the request.\n\nAzul provides the ability to download data and metadata via the\n[Manifests](#operations-tag-Manifests) endpoints. The\n`curl` format manifests can be used to\ndownload data files. Other formats provide various views of the\nmetadata. Manifests can be generated for a selection of files using\nfilters. These filters are interchangeable with the filters used by\nthe [Index](#operations-tag-Index) endpoints.\n\nAzul also provides a [summary](#operations-Index-get_index_summary)\nview of indexed data.\n\n## Data model\n\nAny index, when queried, returns a JSON array of hits. Each hit\nrepresents a metadata entity. Nested in each hit is a summary of the\nproperties of entities associated with the hit. An entity is\nassociated either by a direct edge in the original metadata graph,\nor indirectly as a series of edges. The nested properties are\ngrouped by the type of the associated entity. The properties of all\ndata files associated with a particular sample, for example, are\nlisted under `hits[*].files` in a `/index/samples` response. It is\nimportant to note that while each _hit_ represents a discrete\nentity, the properties nested within that hit are the result of an\naggregation over potentially many associated entities.\n\nTo illustrate this, consider a data file that is part of two\nprojects (a project is a group of related experiments, typically by\none laboratory, institution or consortium). Querying the `files`\nindex for this file yields a hit looking something like:\n\n```\n{\n \"projects\": [\n {\n \"projectTitle\": \"Project One\"\n \"laboratory\": ...,\n ...\n },\n {\n \"projectTitle\": \"Project Two\"\n \"laboratory\": ...,\n ...\n }\n ],\n \"files\": [\n {\n \"format\": \"pdf\",\n \"name\": \"Team description.pdf\",\n ...\n }\n ]\n}\n```\n\nThis example hit contains two kinds of nested entities (a hit in an\nactual Azul response will contain more): There are the two projects\nentities, and the file itself. These nested entities contain\nselected metadata properties extracted in a consistent way. This\nmakes filtering and sorting simple.\n\nAlso notice that there is only one file. When querying a particular\nindex, the corresponding entity will always be a singleton like\nthis.\n",
"version": "9.3"
"version": "10.0"
},
"tags": [
{
Expand All @@ -21,10 +21,6 @@
{
"name": "Auxiliary",
"description": "\nDescribes various aspects of the Azul service\n"
},
{
"name": "Deprecated",
"description": "\nEndpoints that should not be used and that will be removed\n"
}
],
"paths": {
Expand Down Expand Up @@ -765,20 +761,6 @@
}
}
},
"/integrations": {
"get": {
"summary": "This endpoint will be removed in the future.",
"tags": [
"Deprecated"
],
"deprecated": true,
"responses": {
"504": {
"description": "\nRequest timed out. When handling this response, clients\nshould wait the number of seconds specified in the\n`Retry-After` header and then retry the request.\n"
}
}
}
},
"/index/catalogs": {
"get": {
"summary": "List all available catalogs.",
Expand Down
3 changes: 0 additions & 3 deletions src/azul/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,9 +1462,6 @@ def github_access_token(self) -> str:
def gitlab_access_token(self) -> Optional[str]:
return self.environ.get('azul_gitlab_access_token')

def portal_db_object_key(self, catalog_source: str) -> str:
return f'azul/{self.deployment_stage}/portals/{catalog_source}-db.json'

@property
def lambda_layer_key(self) -> str:
return 'lambda_layers'
Expand Down
8 changes: 0 additions & 8 deletions src/azul/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
)
from azul.types import (
JSON,
JSONs,
MutableJSON,
get_generic_type_params,
)
Expand Down Expand Up @@ -686,13 +685,6 @@ def fetch_bundle(self, bundle_fqid: BUNDLE_FQID) -> BUNDLE:
"""
raise NotImplementedError

@abstractmethod
def portal_db(self) -> JSONs:
"""
Returns integrations data object
"""
raise NotImplementedError

@abstractmethod
def drs_client(self,
authentication: Authentication | None = None
Expand Down
4 changes: 0 additions & 4 deletions src/azul/plugins/repository/canned/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import time
from typing import (
AbstractSet,
Sequence,
)

from furl import (
Expand Down Expand Up @@ -200,9 +199,6 @@ def fetch_bundle(self, bundle_fqid: CannedBundleFQID) -> CannedBundle:
time.time() - now, bundle.uuid, bundle.version)
return bundle

def portal_db(self) -> Sequence[JSON]:
return []

def _construct_file_url(self, url: furl, file_name: str) -> furl:
"""
>>> plugin = Plugin(_sources=set())
Expand Down
Loading

0 comments on commit 34d7ce4

Please sign in to comment.