Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As an API user, I want to know the Collection(s) for a given Product. #451

Closed
2 tasks done
jordanpadams opened this issue Mar 26, 2021 · 1 comment
Closed
2 tasks done
Assignees
Labels
B12.0 p.must-have requirement the current issue is a requirement

Comments

@jordanpadams
Copy link
Member

jordanpadams commented Mar 26, 2021

For more information on how to populate this new feature request, see the PDS Wiki on User Story Development:

https://github.com/NASA-PDS/nasa-pds.github.io/wiki/Issue-Tracking#user-story-development

Motivation

...so that I can know all collections a product is referenced by

Additional Details

Notional API Design:

GET /products/{lidvid}/collections

See NASA-PDS/registry#109 and NASA-PDS/registry#108 for how the registry ingests primary and secondary products.

Acceptance Criteria

Given I have a product LID OR LIDVID
When I perform an API query by that LIDVID for its collections
Then I expect the API to return the primary collection (there should be only 1) AND any secondary collections (could be many) the product belongs to

Sub-tasks

  • Update Swagger API
  • Implement in API Server

NOTE: This is now done by /products/{identifier}/member-of

@jordanpadams jordanpadams added requirement the current issue is a requirement needs:triage labels Mar 26, 2021
@jordanpadams jordanpadams self-assigned this Mar 26, 2021
@jordanpadams jordanpadams changed the title As a user, I want to know the Collection for a given Product. As an API user, I want to know the Collection for a given Product. Mar 26, 2021
@jordanpadams jordanpadams changed the title As an API user, I want to know the Collection for a given Product. As an API user, I want to know the Collection(s) for a given Product. Mar 26, 2021
@tloubrieu-jpl
Copy link
Member

@al-niessner I have just tested this elasticsearch request to get the collection lidvid of a product:
{
"query": {
"match": {
"product_lidvid": "urn:nasa:pds:izenberg_pdart14_meap:data_eetable:ele_evt_12hr_orbit_2011-2012::1.0"
}
},
"size": 0,
"aggs": {
"collection_lidvid": {
"terms": {
"field": "collection_lidvid"
}
}
}
}

The curl command is:
curl --location --request GET 'http://localhost:9200/registry-refs/_search'
--header 'Content-Type: application/json'
--data-raw '{
"query": {
"match": {
"product_lidvid": "urn:nasa:pds:izenberg_pdart14_meap:data_eetable:ele_evt_12hr_orbit_2011-2012::1.0"
}
},
"size": 0,
"aggs": {
"collection_lidvid": {
"terms": {
"field": "collection_lidvid"
}
}
}
}'

@tdddblog also showed interesting requests earlier to get the latest lidvid from a lid directly from elasticsearch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B12.0 p.must-have requirement the current issue is a requirement
Projects
None yet
Development

No branches or pull requests

4 participants