Skip to content

Latest commit

 

History

History
263 lines (159 loc) · 10.8 KB

File metadata and controls

263 lines (159 loc) · 10.8 KB

XREDS API

Alongside the viewer (demo site provided at: https://nextgen-dev.ioos.us/xreds/), XREDS functions as a data API that serves up datasets for use in other products and services. The datasets have been pre-configured within XREDS itself, and combined with multiple caching and workload distribution strategies, XREDS provides a simple and fast way to interact with incredible amounts of data.

To see all of the available API endpoints that XREDS serves, SwaggerUI provides simple documentation at /docs (demo site: https://nextgen-dev.ioos.us/xreds/docs). The following sections will break down the each of these endpoints.

  1. Datasets
  2. Subset
  3. Export
  4. OpenDAP
  5. EDR
  6. WMS
  7. Miscellaneous

Datasets

These are standard endpoints that give base-level access to the different datasets served through XREDS. In addition to the endpoints specified here, most other services that reference a particular dataset are prepended with the /datasets/{0}/ syntax

fetches the list of all available datasets served through XREDS

Returns

JSON list of all datasets

loads the XArray definition of the specified dataset in HTML format

Parameters

0 | string - id

id of the dataset to fetch

Returns

Interactive Webpage representing the XArray contents of the dataset

fetches the XArray definition of the specified dataset in JSON format

Parameters

0 | string - id

id of the dataset to fetch

Returns

JSON dictionary of XArray contents of the dataset

fetches the list of all available variables for the specified dataset

Parameters

0 | string - id

id of the dataset to fetch

Returns

JSON list of all dataset variables

fetches the XPublish info for the specified dataset

Parameters

0 | string - id

id of the dataset to fetch

Returns

JSON dictionary of dataset info

provides the size of the dataset in MB

Parameters

0 | string - id

id of the dataset to fetch

Returns

JSON response containing the size of the dataset

provides the Zarr definition of the dataset, which can then be loaded using tools such as XArray's open_zarr

Parameters

0 | string - id

id of the dataset to fetch

Returns

Zarr definition of requested dataset

Subset

These endpoints allow for only a specified portion of a dataset to be accessed, which can speed up computationally complex functions by limiting the amount of data used in the function. All endpoints that reference a specific dataset (any endpoint that starts with /datasets/{0}/ syntax) can be used with Subset, including endpoints from Datasets, Export, OpenDAP, EDR, and WMS

Subset is commonly used with Export, as full datasets can be anywhere between gigabytes and terabytes in size, so subsetting allows for only the desired time range and/or geographic region of the dataset to be downloaded, greatly reducing the size of the file.

provides a subset of the specified dataset using the subset_string, which can be used in any available dataset endpoint by replacing /datasets/{0} with /datasets/{0}/subset/{1}/

Parameters

0 | string - id

id of the dataset to fetch

1 | string - subset_string

string used to subset the dataset, which can be any of the following options, or multiple combined with &

  • POLYGON((x1 y1, x2 y2, ..., xn yn))
  • BBOX(minx, miny, maxx, maxy)
  • TIME(start, end)

Returns

the same type as the original request, which in this example is an interactive webpage showing the XArray representation of the dataset subset

Export

These endpoints give access to information on how to download a dataset, along with providing the actual download URL. These are usually used together with Subset in order to only download the minimum amount of data required (and to keep the file size under the value provided by /export/threshold)

fetches the list of the available formats datasets can be downloaded in

Returns

JSON dictionary of formats with descriptions for each

fetches the maximum size in MB of a dataset or subset of a dataset that can be downloaded

Returns

JSON dictionary with the maximum download size in MB

fetches the maximum size in MB of a dataset or subset of a dataset that can be downloaded

Returns

JSON dictionary with the maximum download size in MB

downloads the requested dataset in the format specified in the request filename (note that the demo URL is showing using Export with Subset for size reasons)

Parameters

0 | string - id

id of the dataset to download

1 | string - filename

name of the dataset file once downloaded

Returns

Dataset downloaded as a file in the format specified by the filename

OpenDAP

These endpoints give access to the datasets following the request and response specifications of OpenDAP 2.0. The following OpenDAP serices are supported: DDS, DAS, DODS.

[GET] /datasets/{0}/opendap.dds (demo: https://nextgen-dev.ioos.us/xreds/datasets/cbofs/opendap.dds)

fetches the requested dataset in OpenDAP Dataset Descriptor Structure (DDS) format

Parameters

0 | string - id

id of the dataset to fetch

Returns

DDS representation of the requested dataset

[GET] /datasets/{0}/opendap.das (demo: https://nextgen-dev.ioos.us/xreds/datasets/cbofs/opendap.das)

fetches the requested dataset in OpenDAP Dataset Attribute Structure (DAS) format

Parameters

0 | string - id

id of the dataset to fetch

Returns

DAS representation of the requested dataset

downloads the requested dataset in OpenDAP Distributed Oceanographic Data Systems (DODS) format (note that the demo URL is showing using OpenDAP with Subset for size reasons)

Parameters

0 | string - id

id of the dataset to download

Returns

DODS representation of the requested dataset

EDR

These endpoints give access to the datasets following the request and response specifications of OCR EDR API. More details on the specifics of the implementation can be found here

[GET] /edr/position/formats (demo: https://nextgen-dev.ioos.us/xreds/edr/position/formats)

fetches the various supported formats for EDR position queries

Returns

JSON dictionary of supported EDR formats

fetches the various supported formats for EDR area queries

Returns

JSON dictionary of supported EDR formats

fetches the EDR collection metadata of the specified dataset

Parameters

0 | string - id

id of the dataset to download

Returns

JSON dictionary of supported EDR formats

[GET] /datasets/{0}/edr/position

fetches the EDR data of the specified dataset
follows the EDR Position Specifications

[GET] /datasets/{0}/edr/area

fetches the EDR data of the specified dataset
follows the EDR Area Specifications

WMS

This endpoint gives access to the datasets following the request and response specifications of OCR WMS API. More details on the specifics of the implementation can be found here

[GET] /datasets/{0}/wms

fetches the WMS data of the specified dataset
follows the WMS 1.3.0 Specifications

Miscellaneous

fetches the list of installed XPublish plugins

Returns

JSON dictionary of installed plugins with version information

fetches the list of versions for important libraries and OS information

Returns

JSON dictionary of library version information