Skip to content

Commit

Permalink
Merge pull request #288 from NASA-PDS/version150
Browse files Browse the repository at this point in the history
Updates for deployment of the API on he multitenant registry
  • Loading branch information
tloubrieu-jpl authored Oct 14, 2024
2 parents e62ecdd + 0b3bc48 commit 00ea9d5
Show file tree
Hide file tree
Showing 11 changed files with 1,117 additions and 95 deletions.
10 changes: 8 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
project = 'PDS APIs'
copyright = '2022 California Institute of Technology'
author = 'NASA Planetary Data System'
release = 'B14.0'
version = 'B14.0'
release = 'B15.0'
version = 'B15.0'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -73,6 +73,12 @@
redoc_uri = 'https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.js'

redoc = [
{
'name': 'PDS Search API',
'page': 'specifications/search-v1.5.0-redoc',
'spec': '../../specs/PDS_APIs-search-1.5.0-swagger.yaml',
'embed': True,
},
{
'name': 'PDS Search API',
'page': 'specifications/search-v1.4.0-redoc',
Expand Down
4 changes: 1 addition & 3 deletions docs/source/guides/search.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Search API User Guide
=====================

.. attention::
The PDS Search API (https://pds.nasa.gov/api/search/) will be down will be down for maintenance for 2-3 weeks beginning May 6, 2024 at 8am Pacific Time. Limited functionality will be released as it becomes available. Apologies for the inconvenience. Please contact the PDS Help Desk if you have any questions.

.. note::

The current guide is based on the PDS Search API version |search_user_guide_api_spec_version|
Expand All @@ -19,6 +16,7 @@ The PDS Search API provides endpoints:
* to **resolve** an identifier (lid or lidvid) and retrieve the product label and data where ever it is in the Planetary Data System.

For an introduction to the Search API and what it's capable of, checkout these slides and a presentation given at the 2022 PSIDA conference:

* Slides: https://www.cosmos.esa.int/documents/6109777/9316710/X03+-+Padams+-+NASA_Planetary_Data_System_Search_API.pdf
* Presentation Recording: https://www.cosmos.esa.int/web/psida-2022/-/x03

Expand Down
15 changes: 8 additions & 7 deletions docs/source/guides/search/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Search for the 10 latest collections which processing level is "Raw":
:caption: curl command
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'limit=10' \
--data-urlencode 'q=(pds:Primary_Result_Summary.pds:processing_level eq "Raw")'
Expand All @@ -84,7 +84,7 @@ Search for all Observational Products targeting Bennu:
:caption: curl command
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'q=(ref_lid_target eq "urn:nasa:pds:context:target:asteroid.101955_bennu")'
Expand All @@ -97,7 +97,7 @@ Search all products which are referring to a given LID:
:caption: curl command
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'limit=200' \
--data-urlencode 'q=((pds:Internal_Reference.pds:lid_reference eq "urn:nasa:pds:context:investigation:mission.orex") or (pds:Internal_Reference.pds:lid_reference like "urn:nasa:pds:context:investigation:mission.orex::*"))' | json_pp
Expand Down Expand Up @@ -133,7 +133,7 @@ Run the following request to get the DOI associated with the collection the obse
:caption: curl command
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:vg1-saturn-pos-hgcoords-96sec:data-spice:spice-hg::1.0/member-of' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:vg1-saturn-pos-hgcoords-96sec:data-spice:spice-hg::1.0/member-of' \
--data-urlencode 'fields=pds:Citation_Information.pds:doi' \
--header 'Accept: application/kvp+json'
Expand Down Expand Up @@ -171,7 +171,7 @@ To get the DOI associated with the bundle the observational product `urn:nasa:pd
:caption: curl command
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight.spice:document:spiceds::1.0/member-of/member-of' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight.spice:document:spiceds::1.0/member-of/member-of' \
--data-urlencode 'fields=pds:Citation_Information/pds:doi' \
--header 'Accept: application/kvp+json'
Expand Down Expand Up @@ -210,7 +210,7 @@ To get the PDS product metadata associated with a the DOI `10.17189/1517568`:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'q=(pds:Citation_Information.pds:doi eq "10.17189/1522962")' \
--header 'Accept: application/json'
Expand All @@ -228,6 +228,7 @@ Here is one of the XML files, rendered: https://search-pdsppi.igpp.ucla.edu/ditd
To build this query, we can search by the instrument and time range:

.. code-block:: bash
((pds:Time_Coordinates.pds:start_date_time ge "1979-03-01T00:00:00.000Z") and
(pds:Time_Coordinates.pds:start_date_time lt "1979-04-01T00:00:00.000Z") and
(ref_lid_instrument eq "urn:nasa:pds:context:instrument:vg1.pws"))
Expand All @@ -237,7 +238,7 @@ Do query that using curl, it would look like this:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'q=((pds:Time_Coordinates.pds:start_date_time ge "1979-03-01T00:00:00.000Z") and ' \
--data-urlencode '(pds:Time_Coordinates.pds:start_date_time lt "1979-04-01T00:00:00.000Z") and ' \
--data-urlencode '(ref_lid_instrument eq "urn:nasa:pds:context:instrument:vg1.pws"))' \
Expand Down
84 changes: 15 additions & 69 deletions docs/source/guides/search/endpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,6 @@ The **base URL** of the PDS Search API, for search across all the PDS nodes, is:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/
For specific discipline node search, there are node-specific endpoints available giving access to products of one node, for example:

.. code-block::
:substitutions:
https://pds.nasa.gov/api/search-geo/|search_user_guide_api_version|/
Where ``geo`` is the **Node ID**

The **Node IDs** are:

============= ========================================
Node ID Node Name
============= ========================================
atm Atmospheres
en Engineering
geo Geosciences
img Imaging
naif Navigation and Ancillary Information
ppi Planetary Plasma Interactions
psa ESA Planetary Science Archive
rms Ring-Moon Systems
sbnumd Small Bodies, Comets
sbnpsi Small Bodies, Asteroids/Dust
============= ========================================

The main use cases, to search, crawl products or resolve a product identifier are given in the following sections.

Search Products
Expand All @@ -58,15 +32,15 @@ Get the list of properties which describe the products, which criteria you can s
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/properties'
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/properties'
Search for products which processing level is "Raw", using the property "pds:Primary_Result_Summary.pds:processing_level" found before, get 10 results:

.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products' \
--data-urlencode 'limit=10' \
--data-urlencode 'q=(pds:Primary_Result_Summary.pds:processing_level eq "Raw")'
Expand All @@ -84,17 +58,7 @@ The requests template is a follow:
GET /api/search/|search_user_guide_api_version|/classes/{product_class}[?[{query-parameter}={query-parameter-value}]*] HTTP/1.1
Host: pds.nasa.gov
Where `product_class` is one of the following classes:

- bundles
- collections
- observationals
- documents
- any

The concept of product class is derived from the `PDS4 standard <https://pds.nasa.gov/datastandards/documents/im/current/index_1I00.html>`_.

The list of classes proposed by the API can also be found from URL:
The list of `product_class` proposed by the API can also be found from URL:

.. code-block::
:substitutions:
Expand All @@ -103,6 +67,9 @@ The list of classes proposed by the API can also be found from URL:
The concept of product class is derived from the `PDS4 standard <https://pds.nasa.gov/datastandards/documents/im/current/index_1I00.html>`_.


Query Detailed Syntax
~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -289,27 +256,6 @@ The request:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/{lid}
is equivalent to:

.. code-block:: bash
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/{lid}/latest
All Versions
..............

If you want to retrieve **all** the versions of a product, the request is:

.. code-block:: bash
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/{lid}/all
The `all` and `latest` suffixes apply also to all the crawling end-points which description follows.

Crawl a Data Set Hierarchy
--------------------------
Expand All @@ -324,7 +270,7 @@ Get its **children** (collections):
.. code-block::
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/members[/[all|latest]]
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/members
For example, run:

Expand All @@ -343,15 +289,15 @@ Get the Observational Products of a Bundle
.. code-block::
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/members/members[/[all|latest]]
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/members/members
For example, run:

.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1/members/members' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1/members/members' \
--header 'Accept: application/json'
Expand All @@ -363,7 +309,7 @@ Get its **parent** (collection):
.. code-block::
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/member-of[/[all|latest]]
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/member-of
The same request can be used to get the bundles of a collection from the collection's lidvid.

Expand All @@ -372,15 +318,15 @@ Get its **grandparent** (bundle):
.. code-block::
:substitutions:
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/member-of/member-of[/[all|latest]]
https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/lidvid1/member-of/member-of
For example, run:

.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad:data_raw:hp3_rad_raw_00004_20181130_085325/member-of/member-of' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad:data_raw:hp3_rad_raw_00004_20181130_085325/member-of/member-of' \
--header 'Accept: application/json'
Expand Down Expand Up @@ -410,7 +356,7 @@ Sort the results by the harvest time, which is the time when products were loade
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
--header 'Accept: application/json'
--data-urlencode 'sort=ops:Harvest_Info.ops:harvest_date_time'
Expand All @@ -432,7 +378,7 @@ Use this latest harvest date and time as the reference for the next request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
--header 'Accept: application/json'
--data-urlencode 'sort=ops:Harvest_Info.ops:harvest_date_time'
--data-urlencode 'search-after=2023-05-26T05:53:24.611495Z'
Expand All @@ -449,7 +395,7 @@ You can adjust the default limit of 100 products per page using the limit parame
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:orex.ovirs:data_calibrated::11.0/members'
--header 'Accept: application/json'
--data-urlencode 'limit=500'
--data-urlencode 'sort=ops:Harvest_Info.ops:harvest_date_time'
Expand Down
4 changes: 2 additions & 2 deletions docs/source/guides/search/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Search With curl
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=5' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=5' \
--header 'Accept: application/json'
3. Get 5 products' metadata from the API in XML format:

.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=5' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=5' \
--header 'Accept: application/xml'
Expand Down
13 changes: 7 additions & 6 deletions docs/source/guides/search/responses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ types:

``application/vnd.nasa.pds.pds4+json`` and ``application/vnd.nasa.pds.pds4+xml`` have been chosen to comply with `RFC6838 <https://datatracker.ietf.org/doc/html/rfc6838>`_


Examples
+++++++++

Expand All @@ -68,7 +69,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
--header 'Accept: application/json'
Returns
Expand Down Expand Up @@ -135,7 +136,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
--header 'Accept: application/xml'
Returns:
Expand Down Expand Up @@ -208,7 +209,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
--header 'Accept: application/vnd.nasa.pds.pds4+json'
Expand Down Expand Up @@ -291,7 +292,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products/urn:nasa:pds:insight_rad::2.1' \
--header 'Accept: application/vnd.nasa.pds.pds4+xml'
Expand Down Expand Up @@ -371,7 +372,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=10&fields=lidvid&fields=title' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=10&fields=lidvid&fields=title' \
--header 'Accept: application/kvp+json'
Returns:
Expand Down Expand Up @@ -417,7 +418,7 @@ The request:
.. code-block:: bash
:substitutions:
curl --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=10&fields=lidvid&fields=title' \
curl -L --get 'https://pds.nasa.gov/api/search/|search_user_guide_api_version|/products?limit=10&fields=lidvid&fields=title' \
--header 'Accept: text/csv'
Returns:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/guides/search/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ When developing a web client to the API, if you are not from JPL, contact us (pd

If you are on JPL's network, develop your application locally on port 80 on your laptop connected to the VPN and test your application with URL http://localhost.jpl.nasa.gov/....

TO BE COMPLETED
An example implementation of an HTML/Javascript client of the API can be found in the github repository https://github.com/NASA-PDS/gis-web-client .


Search Examples
Expand Down
Loading

0 comments on commit 00ea9d5

Please sign in to comment.