Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

LEAD TDR Interface

February 12, 2008

Please note that the interface described here is still a prototype, and subject to change.

Resources

TDR resources are THREDDS datasets, containers, and metadata. Resources are assigned owners based on the user name provided in authentication. It is an error to modify resources owned by others.

URLs

In handling requests, the server makes these mappings: Note that in the last case it is expected that the path provided uniquely identifies either a dataset or a catalog.

Double slashes are removed. Spaces are replaced with underscores.

Create A New Resource or Update a Resource

If the path does not exist a priori, a new resource will be created. For a valid request, all path elements (tokens in the path) for the new resource are created. If a path exists a priori, the resource will be updated.

Note that datasets and metadata are handled separately. The client must ensure that the two are properly synchronized by performing the appropriate operations.

In creating a new resource, the user name that is provided via Tomcat authentication is used as the "owner" of a resource. The server does not include this name in any way in the path provided by the client. If the client wants a user name in the path, then it must be provided explicitly as part of the path.

It is an error to update a resource by a user that is not the owner of that resource.

HTTP Request Type
URL
Contents of Body
Description
Notes
PUT http://server:8080/tdr/lead/<path> data file to be uploaded Puts or updates data file in location specified
PUT http://server:8080/tdr/lead/<path>/ none Creates a container in location specified If container exists a priori, nothing is changed.
PUT http://server:8080/tdr/lead/<path>&unpack=<type> data file to be uploaded Puts or updates data file in location specified, unpacks it. The collection is put under the <path>, e.g., a path test and a tar file rooted by a directory called code would result in a path test/code/.... The type must be one of these file name extensions: .tar, .tar.Z, .tar.zip, .tar.gzip, .tar.gz, and .tar.bz2.
PUT http://server:8080/tdr/lead/<path>/&unpack=<type> none Error, can't unpack a container
PUT http://server:8080/tdr/lead/<path>/_metadata.xml XML file of metadata values Puts metadata for dataset or container Depends on existence of dataset or container, error otherwise. Values for keys defined in keyset are placed with those keys. Values for keys not defined in keyset are placed as properties. See section on "TDR Metadata XML Schema" for further information.

Create New or Update Resource Examples

Create a new container called "Anne":
PUT http://servername:8080/tdr/lead/Anne/
(request has no body)

Add a container called "wxChallenge" and a nested dataset called "experiment_notes" to the above:
PUT http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes
(file is attached as body)

Add metadata to "experiment_notes" to the above:
PUT http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes_metadata.xml
(metadata is attached as body in XML format)

Update the dataset called "Anne/wxChallenge/experiment_notes":
PUT http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes
(file is attached as body)

Update metadata to "experiment_notes" to the above:
PUT http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes_metadata.xml
(metadata is attached as body in XML format)

Get Resource

Get will return a representation of a resource. The TDR will provide simple GET functionality. More complex requests, such as those that involving OPeNDAP, WCS, subsetting or aggregation, should be directed to a co-existing TDS.

HTTP Request Type
URL
Description
Notes
GET http://server:8080/tdr/lead/<path> Returns data file from location specified
GET http://server:8080/tdr/lead/<path>/ Returns THREDDS catalog from location specified
GET http://server:8080/tdr/lead/<path>_metadata.xml Returns metadata for dataset or container in XML Depends on existence of dataset or container, error otherwise.

Get Resource Examples

Get the THREDDS catalog corresponding to the container called "Anne":
GET http://servername:8080/tdr/lead/Anne/

Get the dataset called "Anne/wxChallenge/experiment_notes":
GET http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes

Get the metadata associated with "experiment_notes" in XML format:
GET http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes_metadata.xml

Remove Resource

Note that removing a container removes the container and everything below it. Removing a dataset or a container also removes any associated metadata.

It is an error to remove a resource by a user that is not the owner of that resource.

