Skip to content

Commit 4f5676c

Browse files
committed
CMR-11239: Successfully implemented Astro/Starlight and generated a basic documentation site (total setup time ~= 1 hour)
1 parent c87a15f commit 4f5676c

9 files changed

Lines changed: 522 additions & 528 deletions

File tree

search-app/docs/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import starlight from "@astrojs/starlight";
55
// https://astro.build/config
66
export default defineConfig({
77
integrations: [starlight({
8-
title: 'Table of Contents'
8+
title: 'CMR API Documentation'
99
})]
1010
});

search-app/docs/src/content/docs/requests.md renamed to search-app/docs/src/content/docs/1-requests.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ title: Requests
33
description: Provides foundational request information for the CMR API.
44
---
55

6-
### <a name="general-request-details"></a> General Request Details
6+
## <a name="general-request-details"></a> General Request Details
77

8-
#### <a name="maximum-url-length"></a> Maximum URL Length
8+
### <a name="maximum-url-length"></a> Maximum URL Length
99

1010
The Maximum URL Length supported by CMR is indirectly controlled by the Request Header Size setting in Jetty which is set to 1MB. This translates to roughly 500k characters, however it is recommended that any GET request be limited to 6,000 characters, and in a web browser the recommended length is no longer than 2000 characters. Clients using the Search API with query parameters should be careful not to exceed this limit or they will get an HTTP response of 413 FULL HEAD. If a client expects that the query url could be extra long so that it exceeds 6k characters, they should use the POST API for searching.
1111

12-
#### <a name="cors-header-support"></a> CORS Header support
12+
### <a name="cors-header-support"></a> CORS Header support
1313

1414
The CORS headers are supported on search endpoints. Check [CORS Documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) for an explanation of CORS headers. Custom CORS request headers supported are Authorization, Client-Id, CMR-Request-Id, X-Request-Id, CMR-Scroll-Id (**deprecated**) and CMR-Search-After. Custom response headers supported are CMR-Hits, CMR-Request-Id, X-Request-Id, CMR-Scroll-Id (**deprecated**), CMR-Search-After, CMR-Timed-Out, CMR-Shapefile-Original-Point-Count and CMR-Shapefile-Simplified-Point-Count.
1515

16-
#### <a name="query-parameters"></a> Query Parameters
16+
### <a name="query-parameters"></a> Query Parameters
1717