HTTP Request Type
URL
Description
Notes
DELETE http://server:8080/tdr/lead/<path> Deletes data file from location specified Also deletes metadata
DELETE http://server:8080/tdr/lead/<path>/ Deletes container and everything below it from location specified Also deletes metadata
DELETE http://server:8080/tdr/lead/<path>_metadata.xml Deletes metadata for dataset or container in XML Depends on existence of dataset or container, error otherwise.

Remove Resource Examples

Remove the metadata associated with "experiment_notes" in XML format:
DELETE http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes_metadata.xml

Remove the dataset called "Anne/wxChallenge/experiment_notes":
DELETE http://servername:8080/tdr/lead/Anne/wxChallenge/experiment_notes

Remove the the container called "Anne" and everything below it:
DELETE http://servername:8080/tdr/lead/Anne/

Status Codes Returned

TDR Metadata XML Schema

The TDR will receive and return metadata using a very simple XML schema:

        <?xml version="1.0" encoding="UTF-8"?>
        <document>
          <NVPair name="name">regexp</NVPair>
          <NVPair name="dataType">Image</NVPair>
          <NVPair name="dataFormatType">BUFR</NVPair>
          <NVPair name="summary">the quick brown fox</NVPair>
          <NVPair name="startTime">2007-06-28 11:40:00Z</NVPair>
          <NVPair name="endTime">2007-06-28 11:40:00Z</NVPair>
          <NVPair name="north">20.0</NVPair>
          <NVPair name="south">10.0</NVPair>
          <NVPair name="east">40.2</NVPair>
          <NVPair name="west">30.1</NVPair>
          <NVPair name="title">New User Title</NVPair>
          <NVPair name="publisherName">Anne</NVPair>
          <NVPair name="publisherUrl">www.unidata.ucar.edu</NVPair>
          <NVPair name="publisherEmail">anne@unidata.ucar.edu</NVPair>
          <NVPair name="xlink" title="unidata">http://www.unidata.ucar.edu</NVPair>
          <NVPair name="new name 1">value</NVPair>
          <NVPair name="new name 2">5.2</NVPair>
        </document>

Predefined metadata elements are defined in the section below.

These keys are mapped directly to THREDDS metadata elements. Other keys and their values are stored in THREDDS metadata as properties.

Note that currently the xlink key requires an attribute that is the title of the xlink.

Predefined Metadata

A TDR client can provide and replace metadata associated with a dataset or container. This table describes the set of predefined metadata elements. Other metadata elements can be provided and will be stored as properties.

Query Parameter Name
Description
Allowable Values
Notes
title A title. Any value provided by the client.
publisherName Name of person publishing. Any value provided by the client.
publisherEmail Email address for publisher. Any value provided by the client.
publisherURL URL for publisher. Any value provided by the client.
north Northern latitude boundary. A numeric value. Default is 50.0.
west Western longitude boundary. A numeric value. Default is -115.0.
east Eastern longitude boundary. A numeric value. Default is -60.0.
south Southern latitude boundary. A numeric value. Default is 25.0.
summary A textual description. Any string.
startTime Beginning time coverage. Must be in form: "2007-06-28T11:40:00".
endTime End time coverage Must be in form: "2007-06-28T11:40:00".
xlinkTitle_0 Title of URI 0. Any string.
xlinkURI_0 URI 0 A valid URI.
xlinkTitle_1 Title of URI 1. Any string.
xlinkURI_1 URI 1 A valid URI.
xlinkTitle_2 Title of URI 2. Any string.
xlinkURI_2 URI 2 A valid URI.
dataType One of: Grid, Image, Point, Radial, Station, Swath, Trajectory, other/unknown
dataFormatType One of: BUFR, ESML, GEMPAK, GINI, GRIB-1, GRIB-2, HDF4, HDF5, HTML, image/gif, image/jpeg, image/tiff, McIDAS-AREA, NetCDF, NEXRAD2, NcML, NIDS, text/plain, text/tab-separated-values, text/xml, video/mpeg, video/quicktime, video/realtime, other/unknown.
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690