1818
* `page_size` - Number of results per page - default is 10, max is 2000.
1919
* `page_num` - The page number to return. (**deprecated**)
@@ -24,7 +24,7 @@ The CORS headers are supported on search endpoints. Check [CORS Documentation](h
2424
* `token` - Specifies a user token from EDL or Launchpad for use as authentication. Using the standard [Authorization header](#headers) is the prefered way to supply a token. This parameter may be deprecated in the future.
2525
* `echo_compatible` - When set to true results will be returned in an ECHO compatible format. This mostly removes fields and features specific to the CMR such as revision id, granule counts and facets in collection results. Metadata format style results will also use ECHO style names for concept ids such as `echo_granule_id` and `echo_dataset_id`.
2626

27-
#### <a name="paging-details"></a> Paging Details
27+
### <a name="paging-details"></a> Paging Details
2828

2929
__NOTE:__ Deep paging is being deprecated in favor of [Search After](#search-after). Please switch your scroll based queries to [Search After](#search-after) which is more efficient and easier to use.
3030

@@ -38,7 +38,7 @@ __Note__: In the event which an ingest or delete occurs between paging requests,
3838

3939
You can not page past the 1 millionth item. Please contact the CMR Team at cmr-support@nasa.gov if you need to retrieve items in excess of 1 million from the CMR. Additionally granule queries which do not target a set of collections are limited to paging up to the 10,000th item.
4040

41-
#### <a name="search-after"></a> Search After
41+
### <a name="search-after"></a> Search After
4242

4343
__NOTE__: This is currently the prefered way to request large sets of records.
4444

@@ -79,7 +79,7 @@ curl -i -H 'CMR-Search-After: ["xyz", 789, 999]' "%CMR-ENDPOINT%/granules?concep
7979
```
8080
There will be only 8 granules in the result set. We can deem the search has reached the end because the number of results returned is less than the page_size, but if we search again with the new `CMR-Search-After` header value returned, we will get an empty result set and there won't be a `CMR-Search-After` header in the response.
8181

82-
#### <a name="scrolling-details"></a> Scrolling Details
82+
### <a name="scrolling-details"></a> Scrolling Details
8383

8484
__IMPORTANT:__ Scrolling is deprecated and will be disabled in the future. When disabled, requests using CMR-Scroll-Id or scroll parameter will return HTTP 400 errors with instructions to migrate to [Search After](#search-after). Please migrate your applications to use the Search After pattern instead, which is more efficient and easier to use.
8585

@@ -93,7 +93,7 @@ When all the results have been returned subsequent calls using the same `CMR-Scr
9393

9494
Important note: Clients using scrolling (especially via programmatic API or scripts) should explicitly invoke [`clear scroll session`] (#clear-scroll) to release the scroll session when they are finished. This will end the scroll session and free up system resources.
9595

96-
#### <a name="parameter-options"></a> Parameter Options
96+
### <a name="parameter-options"></a> Parameter Options
9797

9898
The behavior of search with respect to each parameter can be modified using the `options` parameter. The `options` parameter takes the following form:
9999

@@ -106,7 +106,7 @@ where parameter is the URL parameter whose behavior is to be affected, value is
106106
* `and` - if set to true and if multiple values are listed for the param, the concepts must have ALL of these values in order to match. The default is `false` which means concepts with ANY of the values match. This option only applies to fields which may be multi-valued; these are documented here.
107107
* `or` - this option only applies to granule attributes or science-keywords searches. If set to true, the collection/granule will match when any of the grouped search condition is matched. The default is false.
108108

109-
##### <a name="collection-result-features"></a> Collection Result Feature Parameters
109+
#### <a name="collection-result-features"></a> Collection Result Feature Parameters
110110

111111
These are query parameters that control what extra data is included with collection search results. They do not impact which collections are matched but can add additional data to the search results like facets, granule counts, and tags.
112112

@@ -124,9 +124,9 @@ These are query parameters that control what extra data is included with collect
124124
_The `include_highlights` feature is only supported for the JSON response format and only applies to keyword searches._
125125

126126

127-
#### <a name="headers"></a> HTTP Headers
127+
### <a name="headers"></a> HTTP Headers
128128

129-
##### Request Headers
129+
#### Request Headers
130130
`Accept` - specifies the MimeType to return search results in. Default is "application/xml".
131131

132132
`curl -H "Accept: application/xml" -i "%CMR-ENDPOINT%/collections"`
@@ -147,7 +147,7 @@ These are query parameters that control what extra data is included with collect
147147

148148
`CMR-Request-Id` - This header serves the same purpose as `X-Request-Id` header. It is kept to support legacy systems.
149149

150-
##### The response headers
150+
#### The response headers
151151

152152
* `CMR-Hits` and `CMR-Took` indicate the number of result hits and the time to build and execute the query, respectively.
153153
* `CMR-Request-Id` and `X-Request-Id` return the same value - the value passed in through `CMR-Request-Id` request header or `X-Request-Id` request header or a unique id generated for the client request when no value is passed in, This can be used to help debug client errors.
@@ -156,7 +156,7 @@ These are query parameters that control what extra data is included with collect
156156
* `content-md5` returns the MD5 hash of the content.
157157
* `content-sha1` returns the SHA1 hash value for the content.
158158

159-
#### <a name="extensions"></a> Extensions
159+
### <a name="extensions"></a> Extensions
160160

161161
Besides MimeTypes, client can also use extensions to specify the format for search results. Default is xml.
162162

@@ -189,13 +189,13 @@ Here is a list of supported extensions and their corresponding MimeTypes:
189189

190190
__NOTE__: As of version "%CMR-RELEASE-VERSION%", the latest UMM Collection version is `%COLLECTION-UMM-VERSION%`.
191191

192-
#### <a name="request-timeouts"></a> Request Timeouts
192+
### <a name="request-timeouts"></a> Request Timeouts
193193

194194
The CMR operating environment imposes a hard limit of 180 seconds on any request, after which a 504 error is
195195
returned. To avoid this, the CMR has an internal query timeout of 170 seconds - any query taking longer will time
196196
out and a subset of the total hit results will be returned instead of an error. The response for queries that time
197197
out will include the `CMR-Time-Out` header set to `true`.
198198

199-
#### <a name="request-moderation"></a> Moderating Client Request Traffic
199+
### <a name="request-moderation"></a> Moderating Client Request Traffic
200200

201201
In order to provide robust availability and performance for all clients of the service, CMR Search deploys a set of rate throttling rules for request traffic. These rules are defined to target specific request signatures, throttling the allowed rate of these searches in an effort to prevent overall degradation of system performance and availability. If a client request should exceed one of these rate throttling rules, the request will be rejected and a `429` error status returned to the client along with a `retry-after` header value. The suggested practice for any CMR Search client is to honor the `retry-after` header value and delay accordingly before re-issuing the failed request and continuing with its CMR Search processing.

search-app/docs/src/content/docs/searching.md renamed to search-app/docs/src/content/docs/2-searching.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ title: Searching
33
description: Provides information on general methods of searching with the CMR API, as well as the formats that will be used for search results.
44
---
55

6-
### <a name="search-with-post"></a> Search with POST
6+
## <a name="search-with-post"></a> Search with POST
77

88
Search collections or granules with query parameters encoded form in POST request body.
99

1010
curl -i -XPOST %CMR-ENDPOINT%/collections -d "dataset_id[]=Example%20DatasetId&dataset_id[]=Dataset2"
1111

12-
### <a name="search-with-json-query"></a> Search with JSON Query
12+
## <a name="search-with-json-query"></a> Search with JSON Query
1313

1414
Search for collections or granules with JSON in a POST request body. The JSON must conform to the schema
1515
that is defined in `%CMR-ENDPOINT%/site/CollectionJSONQueryLanguage.json` or `%CMR-ENDPOINT%/site/GranuleJSONQueryLanguage.json`
@@ -29,7 +29,7 @@ for collections and granules respectively. Only collection and granule search ar
2929
{ "bounding_box": [-45,15,0,25],
3030
"short_name": "Short_name 1"}]}}'
3131

32-
### <a name="search-with-aql"></a> Search with AQL
32+
## <a name="search-with-aql"></a> Search with AQL
3333

3434
Search collections or granules with AQL in POST request body. The AQL must conform to the schema
3535
that is defined in `%CMR-ENDPOINT%/site/IIMSAQLQueryLanguage.xsd`.
@@ -38,7 +38,7 @@ that is defined in `%CMR-ENDPOINT%/site/IIMSAQLQueryLanguage.xsd`.
3838
<query><for value="collections"/><dataCenterId><all/></dataCenterId>
3939
<where><collectionCondition><shortName><value>S1</value></shortName></collectionCondition></where></query>'
4040

41-
### <a name="temporal-range-searches"></a> Temporal Range searches
41+
## <a name="temporal-range-searches"></a> Temporal Range searches
4242

4343
A couple of parameters used in search expect a date range as input. For example, the parameter "temporal" used in collection and granule searches and the parameter "equator_crossing_longitude" used in granule searches both accept date ranges. All these parameters expect temporal ranges in the same format. The temporal ranges can be specified as a pair of date-time values separated by comma(,). Exactly one of the two bounds of the interval can be omitted. In addition to comma separated values, one can also specify temporal ranges as [ISO 8601 time intervals](https://en.wikipedia.org/?title=ISO_8601#Time_intervals). Some examples of valid temporal range values are:
4444

@@ -54,7 +54,7 @@ A couple of parameters used in search expect a date range as input. For example,
5454

5555
__Note__: ISO 8601 does not allow open-ended time intervals but the CMR API does allow specification of intervals which are open ended on one side. For example, `2000-01-01T10:00:00Z/` and `/2000-01-01T10:00:00Z` are valid ranges.
5656

57-
### <a name="search-for-tiles"></a> Search for Tiles
57+
## <a name="search-for-tiles"></a> Search for Tiles
5858

5959
Tiles are geographic regions formed by splitting the world into rectangular regions in a projected coordinate system such as Sinusoidal Projection based off an Authalic Sphere. CMR supports searching of tiles which fall within a geographic region defined by a given input geometry. Currently, only tiles in MODIS Integerized Sinusoidal Grid(click [here](https://lpdaac.usgs.gov/products/modis_products_table/modis_overview) for more details on the grid) can be searched. The input geometry could be either a minimum bounding rectangle or one of point, line or polygon in spherical coordinates. The input coordinates are to be supplied in the same format as in granule and collection spatial searches (See under "Find granules by Spatial").
6060

@@ -79,7 +79,7 @@ Find all the tiles which a line intersects.
7979

8080
The output of these requests is a list of tuples containing tile coordinates, e.g: [[16,8],[16,9],[17,8],[17,9]], in the JSON format. The first value in each tuple is the horizontal grid coordinate(h), i.e. along east-west and the second value is the vertical grid coordinate(v), i.e. along north-south.
8181

82-
### <a name="retrieve-controlled-keywords"></a> Retrieve Controlled Keywords
82+
## <a name="retrieve-controlled-keywords"></a> Retrieve Controlled Keywords
8383

8484
The keyword endpoint is used to retrieve the full list of keywords for each of the controlled vocabulary fields. The controlled vocabulary is cached within CMR, but the actual source is the GCMD Keyword Management System (KMS). Users of this endpoint are interested in knowing what the CMR considers as the current controlled vocabulary, since it is the cached CMR values that will eventually be enforced on CMR ingest.
8585

@@ -171,9 +171,9 @@ Note: Search parameter filtering are not supported - requests are rejected when
171171
}
172172
```
173173

174-
### <a name="supported-result-formats"></a> Supported Result Formats
174+
## <a name="supported-result-formats"></a> Supported Result Formats
175175

176-
#### <a name="html"></a> HTML
176+
### <a name="html"></a> HTML
177177

178178
The HTML response format is intended to be used only in a web browser to view a single collection record. The collection html representation can be viewed by putting the following in the web browser address bar.
179179

@@ -186,7 +186,7 @@ For private collection, an EDL bearer token or a Launchpad token can be used to
186186
%CMR-ENDPOINT%/concepts/<concept-id>?token=EDL-xxxxxx
187187
```
188188

189-
#### <a name="atom"></a> Atom XML
189+
### <a name="atom"></a> Atom XML
190190

191191
See the [Atom specification](http://tools.ietf.org/html/rfc4287) for a full description of Atom.
192192

@@ -301,7 +301,7 @@ __Example__
301301
</feed>
302302
```
303303

304-
#### <a name="csv"></a> CSV
304+
### <a name="csv"></a> CSV
305305

306306
The comma separated value (CSV) format is supported for collections and granules.
307307
Version and Processing Level are strings. When importing into the spreadsheet, please specify text as their column types. This will prevent version "004" to be displayed as "4" in the spreadsheet.
@@ -321,7 +321,7 @@ Granule UR,Producer Granule ID,Start Time,End Time,Online Access URLs,Browse URL
321321
SC:SPL1AA.001:12345,SMAP_L1C_S0_HIRES_00016_A_20150530T160100_R03001_001.h5,,,,,,,
322322
```
323323

324-
#### Metadata Responses (DIF, DIF 10, ECHO 10, ISO-SMAP, ISO-MENDS)
324+
### Metadata Responses (DIF, DIF 10, ECHO 10, ISO-SMAP, ISO-MENDS)
325325

326326
All of the XML Metadata formats (except the XML used in returning references only) have the same structure, differing only in the way each result is returned. These formats return a single XML document with a `<results>` XML element containing the following fields as sub-elements:
327327

@@ -339,7 +339,7 @@ The results are returned as a sequence of `<result>` XML elements, the contents
339339
| format | the mime-type for the returned metadata |
340340
| revision-id | the CMR revision number of the stored concept |
341341

342-
#### <a name="dif-9"></a> DIF 9
342+
### <a name="dif-9"></a> DIF 9
343343

344344
__NOTE:__ The DIF 9 format is being __deprecated__ in favor of DIF 10. While it is still supported, we strongly discourage its use for new metadata.
345345

@@ -386,7 +386,7 @@ __Example__
386386
</results>
387387
```
388388

389-
#### <a name="dif-10"></a> DIF 10
389+
### <a name="dif-10"></a> DIF 10
390390

391391
See the [specification](https://cdn.earthdata.nasa.gov/dif/10.x/) for details.
392392

@@ -454,7 +454,7 @@ __Example__
454454
</results>
455455
```
456456

457-
#### <a name="echo-10"></a> ECHO 10
457+
### <a name="echo-10"></a> ECHO 10
458458

459459
See the [specification](https://cdn.earthdata.nasa.gov/echo/schemas/10.0/) for details.
460460

@@ -492,7 +492,7 @@ __Example__
492492
</results>
493493
```
494494

495-
#### <a name="iso-mends"></a> ISO-MENDS (ISO-19115-2)
495+
### <a name="iso-mends"></a> ISO-MENDS (ISO-19115-2)
496496

497497
See the [specification](https://cdn.earthdata.nasa.gov/iso/)
498498

@@ -591,7 +591,7 @@ __Example__
591591
</results>
592592
```
593593

594-
#### <a name="iso-smap"></a> ISO-SMAP
594+
### <a name="iso-smap"></a> ISO-SMAP
595595

596596
See the [specification](https://cdn.earthdata.nasa.gov/iso/)
597597

@@ -677,7 +677,7 @@ __Example__
677677
</results>
678678
```
679679

680-
#### <a name="json"></a> ATOM JSON
680+
### <a name="json"></a> ATOM JSON
681681

682682
The JSON response contains all the fields in the *ATOM* response, plus the the following fields:
683683

@@ -770,7 +770,7 @@ __Example__
770770
}
771771
```
772772

773-
#### <a name="umm-json"></a> UMM JSON
773+
### <a name="umm-json"></a> UMM JSON
774774

775775
The UMM JSON response, unlike ATOM JSON, contains "meta-metadata" of the collection and the UMM fields. The UMM JSON format is applicable to collection, granule, variable, service and tool searches. The UMM-JSON response is helpful if you wish to get the native-id of a concept after ingesting it. The version of the UMM returned will be the version requested or the latest version. Clients are recommended to always specify a version to avoid breaking changes in UMM.
776776

@@ -903,7 +903,7 @@ __Example__
903903

904904
A collection containing "\_errors" is not valid UMM and cannot be ingested into the CMR.
905905

906-
#### <a name="kml"></a> KML
906+
### <a name="kml"></a> KML
907907

908908
KML is the [XML language](http://www.opengeospatial.org/standards/kml) used by the Google Earth application and is used by the CMR to return spatial data associated with a collection or granule.
909909

@@ -959,7 +959,7 @@ __Example__
959959
</kml>
960960
```
961961

962-
#### <a name="open-data"></a> Open Data
962+
### <a name="open-data"></a> Open Data
963963

964964
The Open Data format was developed as part of [Project Open Data](https://project-open-data.cio.gov) in an attempt to make data more accessible. See the Open Data [schema](https://project-open-data.cio.gov/v1.1/schema/) for details.
965965

@@ -997,7 +997,7 @@ __Example__
997997
}
998998
```
999999

1000-
#### <a name="stac"></a> STAC
1000+
### <a name="stac"></a> STAC
10011001

10021002
The STAC (SpatioTemporal Asset Catalog) result format is a specification for describing geospatial data with JSON and GeoJSON. The related STAC-API specification defines an API for searching and browsing STAC catalogs. See the [STAC Specification](https://stacspec.org/) for details.
10031003

@@ -1190,7 +1190,7 @@ __Granule Retrieval in STAC Format Response Example via POST__
11901190
}
11911191
}
11921192
```
1193-
#### <a name="xml-reference"></a> XML
1193+
### <a name="xml-reference"></a> XML
11941194

11951195
The XML response format is used for returning references to search results. It consists of the following fields:
11961196

0 commit comments

Comments
 (0)